Erweiterungen

This commit is contained in:
Sven committed 2024-05-29 20:34:22 +02:00
1 parent 17e7ce6fad
commit 054dfe616e
14 files changed
+297 -189

No files matched your search

+29 -1
View File
@@ -360,6 +360,19 @@ String mapTourMode(String mode) {
return text;
}
Future<void> showQuestionDialog(BuildContext context, String title, String message, List<Widget> actions) async {
await showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(title),
content: Text(message),
actions: actions,
);
}
);
}
Future<void> showAlertDialog(BuildContext context, String title, String message) async {
await showDialog(
context: context,
@@ -406,4 +419,19 @@ class DecimalTextInputFormatter extends TextInputFormatter {
bool isJobInFuture(Job job) {
return DateTime.parse(job.ordertime).add(Duration(minutes: job.offsWarn)).toUtc().millisecondsSinceEpoch > DateTime.now().toUtc().millisecondsSinceEpoch;
}
}
Future<bool> taskDialogSecurityException(BuildContext context) async {
bool close = false;
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(context).pop(), close = true}, child: const Text('Schließen')),
TextButton(onPressed: () => {Navigator.of(context).pop(), close = false}, child: const Text('Zurück')),
]);
if (close) {
Navigator.of(context).pop();
}
return close;
}