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

+20 -2
View File
@@ -218,7 +218,7 @@ class _TaskListPageState extends State<TaskListPage> {
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<TaskListPage> {
}
_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<TaskListPage> {
}
_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<TaskListPage> {
}
_processScanBarcodes(TaskInfo taskInfo) {
Util.logInfo('Task ${taskInfo.task.sId} called');
showScanBarcodesPopup(context, taskInfo, (List<String> barcodes) {
var answer = _createAnswerHeader(taskInfo);
answer.codes = [];
@@ -318,6 +324,8 @@ class _TaskListPageState extends State<TaskListPage> {
}
_processTakePhotos(TaskInfo taskInfo) {
Util.logInfo('Task ${taskInfo.task.sId} called');
showTakePhotosPopup(context, taskInfo, (List<Uint8List>? photos) async {
if (photos != null) {
await MyApp.isarInstance.writeTxn(() async {
@@ -345,6 +353,8 @@ class _TaskListPageState extends State<TaskListPage> {
}
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<TaskListPage> {
}
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<TaskListPage> {
}
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<TaskListPage> {
}
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<TaskListPage> {
answer.sign = signature;
taskInfo.answer = jsonEncode(answer.toJson());
taskInfo.additionalText = "Unterschrift erfasst";
taskInfo.completed = true;
_sendFinTourMessage();