From d3891d52d1a257387a6e89fbbf7fe6025b0d1703 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Sat, 28 Feb 2026 18:23:33 -0600 Subject: [PATCH 1/2] fix: remove double-pop from BuildingTransactionDialog cancel The dialog's cancel button popped the navigator itself and then invoked onCancel, while callers' onCancel handlers also popped, causing a double pop. Drop the internal pop so the caller owns the dismissal, and add the missing pop to Step4View's onCancel. --- lib/pages/exchange_view/exchange_step_views/step_4_view.dart | 1 + .../send_view/sub_widgets/building_transaction_dialog.dart | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/pages/exchange_view/exchange_step_views/step_4_view.dart b/lib/pages/exchange_view/exchange_step_views/step_4_view.dart index c19352ff23..be7d44b9fe 100644 --- a/lib/pages/exchange_view/exchange_step_views/step_4_view.dart +++ b/lib/pages/exchange_view/exchange_step_views/step_4_view.dart @@ -270,6 +270,7 @@ class _Step4ViewState extends ConsumerState { isSpark: wallet is FiroWallet && !firoPublicSend, onCancel: () { wasCancelled = true; + Navigator.of(context).pop(); }, ); }, diff --git a/lib/pages/send_view/sub_widgets/building_transaction_dialog.dart b/lib/pages/send_view/sub_widgets/building_transaction_dialog.dart index f7dc832f89..d9208da27e 100644 --- a/lib/pages/send_view/sub_widgets/building_transaction_dialog.dart +++ b/lib/pages/send_view/sub_widgets/building_transaction_dialog.dart @@ -145,7 +145,6 @@ class _RestoringDialogState extends ConsumerState { style: STextStyles.itemSubtitle12(context), ), onPressed: () { - Navigator.of(context).pop(); onCancel.call(); }, ), @@ -172,7 +171,6 @@ class _RestoringDialogState extends ConsumerState { style: STextStyles.itemSubtitle12(context), ), onPressed: () { - Navigator.of(context).pop(); onCancel.call(); }, ), From b21c190ecf73d184e6cd6a6e556b1c608f0231bd Mon Sep 17 00:00:00 2001 From: sneurlax Date: Thu, 28 May 2026 11:49:31 -0500 Subject: [PATCH 2/2] chore: dart format --- .../building_transaction_dialog.dart | 60 +++++-------------- 1 file changed, 14 insertions(+), 46 deletions(-) diff --git a/lib/pages/send_view/sub_widgets/building_transaction_dialog.dart b/lib/pages/send_view/sub_widgets/building_transaction_dialog.dart index d9208da27e..4cba928080 100644 --- a/lib/pages/send_view/sub_widgets/building_transaction_dialog.dart +++ b/lib/pages/send_view/sub_widgets/building_transaction_dialog.dart @@ -50,45 +50,24 @@ class _RestoringDialogState extends ConsumerState { @override Widget build(BuildContext context) { - final assetPath = ref.watch( - coinImageSecondaryProvider( - widget.coin, - ), - ); + final assetPath = ref.watch(coinImageSecondaryProvider(widget.coin)); if (Util.isDesktop) { return Column( mainAxisSize: MainAxisSize.min, children: [ - Text( - "Generating transaction", - style: STextStyles.desktopH3(context), - ), - if (widget.isSpark) - const SizedBox( - height: 16, - ), + Text("Generating transaction", style: STextStyles.desktopH3(context)), + if (widget.isSpark) const SizedBox(height: 16), if (widget.isSpark) Text( "This may take a few minutes...", style: STextStyles.desktopSubtitleH2(context), ), - const SizedBox( - height: 40, - ), + const SizedBox(height: 40), assetPath.endsWith(".gif") - ? Image.file( - File( - assetPath, - ), - ) - : const RotatingArrows( - width: 40, - height: 40, - ), - const SizedBox( - height: 40, - ), + ? Image.file(File(assetPath)) + : const RotatingArrows(width: 40, height: 40), + const SizedBox(height: 40), SecondaryButton( buttonHeight: ButtonHeight.l, label: "Cancel", @@ -109,29 +88,20 @@ class _RestoringDialogState extends ConsumerState { crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisSize: MainAxisSize.min, children: [ - Image.file( - File( - assetPath, - ), - ), + Image.file(File(assetPath)), Text( "Generating transaction", textAlign: TextAlign.center, style: STextStyles.pageTitleH2(context), ), - if (widget.isSpark) - const SizedBox( - height: 12, - ), + if (widget.isSpark) const SizedBox(height: 12), if (widget.isSpark) Text( "This may take a few minutes...", textAlign: TextAlign.center, style: STextStyles.w500_16(context), ), - const SizedBox( - height: 32, - ), + const SizedBox(height: 32), Row( children: [ const Spacer(), @@ -156,12 +126,10 @@ class _RestoringDialogState extends ConsumerState { ) : StackDialog( title: "Generating transaction", - message: - widget.isSpark ? "This may take a few minutes..." : null, - icon: const RotatingArrows( - width: 24, - height: 24, - ), + message: widget.isSpark + ? "This may take a few minutes..." + : null, + icon: const RotatingArrows(width: 24, height: 24), rightButton: TextButton( style: Theme.of(context) .extension()!