mirror of
https://github.com/vleeuwenmenno/supplements.git
synced 2025-09-11 18:29:12 +02:00
adds retry functionality
This commit is contained in:
@@ -106,23 +106,96 @@ class SettingsScreen extends StatelessWidget {
|
||||
const SizedBox(height: 16),
|
||||
// Notifications
|
||||
Card(
|
||||
child: ListTile(
|
||||
leading: const Icon(Icons.snooze),
|
||||
title: const Text('Snooze duration'),
|
||||
subtitle: const Text('Delay for Snooze action'),
|
||||
trailing: DropdownButton<int>(
|
||||
value: settingsProvider.snoozeMinutes,
|
||||
items: const [
|
||||
DropdownMenuItem(value: 5, child: Text('5 min')),
|
||||
DropdownMenuItem(value: 10, child: Text('10 min')),
|
||||
DropdownMenuItem(value: 15, child: Text('15 min')),
|
||||
DropdownMenuItem(value: 20, child: Text('20 min')),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Notifications',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
leading: const Icon(Icons.snooze),
|
||||
title: const Text('Snooze duration'),
|
||||
subtitle: const Text('Delay for Snooze action'),
|
||||
trailing: DropdownButton<int>(
|
||||
value: settingsProvider.snoozeMinutes,
|
||||
items: const [
|
||||
DropdownMenuItem(value: 5, child: Text('5 min')),
|
||||
DropdownMenuItem(value: 10, child: Text('10 min')),
|
||||
DropdownMenuItem(value: 15, child: Text('15 min')),
|
||||
DropdownMenuItem(value: 20, child: Text('20 min')),
|
||||
],
|
||||
onChanged: (value) {
|
||||
if (value != null) {
|
||||
settingsProvider.setSnoozeMinutes(value);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
const Divider(),
|
||||
SwitchListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
secondary: const Icon(Icons.repeat),
|
||||
title: const Text('Notification Retries'),
|
||||
subtitle: const Text('Automatically retry missed notifications'),
|
||||
value: settingsProvider.notificationRetryEnabled,
|
||||
onChanged: (value) {
|
||||
settingsProvider.setNotificationRetryEnabled(value);
|
||||
},
|
||||
),
|
||||
if (settingsProvider.notificationRetryEnabled) ...[
|
||||
const SizedBox(height: 8),
|
||||
ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
leading: const Icon(Icons.format_list_numbered),
|
||||
title: const Text('Retry count'),
|
||||
subtitle: const Text('Number of retry attempts'),
|
||||
trailing: DropdownButton<int>(
|
||||
value: settingsProvider.notificationRetryCount,
|
||||
items: const [
|
||||
DropdownMenuItem(value: 1, child: Text('1')),
|
||||
DropdownMenuItem(value: 2, child: Text('2')),
|
||||
DropdownMenuItem(value: 3, child: Text('3')),
|
||||
DropdownMenuItem(value: 4, child: Text('4')),
|
||||
DropdownMenuItem(value: 5, child: Text('5')),
|
||||
],
|
||||
onChanged: (value) {
|
||||
if (value != null) {
|
||||
settingsProvider.setNotificationRetryCount(value);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
leading: const Icon(Icons.schedule),
|
||||
title: const Text('Retry delay'),
|
||||
subtitle: const Text('Time between retry attempts'),
|
||||
trailing: DropdownButton<int>(
|
||||
value: settingsProvider.notificationRetryDelayMinutes,
|
||||
items: const [
|
||||
DropdownMenuItem(value: 1, child: Text('1 min')),
|
||||
DropdownMenuItem(value: 2, child: Text('2 min')),
|
||||
DropdownMenuItem(value: 3, child: Text('3 min')),
|
||||
DropdownMenuItem(value: 5, child: Text('5 min')),
|
||||
DropdownMenuItem(value: 10, child: Text('10 min')),
|
||||
DropdownMenuItem(value: 15, child: Text('15 min')),
|
||||
DropdownMenuItem(value: 20, child: Text('20 min')),
|
||||
DropdownMenuItem(value: 30, child: Text('30 min')),
|
||||
],
|
||||
onChanged: (value) {
|
||||
if (value != null) {
|
||||
settingsProvider.setNotificationRetryDelayMinutes(value);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
onChanged: (value) {
|
||||
if (value != null) {
|
||||
settingsProvider.setSnoozeMinutes(value);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
|
Reference in New Issue
Block a user