Fix error handling in various admin and inventory screens
Test Suite / test (24.15.0) (push) Has been cancelled
Test Suite / test (24.15.0) (push) Has been cancelled
- Updated error handling in AdminAliasesPanel, AdminDatabasePanel, AdminPendingProductsPanel, and AdminProductsPanel to ensure consistent snackbar display without extra parentheses. - Refined error handling in ConsumeInventoryScreen, CreateInventoryScreen, InventoryDetailScreen, InventoryEditScreen, and SwipeableInventoryTile to maintain consistent snackbar formatting. - Improved error handling in MealPlanScreen, PantryScreen, ProfileScreen, and RecipeDetailScreen to ensure proper user feedback on errors.
This commit is contained in:
@@ -52,7 +52,7 @@ class _ConsumeInventoryScreenState
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context)
|
||||
.showSnackBar(buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context))));
|
||||
.showSnackBar(buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context)));
|
||||
}
|
||||
} finally {
|
||||
if (mounted) setState(() => _saving = false);
|
||||
|
||||
@@ -76,7 +76,7 @@ class _CreateInventoryScreenState
|
||||
if (mounted) setState(() => _loadingProducts = false);
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context))),
|
||||
buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context)),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -136,7 +136,7 @@ class _CreateInventoryScreenState
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context)
|
||||
.showSnackBar(buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context))));
|
||||
.showSnackBar(buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context)));
|
||||
}
|
||||
} finally {
|
||||
if (mounted) setState(() => _saving = false);
|
||||
|
||||
@@ -122,7 +122,7 @@ class _DeleteButton extends ConsumerWidget {
|
||||
} catch (e) {
|
||||
if (context.mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context))),
|
||||
buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ class _InventoryEditScreenState extends ConsumerState<InventoryEditScreen> {
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context)
|
||||
.showSnackBar(buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context))));
|
||||
.showSnackBar(buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context)));
|
||||
}
|
||||
} finally {
|
||||
if (mounted) setState(() => _saving = false);
|
||||
|
||||
@@ -122,7 +122,7 @@ class _SwipeableInventoryTileState
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context))),
|
||||
buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context)),
|
||||
);
|
||||
} finally {
|
||||
if (mounted) setState(() => _acting = false);
|
||||
@@ -372,7 +372,7 @@ class _DeleteButton extends ConsumerWidget {
|
||||
ref.invalidate(inventoryProvider);
|
||||
} catch (e) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context))),
|
||||
buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user