fix: handle wallet delete flushbar dismissal (#3697)
What changed, and why it matters
This is a small UI bug fix in a wallet management screen. It changes how a progress notification (a 'flushbar') is closed when deleting a wallet, preventing a possible crash or visual glitch if the notification was already gone or its route was no longer active. There is no indication this affects money, keys, passwords, or network security.
No security action required. Treat as a normal stability/UI fix.
Security signals we found
UI state cleanup only
No cryptographic or authentication changes
No network or storage changes
Exception is caught and logged
Evidence from the diff
The patch in wallet_edit_page.dart refactors hideProgressText() to safely dismiss a Flushbar progress indicator. It now checks whether the flushbar’s underlying route is active and whether the bar is currently showing before calling dismiss(), and falls back to removing the route directly if the bar is not showing. This avoids calling dismiss() on an inactive/dismissed flushbar route, which could throw a Flutter framework exception or leave a stale route. No cryptographic, wallet-storage, or network code is touched.
Changed components
lib/src/screens/wallet/wallet_edit_page.dartWallet deletion progress flushbar UIInspect captured patch +11 / −1
### lib/src/screens/wallet/wallet_edit_page.dart
@@ -229,7 +229,17 @@ class WalletEditPage extends BasePage {
Future<void> hideProgressText() async {
try {
await Future.delayed(Duration(milliseconds: 250));
- await _progressBar?.dismiss();
+
+ final bar = _progressBar;
+ final barRoute = bar?.flushbarRoute;
+
+ if (bar != null && barRoute != null && barRoute.isActive) {
+ if (bar.isShowing()) {
+ await bar.dismiss();
+ } else {
+ barRoute.navigator?.removeRoute(barRoute);
+ }
+ }
} catch (e) {
printV(e);
}Why this scored 17/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.