From 247561ad6b511998e7ef9b2f7dcd3f616f754a57 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Thu, 19 Oct 2023 12:54:22 -0500 Subject: [PATCH] add responsive spacer --- lib/pages/cashfusion/fusion_progress_view.dart | 18 +++++++++--------- .../cashfusion/sub_widgets/fusion_dialog.dart | 16 +++++++++------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/lib/pages/cashfusion/fusion_progress_view.dart b/lib/pages/cashfusion/fusion_progress_view.dart index bd5757405..0ffc1e2e5 100644 --- a/lib/pages/cashfusion/fusion_progress_view.dart +++ b/lib/pages/cashfusion/fusion_progress_view.dart @@ -89,6 +89,12 @@ class _FusionProgressViewState extends ConsumerState { @override Widget build(BuildContext context) { + bool _succeeded = + ref.watch(fusionProgressUIStateProvider(widget.walletId)).succeeded; + + bool _failed = + ref.watch(fusionProgressUIStateProvider(widget.walletId)).failed; + return WillPopScope( onWillPop: () async { return await _requestAndProcessCancel(); @@ -130,10 +136,7 @@ class _FusionProgressViewState extends ConsumerState { FusionProgress( walletId: widget.walletId, ), - if (ref - .watch(fusionProgressUIStateProvider( - widget.walletId)) - .succeeded) + if (_succeeded) Expanded( child: PrimaryButton( buttonHeight: ButtonHeight.m, @@ -141,10 +144,7 @@ class _FusionProgressViewState extends ConsumerState { onPressed: () => _fuseAgain, ), ), - if (ref - .watch(fusionProgressUIStateProvider( - widget.walletId)) - .failed) + if (_failed) Expanded( child: PrimaryButton( buttonHeight: ButtonHeight.m, @@ -152,7 +152,7 @@ class _FusionProgressViewState extends ConsumerState { onPressed: () => _fuseAgain, ), ), - // if (!_succeeded! && !_failed!) const Spacer(), + if (!_succeeded! && !_failed!) const Spacer(), const SizedBox( height: 16, ), diff --git a/lib/pages_desktop_specific/cashfusion/sub_widgets/fusion_dialog.dart b/lib/pages_desktop_specific/cashfusion/sub_widgets/fusion_dialog.dart index 78fae11ab..a67fd0b3d 100644 --- a/lib/pages_desktop_specific/cashfusion/sub_widgets/fusion_dialog.dart +++ b/lib/pages_desktop_specific/cashfusion/sub_widgets/fusion_dialog.dart @@ -136,6 +136,12 @@ class _FusionDialogViewState extends ConsumerState { @override Widget build(BuildContext context) { + bool _succeeded = + ref.watch(fusionProgressUIStateProvider(widget.walletId)).succeeded; + + bool _failed = + ref.watch(fusionProgressUIStateProvider(widget.walletId)).failed; + return DesktopDialog( maxHeight: 600, child: SingleChildScrollView( @@ -179,9 +185,7 @@ class _FusionDialogViewState extends ConsumerState { ), Row( children: [ - if (ref - .watch(fusionProgressUIStateProvider(widget.walletId)) - .succeeded) + if (_succeeded) Expanded( child: PrimaryButton( buttonHeight: ButtonHeight.m, @@ -189,9 +193,7 @@ class _FusionDialogViewState extends ConsumerState { onPressed: () => _fuseAgain, ), ), - if (ref - .watch(fusionProgressUIStateProvider(widget.walletId)) - .failed) + if (_failed) Expanded( child: PrimaryButton( buttonHeight: ButtonHeight.m, @@ -199,7 +201,7 @@ class _FusionDialogViewState extends ConsumerState { onPressed: () => _fuseAgain, ), ), - // if (!_succeeded! && !_failed!) const Spacer(), + if (!_succeeded! && !_failed!) const Spacer(), const SizedBox( width: 16, ),