From 3678cc1a4262b180cb5c9c4d789b26c8fbb25deb Mon Sep 17 00:00:00 2001 From: sneurlax Date: Thu, 19 Oct 2023 16:26:56 -0500 Subject: [PATCH] make `ref.watch`ers final, expand mobile fusion success message --- .../cashfusion/fusion_progress_view.dart | 31 ++++++++++--------- .../cashfusion/sub_widgets/fusion_dialog.dart | 18 +++++------ 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/lib/pages/cashfusion/fusion_progress_view.dart b/lib/pages/cashfusion/fusion_progress_view.dart index 562fa7b68..f7e1ff45c 100644 --- a/lib/pages/cashfusion/fusion_progress_view.dart +++ b/lib/pages/cashfusion/fusion_progress_view.dart @@ -90,13 +90,13 @@ class _FusionProgressViewState extends ConsumerState { @override Widget build(BuildContext context) { - bool _succeeded = + final bool _succeeded = ref.watch(fusionProgressUIStateProvider(widget.walletId)).succeeded; - bool _failed = + final bool _failed = ref.watch(fusionProgressUIStateProvider(widget.walletId)).failed; - int _fusionRoundsCompleted = ref + final int _fusionRoundsCompleted = ref .watch(fusionProgressUIStateProvider(widget.walletId)) .fusionRoundsCompleted; @@ -141,18 +141,21 @@ class _FusionProgressViewState extends ConsumerState { // TODO if (_succeeded but roundCount > roundCount) // show "Fusion completed" as snackBarBackSuccess. if (_fusionRoundsCompleted > 0) - RoundedContainer( - color: Theme.of(context) - .extension()! - .snackBarBackInfo, - child: Text( - "Fusion rounds completed: $_fusionRoundsCompleted", - style: STextStyles.w500_14(context).copyWith( - color: Theme.of(context) - .extension()! - .snackBarTextInfo, + Expanded( + child: RoundedContainer( + color: Theme.of(context) + .extension()! + .snackBarBackInfo, + child: Text( + "Fusion rounds completed: $_fusionRoundsCompleted", + style: + STextStyles.w500_14(context).copyWith( + color: Theme.of(context) + .extension()! + .snackBarTextInfo, + ), + textAlign: TextAlign.center, ), - textAlign: TextAlign.center, ), ), if (_fusionRoundsCompleted > 0) 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 0098b03d7..e0c9d1527 100644 --- a/lib/pages_desktop_specific/cashfusion/sub_widgets/fusion_dialog.dart +++ b/lib/pages_desktop_specific/cashfusion/sub_widgets/fusion_dialog.dart @@ -138,13 +138,13 @@ class _FusionDialogViewState extends ConsumerState { @override Widget build(BuildContext context) { - bool _succeeded = + final bool _succeeded = ref.watch(fusionProgressUIStateProvider(widget.walletId)).succeeded; - bool _failed = + final bool _failed = ref.watch(fusionProgressUIStateProvider(widget.walletId)).failed; - int _fusionRoundsCompleted = ref + final int _fusionRoundsCompleted = ref .watch(fusionProgressUIStateProvider(widget.walletId)) .fusionRoundsCompleted; @@ -223,7 +223,7 @@ class _FusionDialogViewState extends ConsumerState { onPressed: () => _fuseAgain, ), ), - // if (!_succeeded && !_failed) const Spacer(), + if (!_succeeded && !_failed) const Spacer(), const SizedBox( height: 12, ), @@ -247,11 +247,11 @@ class _FusionDialogViewState extends ConsumerState { ), ), if (_failed) const Spacer(), - // if (!_succeeded && !_failed) const Spacer(), - // if (!_succeeded && !_failed) - // const SizedBox( - // width: 16, - // ), + if (!_succeeded && !_failed) const Spacer(), + if (!_succeeded && !_failed) + const SizedBox( + width: 16, + ), Expanded( child: SecondaryButton( buttonHeight: ButtonHeight.m,