Erweiterungen
This commit is contained in:
1 parent
c604dc9d55
commit
31fe4c5a06
20 files changed
+1802
-652
No files matched your search
@@ -1,9 +1,10 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:isar/isar.dart';
|
||||
import 'package:kumi_popup_window/kumi_popup_window.dart';
|
||||
import 'package:stadtbote/content_views/tour_list_page.dart';
|
||||
import 'package:stadtbote/content_views/utils/content_view_widget.dart';
|
||||
import 'package:stadtbote/content_views/utils/header_info.dart';
|
||||
import 'package:stadtbote/messages/PopContentViewMessage.dart';
|
||||
@@ -64,8 +65,6 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
|
||||
late List<TaskInfo> _taskList;
|
||||
|
||||
late KumiPopupWindow _popup;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
Future.delayed(const Duration(seconds: 0), () async {
|
||||
@@ -244,9 +243,12 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
}
|
||||
|
||||
_processTaskArrivedOrFinished(TaskInfo taskInfo) {
|
||||
_popup = showTaskArrivedPopup(context, taskInfo, () {
|
||||
showTaskArrivedPopup(context, taskInfo, () {
|
||||
DateFormat dateFormat = DateFormat("dd.MM.yyyy HH:mm");
|
||||
|
||||
var answer = _createAnswerHeader(taskInfo);
|
||||
|
||||
taskInfo.answer = jsonEncode(answer.toJson());
|
||||
taskInfo.additionalText = dateFormat.format(DateTime.now());
|
||||
taskInfo.completed = true;
|
||||
|
||||
@@ -255,34 +257,38 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
setState(() {});
|
||||
|
||||
_finishTaskProcessing(taskInfo);
|
||||
|
||||
_popup.dismiss(context);
|
||||
});
|
||||
}
|
||||
|
||||
_processCommissionNumber(TaskInfo taskInfo) {
|
||||
_popup = showComissionNumberPopup(context, taskInfo, (comissionNumber) {
|
||||
showComissionNumberPopup(context, taskInfo, (comissionNumber) {
|
||||
var answer = _createAnswerHeader(taskInfo);
|
||||
answer.val = comissionNumber;
|
||||
|
||||
taskInfo.answer = jsonEncode(answer.toJson());
|
||||
taskInfo.additionalText = comissionNumber;
|
||||
taskInfo.completed = true;
|
||||
|
||||
setState(() {});
|
||||
|
||||
_finishTaskProcessing(taskInfo);
|
||||
|
||||
_popup.dismiss(context);
|
||||
});
|
||||
}
|
||||
|
||||
_processScanBarcodes(TaskInfo taskInfo) {
|
||||
_popup = showScanBarcodesPopup(context, taskInfo, (List<String> barcodes) {
|
||||
showScanBarcodesPopup(context, taskInfo, (List<String> barcodes) {
|
||||
var answer = _createAnswerHeader(taskInfo);
|
||||
answer.codes = [];
|
||||
for(var barcode in barcodes) {
|
||||
answer.codes!.add(barcode);
|
||||
}
|
||||
|
||||
taskInfo.additionalText = "Barcodes gescannt";
|
||||
taskInfo.completed = true;
|
||||
|
||||
setState(() {});
|
||||
|
||||
_finishTaskProcessing(taskInfo);
|
||||
|
||||
_popup.dismiss(context);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -298,10 +304,11 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
}
|
||||
|
||||
void _processStationNotice(TaskInfo taskInfo) {
|
||||
_popup = showStationNoticePopup(context, taskInfo, (notice) {
|
||||
_popup.dismiss(context);
|
||||
showStationNoticePopup(context, taskInfo, (notice) {
|
||||
var answer = _createAnswerHeader(taskInfo);
|
||||
answer.val = notice;
|
||||
|
||||
taskInfo.additionalText = notice;
|
||||
taskInfo.answer = jsonEncode(answer.toJson());
|
||||
taskInfo.completed = true;
|
||||
|
||||
_finishTaskProcessing(taskInfo);
|
||||
@@ -311,22 +318,28 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
}
|
||||
|
||||
void _processReceiptGiver(TaskInfo taskInfo) {
|
||||
_popup = showReceiptGiverPopup(context, taskInfo, (receiptGiver) {
|
||||
showReceiptGiverPopup(context, taskInfo, (receiptGiver) {
|
||||
var answer = _createAnswerHeader(taskInfo);
|
||||
answer.val = receiptGiver;
|
||||
|
||||
taskInfo.answer = jsonEncode(answer.toJson());
|
||||
taskInfo.additionalText = receiptGiver;
|
||||
taskInfo.completed = true;
|
||||
|
||||
setState(() {});
|
||||
|
||||
_finishTaskProcessing(taskInfo);
|
||||
|
||||
_popup.dismiss(context);
|
||||
});
|
||||
}
|
||||
|
||||
void _processPickupDeliveryStatusTask(TaskInfo taskInfo) {
|
||||
Future.delayed(const Duration(seconds: 1), () async {
|
||||
showPickupDeliveryStatusPopup(context, taskInfo, (tourEntry) {
|
||||
taskInfo.additionalText = tourEntry!.text;
|
||||
var answer = _createAnswerHeader(taskInfo);
|
||||
answer.code = tourEntry!.code;
|
||||
|
||||
taskInfo.answer = jsonEncode(answer.toJson());
|
||||
taskInfo.additionalText = tourEntry.text;
|
||||
taskInfo.completed = true;
|
||||
|
||||
_finishTaskProcessing(taskInfo);
|
||||
@@ -341,6 +354,10 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
|
||||
Future.delayed(const Duration(seconds: 1), () async {
|
||||
showSignaturePopup(context, taskInfo, () {
|
||||
var answer = _createAnswerHeader(taskInfo);
|
||||
answer.sign = 'A110';
|
||||
|
||||
taskInfo.answer = jsonEncode(answer.toJson());
|
||||
taskInfo.completed = true;
|
||||
|
||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||
@@ -395,6 +412,22 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
MqttCore.instance.publishPayloadMessage("job", finTaskMessage.toJson());
|
||||
}
|
||||
|
||||
FinTourTask _createAnswerHeader(TaskInfo taskInfo) {
|
||||
var position = MyApp.currentPosition;
|
||||
|
||||
var finTourTask = FinTourTask();
|
||||
finTourTask.sId = taskInfo.task.sId;
|
||||
finTourTask.time = DateTime.now().toIso8601String();
|
||||
finTourTask.pos = FinTaskPos();
|
||||
if (position != null) {
|
||||
finTourTask.pos.lat = position.latitude;
|
||||
finTourTask.pos.long = position.longitude;
|
||||
finTourTask.pos.acc = position.accuracy.toInt();
|
||||
}
|
||||
|
||||
return finTourTask;
|
||||
}
|
||||
|
||||
_sendFinTourMessage() async {
|
||||
var finTourMessage = FinTourMessage();
|
||||
finTourMessage.finTour = FinTour();
|
||||
@@ -412,20 +445,17 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
|
||||
finTourMessage.finTour.tasks = [];
|
||||
for(var taskInfo in _taskList) {
|
||||
var finTourTask = FinTourTask();
|
||||
finTourTask.sId = taskInfo.task.sId;
|
||||
finTourTask.time = DateTime.now().toIso8601String();
|
||||
finTourTask.pos = FinTaskPos();
|
||||
finTourTask.pos.lat = 0;
|
||||
finTourTask.pos.long = 0;
|
||||
if (taskInfo.answer != null) {
|
||||
var finTourTask = FinTourTask.fromJson(jsonDecode(taskInfo.answer!));
|
||||
|
||||
finTourMessage.finTour.tasks.add(finTourTask);
|
||||
finTourMessage.finTour.tasks.add(finTourTask);
|
||||
}
|
||||
}
|
||||
|
||||
MqttCore.instance.publishPayloadMessage("job", finTourMessage.toJson());
|
||||
MqttCore.instance.publishPayloadMessage("fin_tour", finTourMessage.toJson());
|
||||
|
||||
widget.tour.state = 9;
|
||||
await MyApp.isarInstance.writeTxn(() async {
|
||||
widget.tour.state = Constants.stateFinishedNotConfirmed;
|
||||
await MyApp.isarInstance.writeTxn(() async {
|
||||
await MyApp.isarInstance.jobs.put(widget.job);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:isar/isar.dart';
|
||||
import 'package:stadtbote/model/tour_task.dart';
|
||||
import 'package:stadtbote/protocoll_messages/fin_tour_message.dart';
|
||||
|
||||
import '../tools/util.dart';
|
||||
|
||||
|
||||
+38
-57
@@ -1,11 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:kumi_popup_window/kumi_popup_window.dart';
|
||||
import 'package:stadtbote/main.dart';
|
||||
import 'package:stadtbote/model/session_status.dart';
|
||||
import 'package:stadtbote/tools/mqtt_core.dart';
|
||||
import 'package:stadtbote/tools/util.dart';
|
||||
|
||||
void showInfosPopup(BuildContext context, SessionStatus? status) {
|
||||
void showInfosPopup(BuildContext context, SessionStatus? status) async {
|
||||
var text = "Versionsnummer: a203\n";
|
||||
text += "Verbindungsstatus: ${MqttCore.instance.connectionState == ConnectionStateEnum.connected ? "Verbunden" : "NICHT verbunden"}\n";
|
||||
text += "GPS-Status: ${MyApp.currentPosition != null ? MyApp.currentPosition!.timestamp.toString() : "Unbekannt"}\n";
|
||||
@@ -22,59 +21,41 @@ void showInfosPopup(BuildContext context, SessionStatus? status) {
|
||||
text += "Keine Informationen gefunden";
|
||||
}
|
||||
|
||||
showPopupWindow(
|
||||
context,
|
||||
//childSize:Size(240, MediaQuery.of(context).size.width * 0.8),
|
||||
gravity: KumiPopupGravity.center,
|
||||
//curve: Curves.elasticOut,
|
||||
bgColor: Colors.grey.withOpacity(0.5),
|
||||
clickOutDismiss: true,
|
||||
clickBackDismiss: true,
|
||||
customAnimation: false,
|
||||
customPop: false,
|
||||
customPage: false,
|
||||
// targetRenderBox: (btnKey.currentContext.findRenderObject() as RenderBox),
|
||||
//needSafeDisplay: true,
|
||||
underStatusBar: false,
|
||||
underAppBar: false,
|
||||
//offsetX: -180,
|
||||
//offsetY: 50,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
onShowStart: (pop) {},
|
||||
onShowFinish: (pop) {},
|
||||
onDismissStart: (pop) {},
|
||||
onDismissFinish: (pop) {},
|
||||
onClickOut: (pop) {},
|
||||
onClickBack: (pop) {},
|
||||
childFun: (pop) {
|
||||
return SizedBox(
|
||||
key: GlobalKey(),
|
||||
height: 350,
|
||||
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: 1,
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(child: Text(text, textAlign: TextAlign.left)),
|
||||
getDefaultButton(
|
||||
'OK',
|
||||
() => {Navigator.pop(context)},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
},
|
||||
);
|
||||
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: 350,
|
||||
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: 1,
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(child: Text(text, textAlign: TextAlign.left)),
|
||||
getDefaultButton(
|
||||
'OK',
|
||||
() => {Navigator.pop(context)},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
}));
|
||||
});
|
||||
}
|
||||
+163
-190
@@ -3,209 +3,182 @@ import 'dart:async';
|
||||
import 'package:animated_toggle_switch/animated_toggle_switch.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map/flutter_map.dart';
|
||||
import 'package:kumi_popup_window/kumi_popup_window.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
|
||||
import '../model/job_tour.dart';
|
||||
|
||||
void showMapPopup(BuildContext context, JobTour currentTour, List<JobTour> tourList) {
|
||||
showPopupWindow(
|
||||
context,
|
||||
//childSize:Size(240, 800),
|
||||
gravity: KumiPopupGravity.center,
|
||||
//curve: Curves.elasticOut,
|
||||
bgColor: Colors.grey.withOpacity(0.5),
|
||||
clickOutDismiss: true,
|
||||
clickBackDismiss: true,
|
||||
customAnimation: false,
|
||||
customPop: false,
|
||||
customPage: false,
|
||||
// targetRenderBox: (btnKey.currentContext.findRenderObject() as RenderBox),
|
||||
//needSafeDisplay: true,
|
||||
underStatusBar: false,
|
||||
underAppBar: false,
|
||||
//offsetX: -180,
|
||||
//offsetY: 50,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
onShowStart: (pop) {},
|
||||
onShowFinish: (pop) {},
|
||||
onDismissStart: (pop) {},
|
||||
onDismissFinish: (pop) {},
|
||||
onClickOut: (pop) {},
|
||||
onClickBack: (pop) {},
|
||||
childFun: (pop) {
|
||||
var mapController = MapController();
|
||||
Map<int, StreamController<bool>> streamController = {};
|
||||
showMapPopup(BuildContext context, JobTour currentTour, List<JobTour> tourList) 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) {
|
||||
var mapController = MapController();
|
||||
Map<int, StreamController<bool>> streamController = {};
|
||||
|
||||
List<Widget> tourWidgets = [];
|
||||
for(JobTour tour in tourList) {
|
||||
var currentStreamController = StreamController<bool>();
|
||||
streamController[tour.sort] = currentStreamController;
|
||||
List<Widget> tourWidgets = [];
|
||||
for (JobTour tour in tourList) {
|
||||
var currentStreamController = StreamController<bool>();
|
||||
streamController[tour.sort] = currentStreamController;
|
||||
|
||||
tourWidgets.add(
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
mapController.move(LatLng(tour.pos!.lat, tour.pos!.long), mapController.zoom);
|
||||
tourWidgets.add(
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
mapController.move(LatLng(tour.pos!.lat, tour.pos!.long), mapController.zoom);
|
||||
|
||||
streamController[currentTour.sort]!.sink.add(false);
|
||||
streamController[currentTour.sort]!.sink.add(false);
|
||||
|
||||
currentTour = tour;
|
||||
streamController[tour.sort]!.sink.add(true);
|
||||
},
|
||||
child: SizedBox(
|
||||
width: 70,
|
||||
height: 80,
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 50,
|
||||
width: 70,
|
||||
color: Colors.transparent,
|
||||
child: const Icon(
|
||||
Icons.person_pin_circle,
|
||||
color: Colors.blue,
|
||||
size: 56,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
SizedBox(
|
||||
height: 12.0,
|
||||
width: 70,
|
||||
child: Text(
|
||||
"Station ${tour.sort}",
|
||||
softWrap: true,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 10.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
StreamBuilder<bool>(
|
||||
stream: currentStreamController.stream,
|
||||
builder: (context, snapshot) {
|
||||
bool tourSelected = tour.sort == currentTour.sort;
|
||||
if (snapshot.hasData) {
|
||||
tourSelected = snapshot.data as bool;
|
||||
}
|
||||
|
||||
return Container(
|
||||
height: 2,
|
||||
color: tourSelected ? Colors.green : Colors.transparent,
|
||||
);
|
||||
}
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
final ValueNotifier<bool> valueNotifier = ValueNotifier<bool>(true);
|
||||
|
||||
List<Marker> markers = [];
|
||||
for (var tour in tourList) {
|
||||
markers.add(
|
||||
Marker(
|
||||
builder: (context) => const Icon(Icons.person_pin_circle, size: 56, color: Colors.blue),
|
||||
point: LatLng(tour.pos!.lat, tour.pos!.long)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return Container(
|
||||
padding: const EdgeInsets.fromLTRB(30, 0, 30, 0),
|
||||
key: GlobalKey(),
|
||||
height: MediaQuery.of(context).size.height * 0.6,
|
||||
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(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 80,
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: tourWidgets,
|
||||
),
|
||||
)
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: ValueListenableBuilder<bool>(
|
||||
valueListenable: valueNotifier,
|
||||
builder: (context, value, child) {
|
||||
return AnimatedToggleSwitch<bool>.dual(
|
||||
current: value,
|
||||
first: true,
|
||||
second: false,
|
||||
dif: 0.0,
|
||||
borderColor: Colors.transparent,
|
||||
borderWidth: 5.0,
|
||||
height: 25,
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Colors.black26,
|
||||
spreadRadius: 1,
|
||||
blurRadius: 2,
|
||||
offset: Offset(0, 1.5),
|
||||
),
|
||||
],
|
||||
onChanged: (b) {
|
||||
valueNotifier.value = b;
|
||||
mapController.move(mapController.center, b ? 14.0 : 16.0);
|
||||
},
|
||||
colorBuilder: (b) => b ? Colors.red : Colors.green,
|
||||
textBuilder: (value) => value
|
||||
? const Center(child: Text('Fern'))
|
||||
: const Center(child: Text('Nah')),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Expanded(
|
||||
child:
|
||||
AbsorbPointer(
|
||||
absorbing: true,
|
||||
child: FlutterMap(
|
||||
mapController: mapController,
|
||||
options: MapOptions(
|
||||
center: LatLng(currentTour.pos!.lat, currentTour.pos!.long),
|
||||
zoom: 14,
|
||||
),
|
||||
currentTour = tour;
|
||||
streamController[tour.sort]!.sink.add(true);
|
||||
},
|
||||
child: SizedBox(
|
||||
width: 70,
|
||||
height: 80,
|
||||
child: Column(
|
||||
children: [
|
||||
TileLayer(
|
||||
urlTemplate: 'https://google-maps.assecutor.de/vt/lyrs=m@130&hl=en&x={x}&y={y}&z={z}',
|
||||
userAgentPackageName: 'com.example.app',
|
||||
Container(
|
||||
height: 50,
|
||||
width: 70,
|
||||
color: Colors.transparent,
|
||||
child: const Icon(
|
||||
Icons.person_pin_circle,
|
||||
color: Colors.blue,
|
||||
size: 56,
|
||||
),
|
||||
),
|
||||
MarkerLayer(
|
||||
markers: markers,
|
||||
const SizedBox(height: 2),
|
||||
SizedBox(
|
||||
height: 12.0,
|
||||
width: 70,
|
||||
child: Text(
|
||||
"Station ${tour.sort}",
|
||||
softWrap: true,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 10.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
StreamBuilder<bool>(
|
||||
stream: currentStreamController.stream,
|
||||
builder: (context, snapshot) {
|
||||
bool tourSelected = tour.sort == currentTour.sort;
|
||||
if (snapshot.hasData) {
|
||||
tourSelected = snapshot.data as bool;
|
||||
}
|
||||
|
||||
return Container(
|
||||
height: 2,
|
||||
color: tourSelected ? Colors.green : Colors.transparent,
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
},
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
final ValueNotifier<bool> valueNotifier = ValueNotifier<bool>(true);
|
||||
|
||||
List<Marker> markers = [];
|
||||
for (var tour in tourList) {
|
||||
markers.add(Marker(
|
||||
builder: (context) => const Icon(Icons.person_pin_circle, size: 56, color: Colors.blue),
|
||||
point: LatLng(tour.pos!.lat, tour.pos!.long)));
|
||||
}
|
||||
|
||||
return Container(
|
||||
padding: const EdgeInsets.fromLTRB(30, 0, 30, 0),
|
||||
key: GlobalKey(),
|
||||
height: MediaQuery.of(context).size.height * 0.6,
|
||||
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(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 80,
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: tourWidgets,
|
||||
),
|
||||
)),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: ValueListenableBuilder<bool>(
|
||||
valueListenable: valueNotifier,
|
||||
builder: (context, value, child) {
|
||||
return AnimatedToggleSwitch<bool>.dual(
|
||||
current: value,
|
||||
first: true,
|
||||
second: false,
|
||||
dif: 0.0,
|
||||
borderColor: Colors.transparent,
|
||||
borderWidth: 5.0,
|
||||
height: 25,
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Colors.black26,
|
||||
spreadRadius: 1,
|
||||
blurRadius: 2,
|
||||
offset: Offset(0, 1.5),
|
||||
),
|
||||
],
|
||||
onChanged: (b) {
|
||||
valueNotifier.value = b;
|
||||
mapController.move(mapController.center, b ? 14.0 : 16.0);
|
||||
},
|
||||
colorBuilder: (b) => b ? Colors.red : Colors.green,
|
||||
textBuilder: (value) => value ? const Center(child: Text('Fern')) : const Center(child: Text('Nah')),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Expanded(
|
||||
child: AbsorbPointer(
|
||||
absorbing: true,
|
||||
child: FlutterMap(
|
||||
mapController: mapController,
|
||||
options: MapOptions(
|
||||
center: LatLng(currentTour.pos!.lat, currentTour.pos!.long),
|
||||
zoom: 14,
|
||||
),
|
||||
children: [
|
||||
TileLayer(
|
||||
urlTemplate: 'https://google-maps.assecutor.de/vt/lyrs=m@130&hl=en&x={x}&y={y}&z={z}',
|
||||
userAgentPackageName: 'com.example.app',
|
||||
),
|
||||
MarkerLayer(
|
||||
markers: markers,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
}));
|
||||
});
|
||||
}
|
||||
@@ -1,62 +1,54 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:kumi_popup_window/kumi_popup_window.dart';
|
||||
import 'package:stadtbote/model/task_info.dart';
|
||||
import 'package:stadtbote/tools/util.dart';
|
||||
|
||||
KumiPopupWindow showTaskArrivedPopup(BuildContext context, TaskInfo taskInfo, Function() onFinished) {
|
||||
return showPopupWindow(
|
||||
context,
|
||||
//childSize:Size(240, MediaQuery.of(context).size.width * 0.8),
|
||||
gravity: KumiPopupGravity.center,
|
||||
//curve: Curves.elasticOut,
|
||||
bgColor: Colors.grey.withOpacity(0.5),
|
||||
clickOutDismiss: true,
|
||||
clickBackDismiss: true,
|
||||
customAnimation: false,
|
||||
customPop: false,
|
||||
customPage: false,
|
||||
// targetRenderBox: (btnKey.currentContext.findRenderObject() as RenderBox),
|
||||
//needSafeDisplay: true,
|
||||
underStatusBar: false,
|
||||
underAppBar: false,
|
||||
//offsetX: -180,
|
||||
//offsetY: 50,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
onShowStart: (pop) {},
|
||||
onShowFinish: (pop) {},
|
||||
onDismissStart: (pop) {},
|
||||
onDismissFinish: (pop) {},
|
||||
onClickOut: (pop) {},
|
||||
onClickBack: (pop) {},
|
||||
childFun: (pop) {
|
||||
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, () => {
|
||||
onFinished()
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
},
|
||||
);
|
||||
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()
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,68 +1,53 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:kumi_popup_window/kumi_popup_window.dart';
|
||||
import 'package:stadtbote/model/task_info.dart';
|
||||
import 'package:stadtbote/tools/util.dart';
|
||||
|
||||
KumiPopupWindow showComissionNumberPopup(BuildContext context, TaskInfo taskInfo, Function(String) onFinished) {
|
||||
return showPopupWindow(
|
||||
context,
|
||||
//childSize:Size(240, MediaQuery.of(context).size.width * 0.8),
|
||||
gravity: KumiPopupGravity.center,
|
||||
//curve: Curves.elasticOut,
|
||||
bgColor: Colors.grey.withOpacity(0.5),
|
||||
clickOutDismiss: true,
|
||||
clickBackDismiss: true,
|
||||
customAnimation: false,
|
||||
customPop: false,
|
||||
customPage: false,
|
||||
// targetRenderBox: (btnKey.currentContext.findRenderObject() as RenderBox),
|
||||
//needSafeDisplay: true,
|
||||
underStatusBar: false,
|
||||
underAppBar: false,
|
||||
//offsetX: -180,
|
||||
//offsetY: 50,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
onShowStart: (pop) {},
|
||||
onShowFinish: (pop) {},
|
||||
onDismissStart: (pop) {},
|
||||
onDismissFinish: (pop) {},
|
||||
onClickOut: (pop) {},
|
||||
onClickBack: (pop) {},
|
||||
childFun: (pop) {
|
||||
TextEditingController textEditingController = TextEditingController();
|
||||
showComissionNumberPopup(BuildContext context, TaskInfo taskInfo, Function(String) 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) {
|
||||
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',
|
||||
type: TextInputType.text, formatter: [FilteringTextInputFormatter.singleLineFormatter], controller: textEditingController, autofocus: true),
|
||||
const SizedBox(height: 20),
|
||||
getDefaultButton('Übernehmen', () => {
|
||||
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',
|
||||
type: TextInputType.text,
|
||||
formatter: [FilteringTextInputFormatter.singleLineFormatter],
|
||||
controller: textEditingController,
|
||||
autofocus: true),
|
||||
const SizedBox(height: 20),
|
||||
getDefaultButton('Übernehmen', () => {
|
||||
Navigator.of(context).pop(),
|
||||
|
||||
onFinished(textEditingController.text)})
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
// ignore: unused_import
|
||||
import 'package:kumi_popup_window/kumi_popup_window.dart';
|
||||
import 'package:stadtbote/model/task_info.dart';
|
||||
import 'package:stadtbote/model/tour_task.dart';
|
||||
import 'package:stadtbote/tools/util.dart';
|
||||
@@ -12,7 +10,7 @@ showPickupDeliveryStatusPopup(BuildContext context, TaskInfo taskInfo, Function(
|
||||
entries.add(dropdownMenuEntry);
|
||||
}
|
||||
|
||||
await showDialog<void>(
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
TourEntry? selectedTourEntry;
|
||||
|
||||
@@ -1,68 +1,53 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:kumi_popup_window/kumi_popup_window.dart';
|
||||
import 'package:stadtbote/model/task_info.dart';
|
||||
import 'package:stadtbote/tools/util.dart';
|
||||
|
||||
KumiPopupWindow showReceiptGiverPopup(BuildContext context, TaskInfo taskInfo, Function(String) onFinished) {
|
||||
return showPopupWindow(
|
||||
context,
|
||||
//childSize:Size(240, MediaQuery.of(context).size.width * 0.8),
|
||||
gravity: KumiPopupGravity.center,
|
||||
//curve: Curves.elasticOut,
|
||||
bgColor: Colors.grey.withOpacity(0.5),
|
||||
clickOutDismiss: true,
|
||||
clickBackDismiss: true,
|
||||
customAnimation: false,
|
||||
customPop: false,
|
||||
customPage: false,
|
||||
// targetRenderBox: (btnKey.currentContext.findRenderObject() as RenderBox),
|
||||
//needSafeDisplay: true,
|
||||
underStatusBar: false,
|
||||
underAppBar: false,
|
||||
//offsetX: -180,
|
||||
//offsetY: 50,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
onShowStart: (pop) {},
|
||||
onShowFinish: (pop) {},
|
||||
onDismissStart: (pop) {},
|
||||
onDismissFinish: (pop) {},
|
||||
onClickOut: (pop) {},
|
||||
onClickBack: (pop) {},
|
||||
childFun: (pop) {
|
||||
TextEditingController textEditingController = TextEditingController();
|
||||
showReceiptGiverPopup(BuildContext context, TaskInfo taskInfo, Function(String) 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) {
|
||||
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: [
|
||||
Text(taskInfo.task.topic),
|
||||
const SizedBox(height: 20),
|
||||
Util.getDefaultTextField(taskInfo.task.topic,
|
||||
type: TextInputType.text, formatter: [FilteringTextInputFormatter.singleLineFormatter], controller: textEditingController, autofocus: true),
|
||||
const SizedBox(height: 20),
|
||||
getDefaultButton('Übernehmen', () => {
|
||||
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: [
|
||||
Text(taskInfo.task.topic),
|
||||
const SizedBox(height: 20),
|
||||
Util.getDefaultTextField(taskInfo.task.topic,
|
||||
type: TextInputType.text,
|
||||
formatter: [FilteringTextInputFormatter.singleLineFormatter],
|
||||
controller: textEditingController,
|
||||
autofocus: true),
|
||||
const SizedBox(height: 20),
|
||||
getDefaultButton('Übernehmen', () => {
|
||||
Navigator.of(context).pop(),
|
||||
|
||||
onFinished(textEditingController.text)})
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,89 +1,56 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_barcode_scanner/flutter_barcode_scanner.dart';
|
||||
import 'package:kumi_popup_window/kumi_popup_window.dart';
|
||||
import 'package:stadtbote/model/task_info.dart';
|
||||
import 'package:stadtbote/tools/util.dart';
|
||||
|
||||
KumiPopupWindow showScanBarcodesPopup(BuildContext context, TaskInfo taskInfo, Function(List<String> barcodes) onFinished) {
|
||||
return showPopupWindow(
|
||||
context,
|
||||
//childSize:Size(240, MediaQuery.of(context).size.width * 0.8),
|
||||
gravity: KumiPopupGravity.center,
|
||||
//curve: Curves.elasticOut,
|
||||
bgColor: Colors.grey.withOpacity(0.5),
|
||||
clickOutDismiss: true,
|
||||
clickBackDismiss: true,
|
||||
customAnimation: false,
|
||||
customPop: false,
|
||||
customPage: false,
|
||||
// targetRenderBox: (btnKey.currentContext.findRenderObject() as RenderBox),
|
||||
//needSafeDisplay: true,
|
||||
underStatusBar: false,
|
||||
underAppBar: false,
|
||||
//offsetX: -180,
|
||||
//offsetY: 50,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
onShowStart: (pop) {},
|
||||
onShowFinish: (pop) {},
|
||||
onDismissStart: (pop) {},
|
||||
onDismissFinish: (pop) {},
|
||||
onClickOut: (pop) {},
|
||||
onClickBack: (pop) {},
|
||||
childFun: (pop) {
|
||||
List<String> scannedBarcodes = [];
|
||||
showScanBarcodesPopup(BuildContext context, TaskInfo taskInfo, Function(List<String> barcodes) 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) {
|
||||
List<String> scannedBarcodes = [];
|
||||
|
||||
final ValueNotifier<List<Widget>> scannedBarcodeWidgetsNotifier = ValueNotifier<List<Widget>>([]);
|
||||
final ValueNotifier<List<Widget>> scannedBarcodeWidgetsNotifier = ValueNotifier<List<Widget>>([]);
|
||||
|
||||
List<Widget> createBarcodeWidgets() {
|
||||
List<Widget> barcodeWidgets = [];
|
||||
List<Widget> createBarcodeWidgets() {
|
||||
List<Widget> barcodeWidgets = [];
|
||||
|
||||
for(var barcode in scannedBarcodes) {
|
||||
barcodeWidgets.add(SizedBox(
|
||||
height: 20,
|
||||
child: Center(child: Text(barcode)),
|
||||
));
|
||||
}
|
||||
for (var barcode in scannedBarcodes) {
|
||||
barcodeWidgets.add(SizedBox(
|
||||
height: 20,
|
||||
child: Center(child: Text(barcode)),
|
||||
));
|
||||
}
|
||||
|
||||
return barcodeWidgets;
|
||||
}
|
||||
return barcodeWidgets;
|
||||
}
|
||||
|
||||
void scanBarcode() async {
|
||||
String barcodeScanResult;
|
||||
try {
|
||||
barcodeScanResult = await FlutterBarcodeScanner.scanBarcode('#ff6666', 'Abbrechen', true, ScanMode.QR);
|
||||
void scanBarcode() async {
|
||||
String barcodeScanResult;
|
||||
try {
|
||||
barcodeScanResult = await FlutterBarcodeScanner.scanBarcode('#ff6666', 'Abbrechen', true, ScanMode.QR);
|
||||
|
||||
scannedBarcodes.add(barcodeScanResult);
|
||||
scannedBarcodes.add(barcodeScanResult);
|
||||
|
||||
var barcodeWidgets = createBarcodeWidgets();
|
||||
var barcodeWidgets = createBarcodeWidgets();
|
||||
|
||||
scannedBarcodeWidgetsNotifier.value = barcodeWidgets;
|
||||
} on PlatformException {
|
||||
barcodeScanResult = 'Failed to get platform version.';
|
||||
}
|
||||
}
|
||||
scannedBarcodeWidgetsNotifier.value = barcodeWidgets;
|
||||
} on PlatformException {
|
||||
barcodeScanResult = 'Failed to get platform version.';
|
||||
}
|
||||
}
|
||||
|
||||
return SizedBox(
|
||||
key: GlobalKey(),
|
||||
height: 345,
|
||||
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('Gescannte Barcodes'),
|
||||
const SizedBox(height: 20),
|
||||
Container(
|
||||
return SizedBox(
|
||||
key: GlobalKey(),
|
||||
height: 345,
|
||||
width: MediaQuery.of(context).size.width * 0.8,
|
||||
child: Container(
|
||||
height: 100,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: Colors.white,
|
||||
@@ -92,33 +59,40 @@ KumiPopupWindow showScanBarcodesPopup(BuildContext context, TaskInfo taskInfo, F
|
||||
width: 0.5,
|
||||
),
|
||||
),
|
||||
height: 100,
|
||||
child: ValueListenableBuilder<List<Widget>>(
|
||||
valueListenable: scannedBarcodeWidgetsNotifier,
|
||||
builder: (context, value, child) {
|
||||
return ListView(
|
||||
padding: const EdgeInsets.all(8),
|
||||
children: value
|
||||
);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(35.0),
|
||||
child: Column(
|
||||
children: [
|
||||
const Text('Gescannte Barcodes'),
|
||||
const SizedBox(height: 20),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 0.5,
|
||||
),
|
||||
),
|
||||
height: 100,
|
||||
child: ValueListenableBuilder<List<Widget>>(
|
||||
valueListenable: scannedBarcodeWidgetsNotifier,
|
||||
builder: (context, value, child) {
|
||||
return ListView(padding: const EdgeInsets.all(8), children: value);
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
getDefaultButton('Hinzufügen', buttonHeight: 50, () => {scanBarcode()}),
|
||||
const SizedBox(height: 10),
|
||||
getDefaultButton('Übernehmen', buttonHeight: 50, () => {
|
||||
Navigator.of(context).pop(),
|
||||
|
||||
onFinished(scannedBarcodes)})
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
getDefaultButton('Hinzufügen', buttonHeight: 50, () => {
|
||||
scanBarcode()
|
||||
}),
|
||||
const SizedBox(height: 10),
|
||||
getDefaultButton('Übernehmen', buttonHeight: 50, () => {
|
||||
onFinished(scannedBarcodes)
|
||||
})
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
},
|
||||
);
|
||||
));
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
*/
|
||||
@@ -1,11 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:kumi_popup_window/kumi_popup_window.dart';
|
||||
import 'package:signature/signature.dart';
|
||||
import 'package:stadtbote/model/task_info.dart';
|
||||
import 'package:stadtbote/tools/util.dart';
|
||||
|
||||
showSignaturePopup(BuildContext context, TaskInfo taskInfo, Function() onFinished) async {
|
||||
await showDialog<void>(
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
@@ -46,7 +45,10 @@ showSignaturePopup(BuildContext context, TaskInfo taskInfo, Function() onFinishe
|
||||
backgroundColor: Colors.lightBlueAccent,
|
||||
),
|
||||
),
|
||||
getDefaultButton('Übernehmen', buttonHeight: 50, () => {Navigator.of(context).pop(), onFinished()})
|
||||
getDefaultButton('Übernehmen', buttonHeight: 50, () => {
|
||||
Navigator.of(context).pop(),
|
||||
|
||||
onFinished()})
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,76 +1,58 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:kumi_popup_window/kumi_popup_window.dart';
|
||||
import 'package:stadtbote/model/task_info.dart';
|
||||
import 'package:stadtbote/tools/util.dart';
|
||||
|
||||
KumiPopupWindow showStationNoticePopup(BuildContext context, TaskInfo taskInfo, Function(String) onFinished) {
|
||||
return showPopupWindow(
|
||||
context,
|
||||
//childSize:Size(240, MediaQuery.of(context).size.width * 0.8),
|
||||
gravity: KumiPopupGravity.center,
|
||||
//curve: Curves.elasticOut,
|
||||
bgColor: Colors.grey.withOpacity(0.5),
|
||||
clickOutDismiss: true,
|
||||
clickBackDismiss: true,
|
||||
customAnimation: false,
|
||||
customPop: false,
|
||||
customPage: false,
|
||||
// targetRenderBox: (btnKey.currentContext.findRenderObject() as RenderBox),
|
||||
//needSafeDisplay: true,
|
||||
underStatusBar: false,
|
||||
underAppBar: false,
|
||||
//offsetX: -180,
|
||||
//offsetY: 50,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
onShowStart: (pop) {},
|
||||
onShowFinish: (pop) {},
|
||||
onDismissStart: (pop) {},
|
||||
onDismissFinish: (pop) {},
|
||||
onClickOut: (pop) {},
|
||||
onClickBack: (pop) {},
|
||||
childFun: (pop) {
|
||||
TextEditingController textEditingController = TextEditingController();
|
||||
showStationNoticePopup(BuildContext context, TaskInfo taskInfo, Function(String) 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) {
|
||||
TextEditingController textEditingController = TextEditingController();
|
||||
|
||||
return SizedBox(
|
||||
key: GlobalKey(),
|
||||
height: 280,
|
||||
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),
|
||||
SizedBox(
|
||||
height: 100,
|
||||
child: Util.getDefaultTextField(taskInfo.task.topic,
|
||||
type: TextInputType.text,
|
||||
maxLines: 10,
|
||||
formatter: [FilteringTextInputFormatter.singleLineFormatter],
|
||||
controller: textEditingController,
|
||||
autofocus: true),
|
||||
return SizedBox(
|
||||
key: GlobalKey(),
|
||||
height: 280,
|
||||
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,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
getDefaultButton('Übernehmen', buttonHeight: 50, () => {onFinished(textEditingController.text)})
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(35.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(taskInfo.task.topic),
|
||||
const SizedBox(height: 20),
|
||||
SizedBox(
|
||||
height: 100,
|
||||
child: Util.getDefaultTextField(taskInfo.task.topic,
|
||||
type: TextInputType.text,
|
||||
maxLines: 10,
|
||||
formatter: [FilteringTextInputFormatter.singleLineFormatter],
|
||||
controller: textEditingController,
|
||||
autofocus: true),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
getDefaultButton('Übernehmen', buttonHeight: 50, () => {
|
||||
Navigator.of(context).pop(),
|
||||
|
||||
onFinished(textEditingController.text)})
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
}));
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
*/
|
||||
@@ -10,7 +10,7 @@ Future<void> showTakePhotosPopup(BuildContext context, TaskInfo taskInfo, Functi
|
||||
|
||||
ValueNotifier<List<Widget>> imageWidgetsListNotifier = ValueNotifier<List<Widget>>([]);
|
||||
|
||||
await showDialog<void>(
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:isar/isar.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'fin_task_message.g.dart';
|
||||
@@ -43,6 +44,7 @@ class Task {
|
||||
Map<String, dynamic> toJson() => _$TaskToJson(this);
|
||||
}
|
||||
|
||||
@embedded
|
||||
@JsonSerializable()
|
||||
class FinTaskPos {
|
||||
late double lat;
|
||||
|
||||
@@ -2,6 +2,273 @@
|
||||
|
||||
part of 'fin_task_message.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// IsarEmbeddedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: duplicate_ignore, non_constant_identifier_names, constant_identifier_names, invalid_use_of_protected_member, unnecessary_cast, prefer_const_constructors, lines_longer_than_80_chars, require_trailing_commas, inference_failure_on_function_invocation, unnecessary_parenthesis, unnecessary_raw_strings, unnecessary_null_checks, join_return_with_assignment, prefer_final_locals, avoid_js_rounded_ints, avoid_positional_boolean_parameters, always_specify_types
|
||||
|
||||
const FinTaskPosSchema = Schema(
|
||||
name: r'FinTaskPos',
|
||||
id: 7757904122564928017,
|
||||
properties: {
|
||||
r'acc': PropertySchema(
|
||||
id: 0,
|
||||
name: r'acc',
|
||||
type: IsarType.long,
|
||||
),
|
||||
r'lat': PropertySchema(
|
||||
id: 1,
|
||||
name: r'lat',
|
||||
type: IsarType.double,
|
||||
),
|
||||
r'long': PropertySchema(
|
||||
id: 2,
|
||||
name: r'long',
|
||||
type: IsarType.double,
|
||||
)
|
||||
},
|
||||
estimateSize: _finTaskPosEstimateSize,
|
||||
serialize: _finTaskPosSerialize,
|
||||
deserialize: _finTaskPosDeserialize,
|
||||
deserializeProp: _finTaskPosDeserializeProp,
|
||||
);
|
||||
|
||||
int _finTaskPosEstimateSize(
|
||||
FinTaskPos object,
|
||||
List<int> offsets,
|
||||
Map<Type, List<int>> allOffsets,
|
||||
) {
|
||||
var bytesCount = offsets.last;
|
||||
return bytesCount;
|
||||
}
|
||||
|
||||
void _finTaskPosSerialize(
|
||||
FinTaskPos object,
|
||||
IsarWriter writer,
|
||||
List<int> offsets,
|
||||
Map<Type, List<int>> allOffsets,
|
||||
) {
|
||||
writer.writeLong(offsets[0], object.acc);
|
||||
writer.writeDouble(offsets[1], object.lat);
|
||||
writer.writeDouble(offsets[2], object.long);
|
||||
}
|
||||
|
||||
FinTaskPos _finTaskPosDeserialize(
|
||||
Id id,
|
||||
IsarReader reader,
|
||||
List<int> offsets,
|
||||
Map<Type, List<int>> allOffsets,
|
||||
) {
|
||||
final object = FinTaskPos();
|
||||
object.acc = reader.readLong(offsets[0]);
|
||||
object.lat = reader.readDouble(offsets[1]);
|
||||
object.long = reader.readDouble(offsets[2]);
|
||||
return object;
|
||||
}
|
||||
|
||||
P _finTaskPosDeserializeProp<P>(
|
||||
IsarReader reader,
|
||||
int propertyId,
|
||||
int offset,
|
||||
Map<Type, List<int>> allOffsets,
|
||||
) {
|
||||
switch (propertyId) {
|
||||
case 0:
|
||||
return (reader.readLong(offset)) as P;
|
||||
case 1:
|
||||
return (reader.readDouble(offset)) as P;
|
||||
case 2:
|
||||
return (reader.readDouble(offset)) as P;
|
||||
default:
|
||||
throw IsarError('Unknown property with id $propertyId');
|
||||
}
|
||||
}
|
||||
|
||||
extension FinTaskPosQueryFilter
|
||||
on QueryBuilder<FinTaskPos, FinTaskPos, QFilterCondition> {
|
||||
QueryBuilder<FinTaskPos, FinTaskPos, QAfterFilterCondition> accEqualTo(
|
||||
int value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'acc',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<FinTaskPos, FinTaskPos, QAfterFilterCondition> accGreaterThan(
|
||||
int value, {
|
||||
bool include = false,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
||||
include: include,
|
||||
property: r'acc',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<FinTaskPos, FinTaskPos, QAfterFilterCondition> accLessThan(
|
||||
int value, {
|
||||
bool include = false,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.lessThan(
|
||||
include: include,
|
||||
property: r'acc',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<FinTaskPos, FinTaskPos, QAfterFilterCondition> accBetween(
|
||||
int lower,
|
||||
int upper, {
|
||||
bool includeLower = true,
|
||||
bool includeUpper = true,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.between(
|
||||
property: r'acc',
|
||||
lower: lower,
|
||||
includeLower: includeLower,
|
||||
upper: upper,
|
||||
includeUpper: includeUpper,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<FinTaskPos, FinTaskPos, QAfterFilterCondition> latEqualTo(
|
||||
double value, {
|
||||
double epsilon = Query.epsilon,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'lat',
|
||||
value: value,
|
||||
epsilon: epsilon,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<FinTaskPos, FinTaskPos, QAfterFilterCondition> latGreaterThan(
|
||||
double value, {
|
||||
bool include = false,
|
||||
double epsilon = Query.epsilon,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
||||
include: include,
|
||||
property: r'lat',
|
||||
value: value,
|
||||
epsilon: epsilon,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<FinTaskPos, FinTaskPos, QAfterFilterCondition> latLessThan(
|
||||
double value, {
|
||||
bool include = false,
|
||||
double epsilon = Query.epsilon,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.lessThan(
|
||||
include: include,
|
||||
property: r'lat',
|
||||
value: value,
|
||||
epsilon: epsilon,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<FinTaskPos, FinTaskPos, QAfterFilterCondition> latBetween(
|
||||
double lower,
|
||||
double upper, {
|
||||
bool includeLower = true,
|
||||
bool includeUpper = true,
|
||||
double epsilon = Query.epsilon,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.between(
|
||||
property: r'lat',
|
||||
lower: lower,
|
||||
includeLower: includeLower,
|
||||
upper: upper,
|
||||
includeUpper: includeUpper,
|
||||
epsilon: epsilon,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<FinTaskPos, FinTaskPos, QAfterFilterCondition> longEqualTo(
|
||||
double value, {
|
||||
double epsilon = Query.epsilon,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'long',
|
||||
value: value,
|
||||
epsilon: epsilon,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<FinTaskPos, FinTaskPos, QAfterFilterCondition> longGreaterThan(
|
||||
double value, {
|
||||
bool include = false,
|
||||
double epsilon = Query.epsilon,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
||||
include: include,
|
||||
property: r'long',
|
||||
value: value,
|
||||
epsilon: epsilon,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<FinTaskPos, FinTaskPos, QAfterFilterCondition> longLessThan(
|
||||
double value, {
|
||||
bool include = false,
|
||||
double epsilon = Query.epsilon,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.lessThan(
|
||||
include: include,
|
||||
property: r'long',
|
||||
value: value,
|
||||
epsilon: epsilon,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<FinTaskPos, FinTaskPos, QAfterFilterCondition> longBetween(
|
||||
double lower,
|
||||
double upper, {
|
||||
bool includeLower = true,
|
||||
bool includeUpper = true,
|
||||
double epsilon = Query.epsilon,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.between(
|
||||
property: r'long',
|
||||
lower: lower,
|
||||
includeLower: includeLower,
|
||||
upper: upper,
|
||||
includeUpper: includeUpper,
|
||||
epsilon: epsilon,
|
||||
));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extension FinTaskPosQueryObject
|
||||
on QueryBuilder<FinTaskPos, FinTaskPos, QFilterCondition> {}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:isar/isar.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:stadtbote/protocoll_messages/accept_job_message.dart';
|
||||
import 'package:stadtbote/protocoll_messages/fin_task_message.dart';
|
||||
@@ -6,6 +7,7 @@ part 'fin_tour_message.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class FinTourMessage {
|
||||
@JsonKey(name: 'fin_tour')
|
||||
late FinTour finTour;
|
||||
|
||||
FinTourMessage();
|
||||
@@ -40,6 +42,14 @@ class FinTourTask {
|
||||
|
||||
late String time;
|
||||
|
||||
String? val;
|
||||
|
||||
int? code;
|
||||
|
||||
String? sign;
|
||||
|
||||
List<String>? codes;
|
||||
|
||||
late FinTaskPos pos;
|
||||
|
||||
FinTourTask();
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
+13
-12
@@ -431,24 +431,25 @@ class MqttCore {
|
||||
}
|
||||
|
||||
void _startTrackTimer() {
|
||||
_trackTimer = Timer(const Duration(seconds: 60), () {
|
||||
var position = MyApp.currentPosition;
|
||||
if (position != null) {
|
||||
var trackMessage = TrackMessage();
|
||||
trackMessage.pos = TrackPosition();
|
||||
trackMessage.pos.time = position.timestamp.toIso8601String();
|
||||
trackMessage.pos.lat = position.latitude;
|
||||
trackMessage.pos.long = position.longitude;
|
||||
trackMessage.pos.acc = position.accuracy.toInt();
|
||||
_trackTimer ??= Timer.periodic(const Duration(seconds: 60), (Timer t) {
|
||||
var position = MyApp.currentPosition;
|
||||
if (position != null) {
|
||||
var trackMessage = TrackMessage();
|
||||
trackMessage.pos = TrackPosition();
|
||||
trackMessage.pos.time = position.timestamp.toIso8601String();
|
||||
trackMessage.pos.lat = position.latitude;
|
||||
trackMessage.pos.long = position.longitude;
|
||||
trackMessage.pos.acc = position.accuracy.toInt();
|
||||
|
||||
publishPayloadMessage("track", trackMessage.toJson());
|
||||
}
|
||||
});
|
||||
publishPayloadMessage("track", trackMessage.toJson());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void _cancelTrackTimer() {
|
||||
if (_trackTimer != null && _trackTimer!.isActive) {
|
||||
_trackTimer!.cancel();
|
||||
_trackTimer = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -1,3 +1,4 @@
|
||||
import 'dart:developer';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:audioplayers/audioplayers.dart';
|
||||
@@ -72,11 +73,11 @@ class Util {
|
||||
}
|
||||
|
||||
static logInfo(String message) {
|
||||
debugPrint(message);
|
||||
log(message);
|
||||
}
|
||||
|
||||
static logException(String message) {
|
||||
debugPrint('Exception: $message');
|
||||
log('Exception: $message');
|
||||
}
|
||||
|
||||
static int fastHash(String string) {
|
||||
|
||||
@@ -784,14 +784,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.7.1"
|
||||
kumi_popup_window:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: kumi_popup_window
|
||||
sha256: "3159a2ee307850ab3520cfb162efc1e330aac2e560569e20227bf2ac93ec06d5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
latlong2:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
||||
@@ -53,7 +53,6 @@ dependencies:
|
||||
intl: ^0.18.0
|
||||
another_stepper: ^1.2.2
|
||||
easy_stepper: ^0.6.0
|
||||
kumi_popup_window: ^2.0.1
|
||||
flutter_osm_plugin: ^0.53.4+1
|
||||
routing_client_dart: ^0.4.2
|
||||
animated_toggle_switch: ^0.6.2
|
||||
|
||||
Reference in new issue
Block a user