From 21cc54525124dc22e3ef230db3de6818a6062326 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 4 Jan 2023 14:57:29 -0600 Subject: [PATCH] desktop paynym card clean up --- .../paynym/add_new_paynym_follow_view.dart | 5 + .../subwidgets/featured_paynyms_widget.dart | 18 ++- lib/pages/paynym/subwidgets/paynym_card.dart | 113 ++++++++---------- 3 files changed, 70 insertions(+), 66 deletions(-) diff --git a/lib/pages/paynym/add_new_paynym_follow_view.dart b/lib/pages/paynym/add_new_paynym_follow_view.dart index 0329e1120..e8e978a38 100644 --- a/lib/pages/paynym/add_new_paynym_follow_view.dart +++ b/lib/pages/paynym/add_new_paynym_follow_view.dart @@ -439,6 +439,11 @@ class _AddNewPaynymFollowViewState if (_didSearch && _searchResult != null) RoundedWhiteContainer( padding: const EdgeInsets.all(0), + borderColor: isDesktop + ? Theme.of(context) + .extension()! + .backgroundAppBar + : null, child: PaynymCard( label: _searchResult!.nymName, paymentCodeString: _searchResult!.codes.first.code, diff --git a/lib/pages/paynym/subwidgets/featured_paynyms_widget.dart b/lib/pages/paynym/subwidgets/featured_paynyms_widget.dart index c848c090d..fcb9d1637 100644 --- a/lib/pages/paynym/subwidgets/featured_paynyms_widget.dart +++ b/lib/pages/paynym/subwidgets/featured_paynyms_widget.dart @@ -41,10 +41,20 @@ class FeaturedPaynymsWidget extends StatelessWidget { .backgroundAppBar, height: 1, ), - PaynymCard( - walletId: walletId, - label: entries[i].key, - paymentCodeString: entries[i].value, + ConditionalParent( + condition: isDesktop, + builder: (child) => RoundedWhiteContainer( + padding: const EdgeInsets.all(0), + borderColor: Theme.of(context) + .extension()! + .backgroundAppBar, + child: child, + ), + child: PaynymCard( + walletId: walletId, + label: entries[i].key, + paymentCodeString: entries[i].value, + ), ), ], ), diff --git a/lib/pages/paynym/subwidgets/paynym_card.dart b/lib/pages/paynym/subwidgets/paynym_card.dart index 5aeb8fbfc..be989a588 100644 --- a/lib/pages/paynym/subwidgets/paynym_card.dart +++ b/lib/pages/paynym/subwidgets/paynym_card.dart @@ -4,9 +4,7 @@ import 'package:stackwallet/utilities/format.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/theme/stack_colors.dart'; import 'package:stackwallet/utilities/util.dart'; -import 'package:stackwallet/widgets/conditional_parent.dart'; import 'package:stackwallet/widgets/custom_buttons/paynym_follow_toggle_button.dart'; -import 'package:stackwallet/widgets/rounded_white_container.dart'; class PaynymCard extends StatefulWidget { const PaynymCard({ @@ -29,67 +27,58 @@ class _PaynymCardState extends State { @override Widget build(BuildContext context) { - return ConditionalParent( - condition: isDesktop, - builder: (child) => RoundedWhiteContainer( - padding: const EdgeInsets.all(0), - borderColor: - Theme.of(context).extension()!.backgroundAppBar, - child: child, - ), - child: Padding( - padding: isDesktop - ? const EdgeInsets.symmetric( - vertical: 16, - horizontal: 20, - ) - : const EdgeInsets.all(12), - child: Row( - children: [ - PayNymBot( - size: 32, - paymentCodeString: widget.paymentCodeString, + return Padding( + padding: isDesktop + ? const EdgeInsets.symmetric( + vertical: 16, + horizontal: 20, + ) + : const EdgeInsets.all(12), + child: Row( + children: [ + PayNymBot( + size: 32, + paymentCodeString: widget.paymentCodeString, + ), + const SizedBox( + width: 12, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.label, + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall(context) + .copyWith( + color: Theme.of(context) + .extension()! + .textFieldActiveText, + ) + : STextStyles.w500_12(context), + ), + const SizedBox( + height: 2, + ), + Text( + Format.shorten(widget.paymentCodeString, 12, 5), + style: isDesktop + ? STextStyles.desktopTextExtraExtraSmall(context) + : STextStyles.w500_12(context).copyWith( + color: Theme.of(context) + .extension()! + .textSubtitle1, + ), + ), + ], ), - const SizedBox( - width: 12, - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - widget.label, - style: isDesktop - ? STextStyles.desktopTextExtraExtraSmall(context) - .copyWith( - color: Theme.of(context) - .extension()! - .textFieldActiveText, - ) - : STextStyles.w500_12(context), - ), - const SizedBox( - height: 2, - ), - Text( - Format.shorten(widget.paymentCodeString, 12, 5), - style: isDesktop - ? STextStyles.desktopTextExtraExtraSmall(context) - : STextStyles.w500_12(context).copyWith( - color: Theme.of(context) - .extension()! - .textSubtitle1, - ), - ), - ], - ), - ), - PaynymFollowToggleButton( - walletId: widget.walletId, - paymentCodeStringToFollow: widget.paymentCodeString, - ), - ], - ), + ), + PaynymFollowToggleButton( + walletId: widget.walletId, + paymentCodeStringToFollow: widget.paymentCodeString, + ), + ], ), ); }