@@ -7,6 +7,7 @@ import 'package:threebotlogin/models/wallet.dart';
77import 'package:threebotlogin/providers/wallets_provider.dart' ;
88import 'package:threebotlogin/services/stellar_service.dart' as StellarService;
99import 'package:threebotlogin/widgets/custom_dialog.dart' ;
10+ import 'package:threebotlogin/services/tfchain_service.dart' as TFChainService;
1011
1112class ActivateWalletWidget extends ConsumerStatefulWidget {
1213 const ActivateWalletWidget ({super .key, required this .wallet});
@@ -50,9 +51,10 @@ class _ActivateWalletWidgetState extends ConsumerState<ActivateWalletWidget> {
5051 }
5152 } catch (e) {
5253 logger.e ('Failed to load TFT price: $e ' );
54+ final price = await TFChainService .getTFTPrice (Globals ().chainUrl) * 0.5 ;
5355 if (mounted) {
5456 setState (() {
55- tftPrice = 0 ;
57+ tftPrice = price. ceil () ;
5658 isLoadingPrice = false ;
5759 });
5860 }
@@ -67,11 +69,24 @@ class _ActivateWalletWidgetState extends ConsumerState<ActivateWalletWidget> {
6769 .map ((wallet) {
6870 return DropdownMenuEntry <Wallet >(
6971 value: wallet,
70- label: wallet.name,
71- labelWidget: Text (wallet.name,
72- style: Theme .of (context).textTheme.bodyLarge! .copyWith (
73- color: Theme .of (context).colorScheme.onSurface,
74- )),
72+ label: "${wallet .name } (${wallet .stellarBalance } TFT)" ,
73+ labelWidget: Row (
74+ mainAxisAlignment: MainAxisAlignment .spaceBetween,
75+ children: [
76+ Text (
77+ wallet.name,
78+ style: Theme .of (context).textTheme.bodyLarge! .copyWith (
79+ color: Theme .of (context).colorScheme.onSurface,
80+ ),
81+ ),
82+ Text (
83+ "${wallet .stellarBalance } TFT" ,
84+ style: Theme .of (context).textTheme.bodyMedium! .copyWith (
85+ color: Theme .of (context).colorScheme.onSurfaceVariant,
86+ ),
87+ ),
88+ ],
89+ ),
7590 );
7691 }).toList ();
7792 }
@@ -133,7 +148,6 @@ class _ActivateWalletWidgetState extends ConsumerState<ActivateWalletWidget> {
133148 ),
134149 );
135150 walletRef.reloadBalances ();
136- widget.wallet.stellarBalance = '0' ;
137151 Navigator .pop (context);
138152 } else {
139153 logger.e ('Failed to activate wallet' );
0 commit comments