loading animation on sendCurrency

This commit is contained in:
ryleedavis 2022-12-30 17:26:14 -07:00
parent 7759bd2712
commit 31eeeb58c1

View file

@ -120,6 +120,29 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
fromTicker: fromTicker,
onSelected: (from) =>
ref.read(exchangeFormStateProvider).updateFrom(from, true));
unawaited(
showDialog<void>(
context: context,
barrierDismissible: false,
builder: (_) => WillPopScope(
onWillPop: () async => false,
child: Container(
color: Theme.of(context)
.extension<StackColors>()!
.overlay
.withOpacity(0.6),
child: const CustomLoadingOverlay(
message: "Updating exchange rate",
eventBus: null,
),
),
),
),
);
await Future<void>.delayed(const Duration(milliseconds: 300));
Navigator.of(context).pop();
} else {
final toTicker = ref.read(exchangeFormStateProvider).toTicker ?? "";
final fromTicker = ref.read(exchangeFormStateProvider).fromTicker ?? "";