From 2359674946d49451055721531ad1ef81d498b978 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 12 Apr 2023 15:15:58 -0600 Subject: [PATCH] quickfix for swapping between exchanges --- .../exchange_provider_options.dart | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/lib/pages/exchange_view/sub_widgets/exchange_provider_options.dart b/lib/pages/exchange_view/sub_widgets/exchange_provider_options.dart index c00e7dfe8..f770278f3 100644 --- a/lib/pages/exchange_view/sub_widgets/exchange_provider_options.dart +++ b/lib/pages/exchange_view/sub_widgets/exchange_provider_options.dart @@ -13,6 +13,7 @@ import 'package:stackwallet/utilities/amount/amount.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/logger.dart'; +import 'package:stackwallet/utilities/show_loading.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/theme/stack_colors.dart'; import 'package:stackwallet/utilities/util.dart'; @@ -94,11 +95,17 @@ class _ExchangeProviderOptionsState onTap: () { if (ref.read(exchangeFormStateProvider).exchange.name != ChangeNowExchange.exchangeName) { - ref.read(exchangeFormStateProvider).updateExchange( - exchange: ChangeNowExchange.instance, - shouldUpdateData: true, - shouldNotifyListeners: true, - ); + showLoading( + whileFuture: + ref.read(exchangeFormStateProvider).updateExchange( + exchange: ChangeNowExchange.instance, + shouldUpdateData: true, + shouldNotifyListeners: true, + ), + context: context, + message: "Updating rates", + isDesktop: isDesktop, + ); } }, child: Container( @@ -333,11 +340,17 @@ class _ExchangeProviderOptionsState onTap: () { if (ref.read(exchangeFormStateProvider).exchange.name != MajesticBankExchange.exchangeName) { - ref.read(exchangeFormStateProvider).updateExchange( - exchange: MajesticBankExchange.instance, - shouldUpdateData: true, - shouldNotifyListeners: true, - ); + showLoading( + whileFuture: + ref.read(exchangeFormStateProvider).updateExchange( + exchange: MajesticBankExchange.instance, + shouldUpdateData: true, + shouldNotifyListeners: true, + ), + context: context, + isDesktop: isDesktop, + message: "Updating rates", + ); } }, child: Container(