From fc5878d9912a0e8f85880b83fd618ab6c9dfd711 Mon Sep 17 00:00:00 2001 From: David Adegoke <64401859+Blazebrain@users.noreply.github.com> Date: Sat, 28 Sep 2024 01:04:10 +0100 Subject: [PATCH] Currently selected wallet pointer UI (#1710) * feat: Add UI signifying the currently selected wallet indicator * fix: Product Fix - Add more padding to child wallets list item tile in grouped wallets, fix sort by dragging for general single wallets, and also groups, add animation to trailing arrow icon when tile is expanded or not * Update wallet group image and change maxLines * fix: Make group tile expand if it has the currently selected wallet and fix issue with wallet group image --------- Co-authored-by: tuxpizza --- .../wallet_group_description_page.dart | 23 +++++++++++++++---- .../grouped_wallet_expansion_tile.dart | 3 +++ .../screens/wallet_list/wallet_list_page.dart | 2 +- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/lib/src/screens/new_wallet/wallet_group_description_page.dart b/lib/src/screens/new_wallet/wallet_group_description_page.dart index f30ff1d6cd..5becea3a5f 100644 --- a/lib/src/screens/new_wallet/wallet_group_description_page.dart +++ b/lib/src/screens/new_wallet/wallet_group_description_page.dart @@ -32,10 +32,10 @@ class WalletGroupDescriptionPage extends BasePage { padding: EdgeInsets.all(24), child: Column( children: [ - Image.asset( - image, - height: 200 - ), + Image.asset( + _getThemedWalletGroupImage(currentTheme.type), + height: 200, + ), SizedBox(height: 32), Expanded( child: Text.rich( @@ -96,4 +96,19 @@ class WalletGroupDescriptionPage extends BasePage { ), ); } + + String _getThemedWalletGroupImage(ThemeType theme) { + final lightImage = 'assets/images/wallet_group_light.png'; + final darkImage = 'assets/images/wallet_group_dark.png'; + final brightImage = 'assets/images/wallet_group_bright.png'; + + switch (theme) { + case ThemeType.bright: + return brightImage; + case ThemeType.light: + return lightImage; + default: + return darkImage; + } + } } diff --git a/lib/src/screens/new_wallet/widgets/grouped_wallet_expansion_tile.dart b/lib/src/screens/new_wallet/widgets/grouped_wallet_expansion_tile.dart index 57f6a9047e..74057cc876 100644 --- a/lib/src/screens/new_wallet/widgets/grouped_wallet_expansion_tile.dart +++ b/lib/src/screens/new_wallet/widgets/grouped_wallet_expansion_tile.dart @@ -77,6 +77,9 @@ class GroupedWalletExpansionTile extends StatelessWidget { ), child: ExpansionTile( onExpansionChanged: onExpansionChanged, + initiallyExpanded: shouldShowCurrentWalletPointer + ? childWallets.any((element) => element.isCurrent) + : false, key: tileKey, tilePadding: EdgeInsets.symmetric(vertical: 1, horizontal: !isCurrentlySelectedWallet ? 16 : 0), diff --git a/lib/src/screens/wallet_list/wallet_list_page.dart b/lib/src/screens/wallet_list/wallet_list_page.dart index 8bb9593c91..d17534f6bb 100644 --- a/lib/src/screens/wallet_list/wallet_list_page.dart +++ b/lib/src/screens/wallet_list/wallet_list_page.dart @@ -259,7 +259,7 @@ class WalletListBodyState extends State { tileKey: ValueKey('single_wallets_expansion_tile_widget_$index'), isCurrentlySelectedWallet: wallet.isCurrent, leadingWidget: SizedBox( - width: 60, + width: wallet.isCurrent ? 56 : 40, child: Row( children: [ wallet.isCurrent