fix(shopinbit): show step 4 submit errors as a dialog
What changed, and why it matters
This commit changes how error messages are shown to users when a ShopinBit order submission fails. Previously, a small temporary notification banner (a 'flush bar') appeared at the bottom of the screen. Now, a centered popup dialog appears instead. There is no security change here—only a user-interface improvement to make errors more noticeable.
No security action required. Treat as a routine UI/UX change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch replaces calls to showFloatingFlushBar with showDialog<...> using StackOkDialog in lib/pages/shopinbit/step_4_components/shopinbit_step4_submit.dart. Both the API-error path and the exception path are updated. The displayed message content remains essentially the same (API exception message or e.toString()). No logic, validation, cryptography, networking, or authentication behavior is modified.
Changed components
lib/pages/shopinbit/step_4_components/shopinbit_step4_submit.dartInspect captured patch +18 / −11
diff --git a/lib/pages/shopinbit/step_4_components/shopinbit_step4_submit.dart b/lib/pages/shopinbit/step_4_components/shopinbit_step4_submit.dart
index 9e0eeda..ed95f8c 100644
--- a/lib/pages/shopinbit/step_4_components/shopinbit_step4_submit.dart
+++ b/lib/pages/shopinbit/step_4_components/shopinbit_step4_submit.dart
@@ -4,8 +4,9 @@ import "package:flutter/material.dart";
import "../../../db/drift/shared_db/shared_database.dart";
import "../../../models/shopinbit/shopinbit_order_model.dart";
-import "../../../notifications/show_flush_bar.dart";
import "../../../services/shopinbit/shopinbit_service.dart";
+import "../../../utilities/util.dart";
+import "../../../widgets/stack_dialog.dart";
import "../shopinbit_order_created.dart";
/// Submits a ShopinBit request to the API and navigates to the order-created
@@ -48,11 +49,14 @@ Future<void> submitShopInBitRequest(
if (resp.hasError) {
if (context.mounted) {
- unawaited(
- showFloatingFlushBar(
- type: FlushBarType.warning,
- message: resp.exception?.message ?? "Failed to create request",
- context: context,
+ await showDialog<void>(
+ context: context,
+ useRootNavigator: Util.isDesktop,
+ builder: (context) => StackOkDialog(
+ title: "Failed to create request",
+ maxWidth: Util.isDesktop ? 500 : null,
+ message: resp.exception?.message,
+ desktopPopRootNavigator: Util.isDesktop,
),
);
}
@@ -77,11 +81,14 @@ Future<void> submitShopInBitRequest(
);
} catch (e) {
if (context.mounted) {
- unawaited(
- showFloatingFlushBar(
- type: FlushBarType.warning,
- message: "Failed to create request: $e",
- context: context,
+ await showDialog<void>(
+ context: context,
+ useRootNavigator: Util.isDesktop,
+ builder: (context) => StackOkDialog(
+ title: "Failed to create request",
+ maxWidth: Util.isDesktop ? 500 : null,
+ message: e.toString(),
+ desktopPopRootNavigator: Util.isDesktop,
),
);
}
Why this scored 15/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.