From 054dfe616e36c68cbc25a6d0282c90c7387208b8 Mon Sep 17 00:00:00 2001 From: Sven Carstensen Date: Wed, 29 May 2024 20:34:22 +0200 Subject: [PATCH] Erweiterungen --- lib/content_views/task_list_page.dart | 22 ++- lib/popups/infos_popup.dart | 19 ++- lib/popups/tasks_popups/arrived_popup.dart | 83 +++++------ .../tasks_popups/commision_number_popup.dart | 83 +++++------ .../pickup_delivery_status_popup.dart | 27 +++- .../tasks_popups/receipt_giver_popup.dart | 8 +- .../tasks_popups/scan_barcodes_popup.dart | 8 +- lib/popups/tasks_popups/signature_popup.dart | 134 +++++++++--------- .../tasks_popups/station_notice_popup.dart | 8 +- .../tasks_popups/take_photos_popup.dart | 42 ++++-- lib/popups/tasks_popups/zip_popup.dart | 8 +- lib/tools/mqtt_core.dart | 12 +- lib/tools/util.dart | 30 +++- pubspec.yaml | 2 +- 14 files changed, 297 insertions(+), 189 deletions(-) diff --git a/lib/content_views/task_list_page.dart b/lib/content_views/task_list_page.dart index 48dc4ba..c6e26fd 100644 --- a/lib/content_views/task_list_page.dart +++ b/lib/content_views/task_list_page.dart @@ -218,7 +218,7 @@ class _TaskListPageState extends State { taskInfo.sId = task.sId; taskInfo.answer = null; taskInfo.additionalText = null; - taskInfo.completed = task.opt != null ? task.opt! : false; + taskInfo.completed = false; } taskInfo.task = task; @@ -265,6 +265,8 @@ class _TaskListPageState extends State { } _processTaskArrivedOrFinished(TaskInfo taskInfo) { + Util.logInfo('Task ${taskInfo.task.sId} called'); + showTaskArrivedPopup(context, taskInfo, () { DateFormat dateFormat = DateFormat("dd.MM.yyyy HH:mm"); @@ -283,6 +285,8 @@ class _TaskListPageState extends State { } _processCommissionNumber(TaskInfo taskInfo) { + Util.logInfo('Task ${taskInfo.task.sId} called'); + showComissionNumberPopup(context, taskInfo, (comissionNumber) { var answer = _createAnswerHeader(taskInfo); answer.val = comissionNumber; @@ -300,6 +304,8 @@ class _TaskListPageState extends State { } _processScanBarcodes(TaskInfo taskInfo) { + Util.logInfo('Task ${taskInfo.task.sId} called'); + showScanBarcodesPopup(context, taskInfo, (List barcodes) { var answer = _createAnswerHeader(taskInfo); answer.codes = []; @@ -318,6 +324,8 @@ class _TaskListPageState extends State { } _processTakePhotos(TaskInfo taskInfo) { + Util.logInfo('Task ${taskInfo.task.sId} called'); + showTakePhotosPopup(context, taskInfo, (List? photos) async { if (photos != null) { await MyApp.isarInstance.writeTxn(() async { @@ -345,6 +353,8 @@ class _TaskListPageState extends State { } void _processStationNotice(TaskInfo taskInfo) { + Util.logInfo('Task ${taskInfo.task.sId} called'); + showStationNoticePopup(context, taskInfo, (notice) { var answer = _createAnswerHeader(taskInfo); answer.val = notice; @@ -360,6 +370,8 @@ class _TaskListPageState extends State { } void _processReceiptGiver(TaskInfo taskInfo) { + Util.logInfo('Task ${taskInfo.task.sId} called'); + showReceiptGiverPopup(context, taskInfo, (receiptGiver) { var answer = _createAnswerHeader(taskInfo); answer.val = receiptGiver; @@ -375,10 +387,13 @@ class _TaskListPageState extends State { } void _processPickupDeliveryStatusTask(TaskInfo taskInfo) { + Util.logInfo('Task ${taskInfo.task.sId} called'); + Future.delayed(const Duration(seconds: 1), () async { - showPickupDeliveryStatusPopup(context, taskInfo, (tourEntry) { + showPickupDeliveryStatusPopup(context, taskInfo, (tourEntry, remark) { var answer = _createAnswerHeader(taskInfo); answer.code = tourEntry!.code; + answer.val = remark; taskInfo.answer = jsonEncode(answer.toJson()); taskInfo.additionalText = tourEntry.text; @@ -392,6 +407,8 @@ class _TaskListPageState extends State { } void _processSignature(TaskInfo taskInfo) { + Util.logInfo('Task ${taskInfo.task.sId} called'); + MyApp.suppressAcceptDialog = true; SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft]); @@ -407,6 +424,7 @@ class _TaskListPageState extends State { answer.sign = signature; taskInfo.answer = jsonEncode(answer.toJson()); + taskInfo.additionalText = "Unterschrift erfasst"; taskInfo.completed = true; _sendFinTourMessage(); diff --git a/lib/popups/infos_popup.dart b/lib/popups/infos_popup.dart index eb18fe1..917f346 100644 --- a/lib/popups/infos_popup.dart +++ b/lib/popups/infos_popup.dart @@ -39,9 +39,24 @@ void showInfosPopup(BuildContext context, SessionStatus? status) async { shadowColor: Colors.transparent, backgroundColor: Colors.white, content: StatefulBuilder(builder: (BuildContext context, StateSetter setState) { + String getGpsStatustext() { + String gpsStatus = "nicht verfügbar"; + if (MyApp.currentPosition != null) { + var nowUtc = DateTime.now().toUtc(); + var minutesDelta = nowUtc.difference(MyApp.currentPosition!.timestamp); + + if (minutesDelta >= const Duration(minutes: 15)) { + gpsStatus = "veraltet"; + } else { + gpsStatus = "aktuell"; + } + } + return gpsStatus; + } + var text = "Versionsnummer: a$version\n"; text += "Verbindungsstatus: $connectedString\n"; - text += "GPS-Status: ${MyApp.currentPosition != null ? MyApp.currentPosition!.timestamp.toString() : "Unbekannt"}\n"; + text += "GPS-Status: ${getGpsStatustext()}\n"; text += "\n"; text += "User Status:\n"; if (status != null) { @@ -103,3 +118,5 @@ void showInfosPopup(BuildContext context, SessionStatus? status) async { }))); }); } + + diff --git a/lib/popups/tasks_popups/arrived_popup.dart b/lib/popups/tasks_popups/arrived_popup.dart index 1ca3a39..5508368 100644 --- a/lib/popups/tasks_popups/arrived_popup.dart +++ b/lib/popups/tasks_popups/arrived_popup.dart @@ -5,50 +5,41 @@ import 'package:stadtbote/tools/util.dart'; showTaskArrivedPopup(BuildContext context, TaskInfo taskInfo, Function() onFinished) async { await showDialog( context: context, - builder: (BuildContext context) - { - return AlertDialog( - contentPadding: EdgeInsets.zero, - shadowColor: Colors.transparent, - backgroundColor: Colors.white, - content: StatefulBuilder(builder: (BuildContext context, StateSetter setState) { - return SizedBox( - key: GlobalKey(), - height: MediaQuery - .of(context) - .size - .height * 0.2, - width: MediaQuery - .of(context) - .size - .width * 0.8, - child: Container( - height: 100, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.white, - border: Border.all( - color: Colors.grey, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(35.0), - child: Column( - children: [ - Text(taskInfo.task.topic), - const SizedBox(height: 20), - getDefaultButton(taskInfo.task.topic, () => - { - Navigator.of(context).pop(), - - onFinished() - }), - ], - ), - ), - )); - })); - }); + builder: (BuildContext context) { + return WillPopScope( + onWillPop: () async { + return await taskDialogSecurityException(context); + }, // False will prevent and true will allow to dismiss + child: AlertDialog( + contentPadding: EdgeInsets.zero, + shadowColor: Colors.transparent, + backgroundColor: Colors.white, + content: StatefulBuilder(builder: (BuildContext context, StateSetter setState) { + return SizedBox( + key: GlobalKey(), + height: MediaQuery.of(context).size.height * 0.2, + width: MediaQuery.of(context).size.width * 0.8, + child: Container( + height: 100, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white, + border: Border.all( + color: Colors.grey, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(35.0), + child: Column( + children: [ + Text(taskInfo.task.topic), + const SizedBox(height: 20), + getDefaultButton(taskInfo.task.topic, () => {Navigator.of(context).pop(), onFinished()}), + ], + ), + ), + )); + }))); + }); } - diff --git a/lib/popups/tasks_popups/commision_number_popup.dart b/lib/popups/tasks_popups/commision_number_popup.dart index e39411a..eb7a5cf 100644 --- a/lib/popups/tasks_popups/commision_number_popup.dart +++ b/lib/popups/tasks_popups/commision_number_popup.dart @@ -7,47 +7,48 @@ showComissionNumberPopup(BuildContext context, TaskInfo taskInfo, Function(Strin await showDialog( context: context, builder: (BuildContext context) { - return AlertDialog( - contentPadding: EdgeInsets.zero, - shadowColor: Colors.transparent, - backgroundColor: Colors.white, - content: StatefulBuilder(builder: (BuildContext context, StateSetter setState) { - TextEditingController textEditingController = TextEditingController(); + return WillPopScope( + onWillPop: () async { + return await taskDialogSecurityException(context); + }, + child: AlertDialog( + contentPadding: EdgeInsets.zero, + shadowColor: Colors.transparent, + backgroundColor: Colors.white, + content: StatefulBuilder(builder: (BuildContext context, StateSetter setState) { + TextEditingController textEditingController = TextEditingController(); - return SizedBox( - key: GlobalKey(), - height: 260, - width: MediaQuery.of(context).size.width * 0.8, - child: Container( - height: 100, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.white, - border: Border.all( - color: Colors.grey, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(35.0), - child: Column( - children: [ - const Text('Bitte geben Sie die Kommisionsnummer ein'), - const SizedBox(height: 20), - Util.getDefaultTextField('Kommisionsnummer', - textInputType: TextInputType.text, - formatter: [FilteringTextInputFormatter.singleLineFormatter], - controller: textEditingController, - autofocus: true), - const SizedBox(height: 20), - getDefaultButton('Übernehmen', () => { - Navigator.of(context).pop(), - - onFinished(textEditingController.text)}) - ], - ), - ), - )); - })); + return SizedBox( + key: GlobalKey(), + height: 260, + width: MediaQuery.of(context).size.width * 0.8, + child: Container( + height: 100, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white, + border: Border.all( + color: Colors.grey, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(35.0), + child: Column( + children: [ + const Text('Bitte geben Sie die Kommisionsnummer ein'), + const SizedBox(height: 20), + Util.getDefaultTextField('Kommisionsnummer', + textInputType: TextInputType.text, + formatter: [FilteringTextInputFormatter.singleLineFormatter], + controller: textEditingController, + autofocus: true), + const SizedBox(height: 20), + getDefaultButton('Übernehmen', () => {Navigator.of(context).pop(), onFinished(textEditingController.text)}) + ], + ), + ), + )); + }))); }); } diff --git a/lib/popups/tasks_popups/pickup_delivery_status_popup.dart b/lib/popups/tasks_popups/pickup_delivery_status_popup.dart index 1e05236..9f5d80b 100644 --- a/lib/popups/tasks_popups/pickup_delivery_status_popup.dart +++ b/lib/popups/tasks_popups/pickup_delivery_status_popup.dart @@ -3,7 +3,7 @@ import 'package:stadtbote/model/task_info.dart'; import 'package:stadtbote/model/tour_task.dart'; import 'package:stadtbote/tools/util.dart'; -showPickupDeliveryStatusPopup(BuildContext context, TaskInfo taskInfo, Function(TourEntry?) onFinished) async { +showPickupDeliveryStatusPopup(BuildContext context, TaskInfo taskInfo, Function(TourEntry?, String? remark) onFinished) async { List> entries = []; for (var entry in taskInfo.task.entries!) { var dropdownMenuEntry = DropdownMenuEntry(value: entry, label: entry.text); @@ -16,8 +16,13 @@ showPickupDeliveryStatusPopup(BuildContext context, TaskInfo taskInfo, Function( TourEntry? selectedTourEntry; TextEditingController controller = TextEditingController(); + TextEditingController remController = TextEditingController(); - return AlertDialog( + return WillPopScope( + onWillPop: () async { + return await taskDialogSecurityException(context); + }, + child: AlertDialog( contentPadding: EdgeInsets.zero, shadowColor: Colors.transparent, backgroundColor: Colors.white, @@ -55,18 +60,28 @@ showPickupDeliveryStatusPopup(BuildContext context, TaskInfo taskInfo, Function( dropdownMenuEntries: entries, ), const SizedBox(height: 20), - Visibility(visible: selectedTourEntry != null ? selectedTourEntry!.queryRemark : false, child: Util.getDefaultTextField("Bemerkung")), + Visibility(visible: selectedTourEntry != null ? selectedTourEntry!.queryRemark : false, child: Util.getDefaultTextField(controller: remController, "Bemerkung")), const SizedBox(height: 20), getDefaultButton('Übernehmen', buttonHeight: 50, () => { - Navigator.of(context).pop(), + if (selectedTourEntry!.queryRemark) { + if (remController.text.isNotEmpty) { + Navigator.of(context).pop(), - onFinished(selectedTourEntry) + onFinished(selectedTourEntry, remController.text) + } else { + showAlertDialog(context, "Fehler", "Bitte geben Sie eine Bemerkung ein") + } + } else { + Navigator.of(context).pop(), + + onFinished(selectedTourEntry, null) + } }) ], ), ), )); }, - )); + ))); }); } diff --git a/lib/popups/tasks_popups/receipt_giver_popup.dart b/lib/popups/tasks_popups/receipt_giver_popup.dart index 15d9044..b6b9a2c 100644 --- a/lib/popups/tasks_popups/receipt_giver_popup.dart +++ b/lib/popups/tasks_popups/receipt_giver_popup.dart @@ -7,7 +7,11 @@ showReceiptGiverPopup(BuildContext context, TaskInfo taskInfo, Function(String) await showDialog( context: context, builder: (BuildContext context) { - return AlertDialog( + return WillPopScope( + onWillPop: () async { + return await taskDialogSecurityException(context); + }, + child: AlertDialog( contentPadding: EdgeInsets.zero, shadowColor: Colors.transparent, backgroundColor: Colors.white, @@ -53,6 +57,6 @@ showReceiptGiverPopup(BuildContext context, TaskInfo taskInfo, Function(String) ), ), )); - })); + }))); }); } diff --git a/lib/popups/tasks_popups/scan_barcodes_popup.dart b/lib/popups/tasks_popups/scan_barcodes_popup.dart index d865275..7b58cc6 100644 --- a/lib/popups/tasks_popups/scan_barcodes_popup.dart +++ b/lib/popups/tasks_popups/scan_barcodes_popup.dart @@ -8,7 +8,11 @@ showScanBarcodesPopup(BuildContext context, TaskInfo taskInfo, Function(List points) { + if (points.isNotEmpty) { + String result = ""; - var popupHeight = MediaQuery.of(context).size.height * 0.85; - var popupWidth = MediaQuery.of(context).size.width * 0.85; + for (var point in points) { + if (point.type != PointType.tap) { + result += "${point.offset.dx.toInt()},${point.offset.dy.toInt()};"; + } else { + result += "A"; + } + } - String convertPoints(List points) { - if (points.isNotEmpty) { - String result = ""; - - for (var point in points) { - if (point.type != PointType.tap) { - result += "${point.offset.dx.toInt()},${point.offset.dy.toInt()};"; - } else { - result += "A"; + return result.replaceAll("AA", "A"); } + + return ""; } - return result.replaceAll("AA", "A"); - } - - return ""; - } - - return SizedBox( - key: GlobalKey(), - height: popupHeight, - width: popupWidth, - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.white, - border: Border.all( - color: Colors.grey, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(20.0), - child: Column( - children: [ - Text(taskInfo.task.topic), - const SizedBox(height: 20), - Expanded( - child: Signature( - controller: controller, - width: 500, - height: 200, - backgroundColor: Colors.lightBlueAccent, - ), + return SizedBox( + key: GlobalKey(), + height: popupHeight, + width: popupWidth, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white, + border: Border.all( + color: Colors.grey, + width: 0.5, ), - getDefaultButton('Übernehmen', buttonHeight: 50, () => { - if (controller.points.length > 50) { - Navigator.of(context).pop(), - - onFinished(convertPoints(controller.points)) - } else { - showAlertDialog(context, "Fehler", "Die Unterschrift ist zu kurz.") - } - }) - ], - ), - ), - )); - }, - ))); + ), + child: Padding( + padding: const EdgeInsets.all(20.0), + child: Column( + children: [ + Text(taskInfo.task.topic), + const SizedBox(height: 20), + Expanded( + child: Signature( + controller: controller, + width: 500, + height: 200, + backgroundColor: Colors.lightBlueAccent, + ), + ), + getDefaultButton( + 'Übernehmen', + buttonHeight: 50, + () => { + if (controller.points.length > 50) + {Navigator.of(context).pop(), onFinished(convertPoints(controller.points))} + else + {showAlertDialog(context, "Fehler", "Die Unterschrift ist zu kurz.")} + }) + ], + ), + ), + )); + }, + ))); }); } diff --git a/lib/popups/tasks_popups/station_notice_popup.dart b/lib/popups/tasks_popups/station_notice_popup.dart index 00ff80a..f8916ed 100644 --- a/lib/popups/tasks_popups/station_notice_popup.dart +++ b/lib/popups/tasks_popups/station_notice_popup.dart @@ -7,7 +7,11 @@ showStationNoticePopup(BuildContext context, TaskInfo taskInfo, Function(String) await showDialog( context: context, builder: (BuildContext context) { - return AlertDialog( + return WillPopScope( + onWillPop: () async { + return await taskDialogSecurityException(context); + }, + child: AlertDialog( contentPadding: EdgeInsets.zero, shadowColor: Colors.transparent, backgroundColor: Colors.white, @@ -52,7 +56,7 @@ showStationNoticePopup(BuildContext context, TaskInfo taskInfo, Function(String) ), ), )); - })); + }))); }, ); } diff --git a/lib/popups/tasks_popups/take_photos_popup.dart b/lib/popups/tasks_popups/take_photos_popup.dart index 5b72f80..0ae63ee 100644 --- a/lib/popups/tasks_popups/take_photos_popup.dart +++ b/lib/popups/tasks_popups/take_photos_popup.dart @@ -9,12 +9,18 @@ Future showTakePhotosPopup(BuildContext context, TaskInfo taskInfo, Functi List imageDataList = []; List imageWidgetsList = []; + int currentCarousselSliderIndex = 0; + ValueNotifier> imageWidgetsListNotifier = ValueNotifier>([]); await showDialog( context: context, builder: (BuildContext context) { - return AlertDialog( + return WillPopScope( + onWillPop: () async { + return await taskDialogSecurityException(context); + }, + child: AlertDialog( contentPadding: EdgeInsets.zero, shadowColor: Colors.transparent, backgroundColor: Colors.white, @@ -39,7 +45,24 @@ Future showTakePhotosPopup(BuildContext context, TaskInfo taskInfo, Functi imageWidgetsList.add(GestureDetector( onTap: () {}, - child: Image.memory(resizedImageData), + child: GestureDetector( + onTap: () async { + await showQuestionDialog(context, "Achtung", "Wollen Sie das Bild wirklich löschen?", [ + TextButton(onPressed: () => {Navigator.of(context).pop(), + imageDataList.removeAt(currentCarousselSliderIndex), + imageWidgetsList.removeAt(currentCarousselSliderIndex), + + Util.logInfo("image deleted $currentCarousselSliderIndex"), + + currentCarousselSliderIndex = 0, + + setState(() {}) + }, child: const Text('Ja')), + TextButton(onPressed: () => {Navigator.of(context).pop()}, child: const Text('Nein')), + ]); + }, + child: Image.memory(resizedImageData), + ) )); imageWidgetsListNotifier.value = imageWidgetsList; @@ -86,11 +109,14 @@ Future showTakePhotosPopup(BuildContext context, TaskInfo taskInfo, Functi valueListenable: imageWidgetsListNotifier, builder: (context, value, child) { return CarouselSlider( - options: CarouselOptions( - disableCenter: false, - enableInfiniteScroll: false, - ), - items: imageWidgetsList.toList()); + options: CarouselOptions( + disableCenter: false, + enableInfiniteScroll: false, + onPageChanged: (index, reason) { + currentCarousselSliderIndex = index; + }, + ), + items: imageWidgetsList.toList()); }, ), ), @@ -112,6 +138,6 @@ Future showTakePhotosPopup(BuildContext context, TaskInfo taskInfo, Functi ), ), )); - })); + }))); }); } diff --git a/lib/popups/tasks_popups/zip_popup.dart b/lib/popups/tasks_popups/zip_popup.dart index 936acd7..aea1be3 100644 --- a/lib/popups/tasks_popups/zip_popup.dart +++ b/lib/popups/tasks_popups/zip_popup.dart @@ -5,7 +5,11 @@ showZipPopup(BuildContext context, String text, String buttonText, Function(Stri await showDialog( context: context, builder: (BuildContext context) { - return AlertDialog( + return WillPopScope( + onWillPop: () async { + return await taskDialogSecurityException(context); + }, + child: AlertDialog( contentPadding: EdgeInsets.zero, shadowColor: Colors.transparent, backgroundColor: Colors.white, @@ -48,7 +52,7 @@ showZipPopup(BuildContext context, String text, String buttonText, Function(Stri ), ), )); - })); + }))); }); } diff --git a/lib/tools/mqtt_core.dart b/lib/tools/mqtt_core.dart index 4683fcf..3a39def 100644 --- a/lib/tools/mqtt_core.dart +++ b/lib/tools/mqtt_core.dart @@ -165,14 +165,16 @@ class MqttCore { try { final MqttPublishMessage message = mqttMessage.payload as MqttPublishMessage; - var messageBytes = message.payload.message; - String payload = utf8.decode(GZipDecoder().decodeBytes(messageBytes)); - var topicArray = message.variableHeader?.topicName; var topicArraySplited = topicArray!.split("/"); var topic = topicArraySplited[6]; - Util.logInfo('message received\ntopic: $topic\nmessage: $payload'); + Util.logInfo('message received\ntopic: $topic\n'); + + var messageBytes = message.payload.message; + String payload = utf8.decode(GZipDecoder().decodeBytes(messageBytes)); + + Util.logInfo('$topic\nmessage: $payload'); switch (topic) { case 'session': @@ -347,8 +349,6 @@ class MqttCore { await Util.playMp3('asbeep.mp3'); - - MessageService().publish(Constants.messageTopicMessageReceived, arguments: MessageReceivedMessage(message: newMessage)); } diff --git a/lib/tools/util.dart b/lib/tools/util.dart index bbc8881..f8f3e20 100644 --- a/lib/tools/util.dart +++ b/lib/tools/util.dart @@ -360,6 +360,19 @@ String mapTourMode(String mode) { return text; } +Future showQuestionDialog(BuildContext context, String title, String message, List actions) async { + await showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: Text(title), + content: Text(message), + actions: actions, + ); + } + ); +} + Future 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; -} \ No newline at end of file +} + +Future 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; +} diff --git a/pubspec.yaml b/pubspec.yaml index e6b171b..dad1634 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: 309.0.0+309 +version: 312.0.0+312 environment: sdk: '>=2.19.6 <3.0.0'