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:
@@ -94,7 +94,7 @@ class _AdminAliasesPanelState extends ConsumerState<AdminAliasesPanel> {
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(mapErrorToUserMessage(e, context))),
|
||||
buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context))),
|
||||
);
|
||||
} finally {
|
||||
if (mounted) setState(() => _isSaving = false);
|
||||
@@ -133,7 +133,7 @@ class _AdminAliasesPanelState extends ConsumerState<AdminAliasesPanel> {
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(mapErrorToUserMessage(e, context))),
|
||||
buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context))),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -259,3 +259,4 @@ class _AdminAliasesPanelState extends ConsumerState<AdminAliasesPanel> {
|
||||
return content;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class _AdminDatabasePanelState extends ConsumerState<AdminDatabasePanel> {
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(mapErrorToUserMessage(e, context))),
|
||||
buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context))),
|
||||
);
|
||||
} finally {
|
||||
if (mounted) setState(() => _isRefreshingCategories = false);
|
||||
@@ -180,3 +180,4 @@ class _AdminDatabasePanelState extends ConsumerState<AdminDatabasePanel> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ class _AdminPendingProductsPanelState
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(mapErrorToUserMessage(e, context))),
|
||||
buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context))),
|
||||
);
|
||||
} finally {
|
||||
if (mounted) setState(() => _processingId = null);
|
||||
@@ -152,4 +152,4 @@ class _AdminPendingProductsPanelState
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ class _AdminProductsPanelState extends ConsumerState<AdminProductsPanel> {
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(mapErrorToUserMessage(e, context))),
|
||||
buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context))),
|
||||
);
|
||||
} finally {
|
||||
if (mounted) setState(() => _isApplying = false);
|
||||
@@ -181,7 +181,7 @@ class _AdminProductsPanelState extends ConsumerState<AdminProductsPanel> {
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(mapErrorToUserMessage(e, context))),
|
||||
buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context))),
|
||||
);
|
||||
} finally {
|
||||
if (mounted) setState(() => _isAiRunning = false);
|
||||
@@ -321,7 +321,7 @@ class _AdminProductsPanelState extends ConsumerState<AdminProductsPanel> {
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(mapErrorToUserMessage(e, context))),
|
||||
buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context))),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -358,7 +358,7 @@ class _AdminProductsPanelState extends ConsumerState<AdminProductsPanel> {
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(mapErrorToUserMessage(e, context))),
|
||||
buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context))),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -380,7 +380,7 @@ class _AdminProductsPanelState extends ConsumerState<AdminProductsPanel> {
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(mapErrorToUserMessage(e, context))),
|
||||
buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context))),
|
||||
);
|
||||
} finally {
|
||||
if (mounted) setState(() => _isApplying = false);
|
||||
@@ -399,7 +399,7 @@ class _AdminProductsPanelState extends ConsumerState<AdminProductsPanel> {
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(mapErrorToUserMessage(e, context))),
|
||||
buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context))),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -435,7 +435,7 @@ class _AdminProductsPanelState extends ConsumerState<AdminProductsPanel> {
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(mapErrorToUserMessage(e, context))),
|
||||
buildCopyableErrorSnackBar(context, mapErrorToUserMessage(e, context))),
|
||||
);
|
||||
setState(() => _rowCategorySaving.remove(product.id));
|
||||
}
|
||||
@@ -811,4 +811,4 @@ class _AiApplyDialogState extends State<_AiApplyDialog> {
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user