fix(ui): show all SnackBars for 5 seconds instead of Flutter default 4s
Closes #17 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
2985198d9c
commit
d932f59f25
@@ -181,7 +181,10 @@ class _AccountTile extends ConsumerWidget {
|
||||
);
|
||||
if (context.mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Starting sync verification...')),
|
||||
const SnackBar(
|
||||
duration: Duration(seconds: 5),
|
||||
content: Text('Starting sync verification...'),
|
||||
),
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -192,7 +192,12 @@ class _ComposeScreenState extends ConsumerState<ComposeScreen> {
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(SnackBar(content: Text('Failed to open file: $e')));
|
||||
).showSnackBar(
|
||||
SnackBar(
|
||||
duration: const Duration(seconds: 5),
|
||||
content: Text('Failed to open file: $e'),
|
||||
),
|
||||
);
|
||||
} finally {
|
||||
if (mounted) setState(() => _opening = false);
|
||||
}
|
||||
@@ -206,7 +211,12 @@ class _ComposeScreenState extends ConsumerState<ComposeScreen> {
|
||||
if (_accountId == null) {
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(const SnackBar(content: Text('Select an account first')));
|
||||
).showSnackBar(
|
||||
const SnackBar(
|
||||
duration: Duration(seconds: 5),
|
||||
content: Text('Select an account first'),
|
||||
),
|
||||
);
|
||||
return;
|
||||
}
|
||||
setState(() => _sending = true);
|
||||
@@ -243,7 +253,12 @@ class _ComposeScreenState extends ConsumerState<ComposeScreen> {
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(SnackBar(content: Text('Send failed: $e')));
|
||||
).showSnackBar(
|
||||
SnackBar(
|
||||
duration: const Duration(seconds: 5),
|
||||
content: Text('Send failed: $e'),
|
||||
),
|
||||
);
|
||||
} finally {
|
||||
if (mounted) setState(() => _sending = false);
|
||||
}
|
||||
|
||||
@@ -78,7 +78,10 @@ class CrashScreen extends StatelessWidget {
|
||||
await Clipboard.setData(ClipboardData(text: data));
|
||||
if (context.mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Copied to clipboard')),
|
||||
const SnackBar(
|
||||
duration: Duration(seconds: 5),
|
||||
content: Text('Copied to clipboard'),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
@@ -105,6 +108,7 @@ class CrashScreen extends StatelessWidget {
|
||||
if (!launched && context.mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
duration: Duration(seconds: 5),
|
||||
content: Text('Could not open browser.'),
|
||||
),
|
||||
);
|
||||
@@ -113,7 +117,12 @@ class CrashScreen extends StatelessWidget {
|
||||
if (context.mounted) {
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(SnackBar(content: Text('Error: $e')));
|
||||
).showSnackBar(
|
||||
SnackBar(
|
||||
duration: const Duration(seconds: 5),
|
||||
content: Text('Error: $e'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -417,6 +417,7 @@ class _EmailDetailScreenState extends ConsumerState<EmailDetailScreen> {
|
||||
if (context.mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
duration: const Duration(seconds: 5),
|
||||
content: Text(
|
||||
'Snoozed until ${DateFormat('MMM d, HH:mm').format(until)}',
|
||||
),
|
||||
@@ -430,6 +431,7 @@ class _EmailDetailScreenState extends ConsumerState<EmailDetailScreen> {
|
||||
if (body.headers.isEmpty) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
duration: Duration(seconds: 5),
|
||||
content: Text('No headers available. Try re-syncing the email.'),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -290,7 +290,10 @@ class _EmailListScreenState extends ConsumerState<EmailListScreen> {
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('Sync failed: $e')),
|
||||
SnackBar(
|
||||
duration: const Duration(seconds: 5),
|
||||
content: Text('Sync failed: $e'),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
@@ -421,7 +424,12 @@ class _EmailListScreenState extends ConsumerState<EmailListScreen> {
|
||||
if (mailbox == null) {
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(SnackBar(content: Text(notFoundMessage)));
|
||||
).showSnackBar(
|
||||
SnackBar(
|
||||
duration: const Duration(seconds: 5),
|
||||
content: Text(notFoundMessage),
|
||||
),
|
||||
);
|
||||
return;
|
||||
}
|
||||
final repo = ref.read(emailRepositoryProvider);
|
||||
@@ -579,6 +587,7 @@ class _EmailListScreenState extends ConsumerState<EmailListScreen> {
|
||||
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
duration: const Duration(seconds: 5),
|
||||
content: Text(
|
||||
'Snoozed ${ids.length} email${ids.length == 1 ? '' : 's'} until ${DateFormat('MMM d, HH:mm').format(until)}',
|
||||
),
|
||||
|
||||
@@ -61,7 +61,12 @@ class _SieveScriptsScreenState extends ConsumerState<SieveScriptsScreen> {
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(SnackBar(content: Text('Failed to activate: $e')));
|
||||
).showSnackBar(
|
||||
SnackBar(
|
||||
duration: const Duration(seconds: 5),
|
||||
content: Text('Failed to activate: $e'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -94,7 +99,12 @@ class _SieveScriptsScreenState extends ConsumerState<SieveScriptsScreen> {
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(SnackBar(content: Text('Failed to delete: $e')));
|
||||
).showSnackBar(
|
||||
SnackBar(
|
||||
duration: const Duration(seconds: 5),
|
||||
content: Text('Failed to delete: $e'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,12 @@ class _UndoActionTile extends ConsumerWidget {
|
||||
if (context.mounted) {
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(const SnackBar(content: Text('Action undone.')));
|
||||
).showSnackBar(
|
||||
const SnackBar(
|
||||
duration: Duration(seconds: 5),
|
||||
content: Text('Action undone.'),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
child: const Text('Undo'),
|
||||
|
||||
@@ -29,6 +29,7 @@ class UndoShell extends ConsumerWidget {
|
||||
scaffoldMessenger.clearSnackBars();
|
||||
scaffoldMessenger.showSnackBar(
|
||||
SnackBar(
|
||||
duration: const Duration(seconds: 5),
|
||||
content: Text(
|
||||
action.type == UndoType.delete
|
||||
? '${action.emailIds.length} email(s) moved to Trash'
|
||||
|
||||
Reference in New Issue
Block a user