diff --git a/lib/tools/util.dart b/lib/tools/util.dart index 90f1dd3..03787bf 100644 --- a/lib/tools/util.dart +++ b/lib/tools/util.dart @@ -463,16 +463,26 @@ bool isJobTooFarInFuture(Job job) { } Future taskDialogSecurityException(BuildContext context) async { - bool close = false; + final result = await showDialog( + context: context, + barrierDismissible: false, + builder: (dialogContext) { + return AlertDialog( + title: const Text('Achtung'), + content: const Text('Wenn Sie den Dialog jetzt schließen gehen erfasste Daten verloren und die Aufgabe oder Station bleibt unerledigt.'), + actions: [ + TextButton( + onPressed: () => Navigator.of(dialogContext).pop(true), + child: const Text('Schließen'), + ), + TextButton( + onPressed: () => Navigator.of(dialogContext).pop(false), + child: const Text('Zurück'), + ), + ], + ); + }, + ); - await showQuestionDialog(context, "Achtung", "Wenn Sie den Dialog jetzt schließen gehen erfasste Daten verloren und die Aufgabe oder Station bleibt unerledigt.", [ - TextButton(onPressed: () => {Navigator.of(MyApp.appNavigatorKey.currentContext!).pop(), close = true}, child: const Text('Schließen')), - TextButton(onPressed: () => {Navigator.of(MyApp.appNavigatorKey.currentContext!).pop(), close = false}, child: const Text('Zurück')), - ]); - - if (close) { - Navigator.of(MyApp.appNavigatorKey.currentContext!).pop(); - } - - return close; + return result ?? false; } diff --git a/pubspec.yaml b/pubspec.yaml index cf1eee3..b5ff200 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 345.0.0+345 +version: 346.0.0+346 environment: sdk: '>=3.5.0 <4.0.0'