Fehlerkorrekturen
This commit is contained in:
1 parent
faef9ac5d9
commit
125e6eb03e
16 files changed
+335
-48
No files matched your search
@@ -78,7 +78,7 @@ Future<void> showAcceptJobsPopup(BuildContext context, List<Job> jobs) async {
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: Text(
|
||||
DateFormat('dd.MM.yyyy HH:mm').format(DateTime.parse(job.ordertime)).toString(),
|
||||
DateFormat('dd.MM.yyyy HH:mm').format(DateTime.parse(job.ordertime).toLocal()).toString(),
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(backgroundColor: isJobInFuture(job) ? Colors.yellow : Colors.transparent),
|
||||
),
|
||||
|
||||
@@ -40,10 +40,15 @@ showReceiptGiverPopup(BuildContext context, TaskInfo taskInfo, Function(String)
|
||||
controller: textEditingController,
|
||||
autofocus: true),
|
||||
const SizedBox(height: 20),
|
||||
getDefaultButton('Übernehmen', () => {
|
||||
Navigator.of(context).pop(),
|
||||
getDefaultButton('Übernehmen', () {
|
||||
if (textEditingController.text.isNotEmpty) {
|
||||
Navigator.of(context).pop();
|
||||
|
||||
onFinished(textEditingController.text)})
|
||||
onFinished(textEditingController.text);
|
||||
} else {
|
||||
showAlertDialog(context, "Fehler", "Sie müssen einen Text eingeben");
|
||||
}
|
||||
})
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,13 +1,22 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:signature/signature.dart';
|
||||
import 'package:stadtbote/main.dart';
|
||||
import 'package:stadtbote/model/task_info.dart';
|
||||
import 'package:stadtbote/tools/util.dart';
|
||||
|
||||
showSignaturePopup(BuildContext context, TaskInfo taskInfo, Function() onFinished) async {
|
||||
showSignaturePopup(BuildContext context, TaskInfo taskInfo, Function(String?) onFinished) async {
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
Navigator.of(context).pop();
|
||||
|
||||
onFinished(null);
|
||||
|
||||
return true;
|
||||
},// False will prevent and true will allow to dismiss
|
||||
child: AlertDialog(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
shadowColor: Colors.transparent,
|
||||
backgroundColor: Colors.white,
|
||||
@@ -18,6 +27,25 @@ showSignaturePopup(BuildContext context, TaskInfo taskInfo, Function() onFinishe
|
||||
var popupHeight = MediaQuery.of(context).size.height * 0.85;
|
||||
var popupWidth = MediaQuery.of(context).size.width * 0.85;
|
||||
|
||||
String convertPoints(List<Point> points) {
|
||||
bool firstTap = true;
|
||||
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 SizedBox(
|
||||
key: GlobalKey(),
|
||||
height: popupHeight,
|
||||
@@ -48,12 +76,13 @@ showSignaturePopup(BuildContext context, TaskInfo taskInfo, Function() onFinishe
|
||||
getDefaultButton('Übernehmen', buttonHeight: 50, () => {
|
||||
Navigator.of(context).pop(),
|
||||
|
||||
onFinished()})
|
||||
onFinished(convertPoints(controller.points))
|
||||
})
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
},
|
||||
));
|
||||
)));
|
||||
});
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:stadtbote/model/task_info.dart';
|
||||
import 'package:stadtbote/tools/util.dart';
|
||||
|
||||
Future<void> showTakePhotosPopup(BuildContext context, TaskInfo taskInfo, Function() onFinished) async {
|
||||
Future<void> showTakePhotosPopup(BuildContext context, TaskInfo taskInfo, Function(List<Uint8List>) onFinished) async {
|
||||
List<Uint8List> imageDataList = [];
|
||||
List<Widget> imageWidgetsList = [];
|
||||
|
||||
@@ -90,7 +90,7 @@ Future<void> showTakePhotosPopup(BuildContext context, TaskInfo taskInfo, Functi
|
||||
buttonHeight: 50,
|
||||
() => {
|
||||
if (imageDataList.length == taskInfo.task.min! && imageDataList.length <= taskInfo.task.max!)
|
||||
{Navigator.of(context).pop(), onFinished()}
|
||||
{Navigator.of(context).pop(), onFinished(imageDataList)}
|
||||
else
|
||||
{showAlertDialog(context, 'Fehler', 'Sie müssen mindestens ${taskInfo.task.min} Foto(s) aufnehmen')}
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user