From 7a650c78d39006620e6ba4f96069feb42f6e1153 Mon Sep 17 00:00:00 2001 From: ryleedavis Date: Mon, 21 Nov 2022 15:17:26 -0700 Subject: [PATCH] loading indicator and delay for wallet keys --- .../unlock_wallet_keys_desktop.dart | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/lib/pages_desktop_specific/home/my_stack_view/wallet_view/sub_widgets/unlock_wallet_keys_desktop.dart b/lib/pages_desktop_specific/home/my_stack_view/wallet_view/sub_widgets/unlock_wallet_keys_desktop.dart index 23360c98c..739a3ebc4 100644 --- a/lib/pages_desktop_specific/home/my_stack_view/wallet_view/sub_widgets/unlock_wallet_keys_desktop.dart +++ b/lib/pages_desktop_specific/home/my_stack_view/wallet_view/sub_widgets/unlock_wallet_keys_desktop.dart @@ -16,6 +16,7 @@ import 'package:stackwallet/widgets/desktop/desktop_dialog.dart'; import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart'; import 'package:stackwallet/widgets/desktop/primary_button.dart'; import 'package:stackwallet/widgets/desktop/secondary_button.dart'; +import 'package:stackwallet/widgets/loading_indicator.dart'; import 'package:stackwallet/widgets/stack_text_field.dart'; class UnlockWalletKeysDesktop extends ConsumerStatefulWidget { @@ -201,11 +202,32 @@ class _UnlockWalletKeysDesktopState enabled: continueEnabled, onPressed: continueEnabled ? () async { + unawaited( + showDialog( + context: context, + builder: (context) => Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: const [ + LoadingIndicator( + width: 200, + height: 200, + ), + ], + ), + ), + ); + + await Future.delayed( + const Duration(seconds: 1)); + final verified = await ref .read(storageCryptoHandlerProvider) .verifyPassphrase(passwordController.text); if (verified) { + Navigator.of(context, rootNavigator: true).pop(); + final words = await ref .read(walletsChangeNotifierProvider) .getManager(widget.walletId) @@ -219,6 +241,11 @@ class _UnlockWalletKeysDesktopState ); } } else { + Navigator.of(context, rootNavigator: true).pop(); + + await Future.delayed( + const Duration(milliseconds: 300)); + unawaited( showFloatingFlushBar( type: FlushBarType.warning,