featured paynyms widget

This commit is contained in:
julian 2022-12-21 12:03:23 -06:00
parent 45754d1565
commit 08ad23cc73
2 changed files with 86 additions and 0 deletions

View file

@ -0,0 +1,81 @@
import 'package:flutter/material.dart';
import 'package:stackwallet/pages/paynym/subwidgets/paynym_bot.dart';
import 'package:stackwallet/utilities/featured_paynyms.dart';
import 'package:stackwallet/utilities/format.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/desktop/primary_button.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
class FeaturedPaynymsWidget extends StatelessWidget {
const FeaturedPaynymsWidget({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final entries = FeaturedPaynyms.featured.entries.toList(growable: false);
return RoundedWhiteContainer(
padding: const EdgeInsets.all(0),
child: Column(
children: [
for (int i = 0; i < entries.length; i++)
Column(
children: [
if (i > 0)
Container(
color: Theme.of(context)
.extension<StackColors>()!
.backgroundAppBar,
height: 1,
),
Padding(
padding: const EdgeInsets.all(12),
child: Row(
children: [
PayNymBot(
size: 32,
paymentCodeString: entries[i].value,
),
const SizedBox(
width: 12,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
entries[i].key,
style: STextStyles.w500_12(context),
),
const SizedBox(
height: 2,
),
Text(
Format.shorten(entries[i].value, 12, 5),
style: STextStyles.w500_12(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textSubtitle1,
),
),
],
),
),
PrimaryButton(
width: 84,
buttonHeight: ButtonHeight.l,
label: "Follow",
onPressed: () {
// todo : follow
},
)
],
),
),
],
),
],
),
);
}
}

View file

@ -4,4 +4,9 @@ abstract class FeaturedPaynyms {
"PM8TJYkuSdYXJnwDBq8ChfinfXv3srxhQrx3eoEwbSw51wMjdo9JJ2DsycwT3gt3zHQ7cV1grvabMmmf1Btj6fY7tgkgSz9B8MZuR3kjYfgMLMURJCXN";
static const String stackWallet =
"PM8TJYkuSdYXJnwDBq8ChfinfXv3srxhQrx3eoEwbSw51wMjdo9JJ2DsycwT3gt3zHQ7cV1grvabMmmf1Btj6fY7tgkgSz9B8MZuR3kjYfgMLMURJCXN";
static Map<String, String> get featured => {
"Stack Wallet": stackWallet,
"Samourai Wallet Dev Fund": samouraiWalletDevFund,
};
}