Erweiterungen
This commit is contained in:
1 parent
cb4525a774
commit
5c3cee2d92
10 files changed
+466
-54
No files matched your search
@@ -1,8 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:isar/isar.dart';
|
||||
import 'package:kumi_popup_window/kumi_popup_window.dart';
|
||||
import 'package:stadtbote/content_views/utils/content_view_widget.dart';
|
||||
import 'package:stadtbote/content_views/utils/header_info.dart';
|
||||
import 'package:stadtbote/model/job_tour.dart';
|
||||
import 'package:stadtbote/popups/tasks_popups/arrived_popup.dart';
|
||||
import 'package:stadtbote/popups/tasks_popups/commision_number_popup.dart';
|
||||
import 'package:stadtbote/popups/tasks_popups/scan_barcodes_popup.dart';
|
||||
|
||||
import '../main.dart';
|
||||
import '../model/task_info.dart';
|
||||
@@ -40,6 +44,8 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
|
||||
late List<TaskInfo> _taskList;
|
||||
|
||||
late KumiPopupWindow _popup;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
Future.delayed(const Duration(seconds: 0), () async {
|
||||
@@ -118,6 +124,7 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
const SizedBox(width: 20),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
taskInfo.task.topic,
|
||||
@@ -127,8 +134,9 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
fontSize: 15.0,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
taskInfo.additionalText ?? '',
|
||||
taskInfo.additionalText ?? 'Additonal text',
|
||||
textAlign: TextAlign.left,
|
||||
style: const TextStyle(
|
||||
color: Colors.blue,
|
||||
@@ -141,7 +149,7 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
print('1');
|
||||
_processTask(taskInfo);
|
||||
},
|
||||
),
|
||||
);
|
||||
@@ -166,4 +174,38 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
|
||||
return taskList;
|
||||
}
|
||||
|
||||
void _processTask(TaskInfo taskInfo) {
|
||||
switch(taskInfo.task.type) {
|
||||
case 3:
|
||||
_processTaskArrived(taskInfo);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
_processScanBarcodes(taskInfo);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
_processCommissionNumber(taskInfo);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void _processTaskArrived(TaskInfo taskInfo) {
|
||||
_popup = showTaskArrivedPopup(context, taskInfo, () => {
|
||||
_popup.dismiss(context),
|
||||
});
|
||||
}
|
||||
|
||||
void _processCommissionNumber(TaskInfo taskInfo) {
|
||||
_popup = showCommisionNumberPopup(context, taskInfo, () => {
|
||||
_popup.dismiss(context),
|
||||
});
|
||||
}
|
||||
|
||||
void _processScanBarcodes(TaskInfo taskInfo) {
|
||||
_popup = showScanBarcodesPopup(context, taskInfo, () => {
|
||||
_popup.dismiss(context)
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user