From b0d37804faa4da0b8ca987aedabe980a132dda52 Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 28 Mar 2023 16:21:26 -0600 Subject: [PATCH] token view pop fix --- lib/widgets/master_wallet_card.dart | 2 +- lib/widgets/wallet_card.dart | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/lib/widgets/master_wallet_card.dart b/lib/widgets/master_wallet_card.dart index af8b6e196..65f65c3a1 100644 --- a/lib/widgets/master_wallet_card.dart +++ b/lib/widgets/master_wallet_card.dart @@ -125,7 +125,7 @@ class _MasterWalletCardState extends ConsumerState { child: WalletSheetCard( walletId: widget.walletId, contractAddress: e, - // popPrevious: true, + popPrevious: true, ), ), ), diff --git a/lib/widgets/wallet_card.dart b/lib/widgets/wallet_card.dart index 4648d6bf7..fa134aa15 100644 --- a/lib/widgets/wallet_card.dart +++ b/lib/widgets/wallet_card.dart @@ -12,12 +12,11 @@ import 'package:stackwallet/services/ethereum/ethereum_token_service.dart'; import 'package:stackwallet/services/transaction_notification_tracker.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; +import 'package:stackwallet/utilities/show_loading.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; import 'package:stackwallet/widgets/wallet_info_row/wallet_info_row.dart'; import 'package:tuple/tuple.dart'; -import '../utilities/show_loading.dart'; - class WalletSheetCard extends ConsumerWidget { const WalletSheetCard({ Key? key, @@ -45,15 +44,17 @@ class WalletSheetCard extends ConsumerWidget { ), ), onPressed: () async { + final nav = Navigator.of(context); + final manager = ref.read(walletsChangeNotifierProvider).getManager(walletId); if (manager.coin == Coin.monero || manager.coin == Coin.wownero) { await manager.initializeExisting(); } if (context.mounted) { - if (popPrevious) Navigator.of(context).pop(); + if (popPrevious) nav.pop(); unawaited( - Navigator.of(context).pushNamed( + nav.pushNamed( WalletView.routeName, arguments: Tuple2( walletId, @@ -83,12 +84,15 @@ class WalletSheetCard extends ConsumerWidget { message: "Loading ${contract.name}", ); - if (context.mounted) { - await Navigator.of(context).pushNamed( - TokenView.routeName, - arguments: walletId, - ); - } + // pop loading + nav.pop(); + + // if (context.mounted) { + await nav.pushNamed( + TokenView.routeName, + arguments: walletId, + ); + // } } } },