@@ -23,12 +23,12 @@ import '../../../utilities/amount/amount.dart';
2323import '../../../utilities/assets.dart' ;
2424import '../../../utilities/constants.dart' ;
2525import '../../../utilities/text_styles.dart' ;
26- import '../../../wallets/crypto_currency/crypto_currency.dart' ;
2726import '../../../wallets/isar/providers/solana/current_sol_token_wallet_provider.dart' ;
2827import '../../../wallets/isar/providers/solana/sol_token_balance_provider.dart' ;
2928import '../../../wallets/isar/providers/wallet_info_provider.dart' ;
3029import '../../../widgets/coin_ticker_tag.dart' ;
3130import '../../../widgets/conditional_parent.dart' ;
31+ import '../../../widgets/hideable_balance.dart' ;
3232import '../../../widgets/rounded_container.dart' ;
3333import '../../receive_view/sol_token_receive_view.dart' ;
3434import '../../send_view/sol_token_send_view.dart' ;
@@ -63,8 +63,9 @@ class SolanaTokenSummary extends ConsumerWidget {
6363 child: Text (
6464 "Loading token data..." ,
6565 style: STextStyles .subtitle500 (context).copyWith (
66- color:
67- Theme .of (context).extension < StackColors > ()! .tokenSummaryTextPrimary,
66+ color: Theme .of (
67+ context,
68+ ).extension < StackColors > ()! .tokenSummaryTextPrimary,
6869 ),
6970 ),
7071 ),
@@ -73,12 +74,7 @@ class SolanaTokenSummary extends ConsumerWidget {
7374
7475 // Watch the balance from the database provider.
7576 final balance = ref.watch (
76- pSolanaTokenBalance (
77- (
78- walletId: walletId,
79- tokenMint: tokenMint,
80- ),
81- ),
77+ pSolanaTokenBalance ((walletId: walletId, tokenMint: tokenMint)),
8278 );
8379
8480 Decimal ? price;
@@ -124,28 +120,40 @@ class SolanaTokenSummary extends ConsumerWidget {
124120 Row (
125121 mainAxisAlignment: MainAxisAlignment .center,
126122 children: [
127- Text (
128- balance.total.decimal.toStringAsFixed (tokenWallet.tokenDecimals),
129- style: STextStyles .pageTitleH1 (context).copyWith (
130- color: Theme .of (
131- context,
132- ).extension < StackColors > ()! .tokenSummaryTextPrimary,
123+ HideableBalance (
124+ iconColor: Theme .of (
125+ context,
126+ ).extension < StackColors > ()! .tokenSummaryTextPrimary,
127+ iconSize: 24 ,
128+ child: Text (
129+ balance.total.decimal.toStringAsFixed (
130+ tokenWallet.tokenDecimals,
131+ ),
132+ style: STextStyles .pageTitleH1 (context).copyWith (
133+ color: Theme .of (
134+ context,
135+ ).extension < StackColors > ()! .tokenSummaryTextPrimary,
136+ ),
133137 ),
134138 ),
135139 const SizedBox (width: 10 ),
136- CoinTickerTag (
137- ticker: tokenWallet.tokenSymbol,
138- ),
140+ CoinTickerTag (ticker: tokenWallet.tokenSymbol),
139141 ],
140142 ),
141143 if (price != null ) const SizedBox (height: 6 ),
142144 if (price != null )
143- Text (
144- "${(balance .total .decimal * price ).toAmount (fractionDigits : 2 ).fiatString (locale : ref .watch (localeServiceChangeNotifierProvider .select ((value ) => value .locale )))} ${ref .watch (prefsChangeNotifierProvider .select ((value ) => value .currency ))}" ,
145- style: STextStyles .subtitle500 (context).copyWith (
146- color: Theme .of (
147- context,
148- ).extension < StackColors > ()! .tokenSummaryTextPrimary,
145+ HideableBalance (
146+ iconColor: Theme .of (
147+ context,
148+ ).extension < StackColors > ()! .tokenSummaryTextPrimary,
149+ iconSize: 16 ,
150+ child: Text (
151+ "${(balance .total .decimal * price ).toAmount (fractionDigits : 2 ).fiatString (locale : ref .watch (localeServiceChangeNotifierProvider .select ((value ) => value .locale )))} ${ref .watch (prefsChangeNotifierProvider .select ((value ) => value .currency ))}" ,
152+ style: STextStyles .subtitle500 (context).copyWith (
153+ color: Theme .of (
154+ context,
155+ ).extension < StackColors > ()! .tokenSummaryTextPrimary,
156+ ),
149157 ),
150158 ),
151159 const SizedBox (height: 20 ),
@@ -163,8 +171,9 @@ class SolanaTokenSummary extends ConsumerWidget {
163171 walletId: walletId,
164172 initialSyncStatus: initialSyncStatus,
165173 tokenContractAddress: tokenMint,
166- overrideIconColor:
167- Theme .of (context).extension < StackColors > ()! .topNavIconPrimary,
174+ overrideIconColor: Theme .of (
175+ context,
176+ ).extension < StackColors > ()! .topNavIconPrimary,
168177 ),
169178 ),
170179 ],
@@ -250,8 +259,9 @@ class TokenOptionsButton extends StatelessWidget {
250259 crossAxisAlignment: CrossAxisAlignment .center,
251260 children: [
252261 RawMaterialButton (
253- fillColor:
254- Theme .of (context).extension < StackColors > ()! .tokenSummaryButtonBG,
262+ fillColor: Theme .of (
263+ context,
264+ ).extension < StackColors > ()! .tokenSummaryButtonBG,
255265 elevation: 0 ,
256266 focusElevation: 0 ,
257267 hoverElevation: 0 ,
@@ -267,47 +277,41 @@ class TokenOptionsButton extends StatelessWidget {
267277 padding: const EdgeInsets .all (10 ),
268278 child: ConditionalParent (
269279 condition: iconSize < 24 ,
270- builder:
271- (child) => RoundedContainer (
272- padding: const EdgeInsets .all (6 ),
273- color: Theme .of (context)
274- .extension < StackColors > ()!
275- .tokenSummaryIcon
276- .withOpacity (0.4 ),
277- radiusMultiplier: 10 ,
278- child: Center (child: child),
279- ),
280- child:
281- iconAssetPathSVG.startsWith ("assets/" )
282- ? SvgPicture .asset (
283- iconAssetPathSVG,
284- color:
285- Theme .of (
286- context,
287- ).extension < StackColors > ()! .tokenSummaryIcon,
288- width: iconSize,
289- height: iconSize,
290- )
291- : SvgPicture .file (
292- File (iconAssetPathSVG),
293- color:
294- Theme .of (
295- context,
296- ).extension < StackColors > ()! .tokenSummaryIcon,
297- width: iconSize,
298- height: iconSize,
299- ),
280+ builder: (child) => RoundedContainer (
281+ padding: const EdgeInsets .all (6 ),
282+ color: Theme .of (
283+ context,
284+ ).extension < StackColors > ()! .tokenSummaryIcon.withOpacity (0.4 ),
285+ radiusMultiplier: 10 ,
286+ child: Center (child: child),
287+ ),
288+ child: iconAssetPathSVG.startsWith ("assets/" )
289+ ? SvgPicture .asset (
290+ iconAssetPathSVG,
291+ color: Theme .of (
292+ context,
293+ ).extension < StackColors > ()! .tokenSummaryIcon,
294+ width: iconSize,
295+ height: iconSize,
296+ )
297+ : SvgPicture .file (
298+ File (iconAssetPathSVG),
299+ color: Theme .of (
300+ context,
301+ ).extension < StackColors > ()! .tokenSummaryIcon,
302+ width: iconSize,
303+ height: iconSize,
304+ ),
300305 ),
301306 ),
302307 ),
303308 const SizedBox (height: 6 ),
304309 Text (
305310 subLabel,
306311 style: STextStyles .w500_12 (context).copyWith (
307- color:
308- Theme .of (
309- context,
310- ).extension < StackColors > ()! .tokenSummaryTextPrimary,
312+ color: Theme .of (
313+ context,
314+ ).extension < StackColors > ()! .tokenSummaryTextPrimary,
311315 ),
312316 ),
313317 ],
0 commit comments