Added dialog

This commit is contained in:
2025-11-19 21:41:30 +01:00
parent a8d4e640cf
commit 822bc03c83

View File

@@ -103,11 +103,31 @@ class _SettingsViewState extends State<SettingsView> {
icon: Icons.download_outlined, icon: Icons.download_outlined,
suffixWidget: const Icon(Icons.arrow_forward_ios, size: 16), suffixWidget: const Icon(Icons.arrow_forward_ios, size: 16),
onPressed: () { onPressed: () {
showDialog<bool>(
context: context,
builder: (context) => AlertDialog(
title: const Text('Delete all data?'),
content: const Text('This can\'t be undone'),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(false),
child: const Text('Abbrechen'),
),
TextButton(
onPressed: () => Navigator.of(context).pop(true),
child: const Text('Löschen'),
),
],
),
).then((confirmed) {
if (confirmed == true && context.mounted) {
DataTransferService.deleteAllData(context); DataTransferService.deleteAllData(context);
showSnackbar( showSnackbar(
context: context, context: context,
message: 'Data successfully deleted', message: 'Daten erfolgreich gelöscht',
); );
}
});
}, },
), ),
], ],