feat: enhance error handling; implement copyable SnackBar for user messages across various screens
Test Suite / test (24.15.0) (push) Has been cancelled
Test Suite / test (24.15.0) (push) Has been cancelled
This commit is contained in:
@@ -166,7 +166,7 @@ class _PantryScreenState extends ConsumerState<PantryScreen> {
|
||||
_logger.severe('Failed to add item to inventory: $error');
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(mapErrorToUserMessage(error, context))),
|
||||
buildCopyableErrorSnackBar(context, mapErrorToUserMessage(error, context))),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -185,7 +185,7 @@ class _PantryScreenState extends ConsumerState<PantryScreen> {
|
||||
_logger.severe('Failed to add pantry item: $error');
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(mapErrorToUserMessage(error, context))),
|
||||
buildCopyableErrorSnackBar(context, mapErrorToUserMessage(error, context))),
|
||||
);
|
||||
} finally {
|
||||
if (mounted) setState(() => _isSubmitting = false);
|
||||
@@ -221,7 +221,7 @@ class _PantryScreenState extends ConsumerState<PantryScreen> {
|
||||
_logger.severe('Failed to remove pantry item: $error');
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(mapErrorToUserMessage(error, context))),
|
||||
buildCopyableErrorSnackBar(context, mapErrorToUserMessage(error, context))),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -419,3 +419,4 @@ class _PantryScreenState extends ConsumerState<PantryScreen> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user