From 46fe178b08c5f93aacde3ee7eba39c6785c52959 Mon Sep 17 00:00:00 2001 From: ryleedavis Date: Mon, 2 Jan 2023 11:44:33 -0700 Subject: [PATCH] loading animation on changing receive currency --- lib/pages/exchange_view/exchange_form.dart | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lib/pages/exchange_view/exchange_form.dart b/lib/pages/exchange_view/exchange_form.dart index 251e0b8ef..fb7915969 100644 --- a/lib/pages/exchange_view/exchange_form.dart +++ b/lib/pages/exchange_view/exchange_form.dart @@ -246,6 +246,29 @@ class _ExchangeFormState extends ConsumerState { fromTicker: ref.read(exchangeFormStateProvider).fromTicker ?? "", onSelected: (to) => ref.read(exchangeFormStateProvider).updateTo(to, true)); + + unawaited( + showDialog( + context: context, + barrierDismissible: false, + builder: (_) => WillPopScope( + onWillPop: () async => false, + child: Container( + color: Theme.of(context) + .extension()! + .overlay + .withOpacity(0.6), + child: const CustomLoadingOverlay( + message: "Updating exchange rate", + eventBus: null, + ), + ), + ), + ), + ); + + await Future.delayed(const Duration(milliseconds: 300)); + Navigator.of(context).pop(); } else { final fromTicker = ref.read(exchangeFormStateProvider).fromTicker ?? ""; final toTicker = ref.read(exchangeFormStateProvider).toTicker ?? "";