Fehlerkorrekturen
This commit is contained in:
1 parent
e862f0b7aa
commit
e5c3a3ca22
9 files changed
+79
-83
No files matched your search
@@ -67,14 +67,14 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
|
||||
List<Uint8List> _photos = [];
|
||||
|
||||
late String commisionNumber;
|
||||
late String _commisionNumber;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
Future.delayed(const Duration(seconds: 0), () async {
|
||||
_taskList = await _fetchTaskList();
|
||||
|
||||
commisionNumber = widget.tour.com;
|
||||
_commisionNumber = widget.tour.com;
|
||||
|
||||
_initCompleted = true;
|
||||
|
||||
@@ -102,10 +102,10 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
child: Column(
|
||||
children: [
|
||||
Visibility(
|
||||
visible: commisionNumber.length > 0,
|
||||
visible: _commisionNumber.length > 0,
|
||||
child: Row(
|
||||
children: [
|
||||
Text('Komm-#: $commisionNumber', style: const TextStyle(fontSize: 20), textAlign: TextAlign.left),
|
||||
Text('Komm-#: $_commisionNumber', style: const TextStyle(fontSize: 20), textAlign: TextAlign.left),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -294,7 +294,7 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
taskInfo.additionalText = comissionNumber;
|
||||
taskInfo.completed = true;
|
||||
|
||||
commisionNumber = comissionNumber;
|
||||
_commisionNumber = comissionNumber;
|
||||
|
||||
setState(() {});
|
||||
|
||||
@@ -477,7 +477,7 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
var finTourMessage = FinTourMessage();
|
||||
finTourMessage.finTour = FinTour();
|
||||
finTourMessage.finTour.trId = widget.tour.id;
|
||||
finTourMessage.finTour.com = "Mir doch egal!";
|
||||
finTourMessage.finTour.com = _commisionNumber;
|
||||
|
||||
var position = MyApp.currentPosition;
|
||||
if (position != null) {
|
||||
@@ -504,7 +504,9 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
await MyApp.isarInstance.jobs.put(widget.job);
|
||||
});
|
||||
|
||||
_sendImages();
|
||||
_sendImages();
|
||||
|
||||
await _checkJobFinished();
|
||||
}
|
||||
|
||||
_sendImages() {
|
||||
@@ -533,54 +535,22 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
});
|
||||
}
|
||||
|
||||
/*private void SendImages()
|
||||
{
|
||||
var tourId = _jobTour.Id;
|
||||
Future<void> _checkJobFinished() async {
|
||||
var jobFinished = true;
|
||||
|
||||
Task.Run(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
for (var tour in widget.job.tours) {
|
||||
if (tour.state == 0) {
|
||||
jobFinished = false;
|
||||
|
||||
var index = 0;
|
||||
var realm = Realm.GetInstance();
|
||||
var tourImages = realm.All<TourImage>().Where(tourImage => tourImage.TourId == tourId);
|
||||
if (tourImages.Any())
|
||||
{
|
||||
foreach (var tourImage in tourImages)
|
||||
{
|
||||
var payloadObject = new JObject();
|
||||
|
||||
var picObject = new JObject();
|
||||
payloadObject.Add(new JProperty("pic", picObject));
|
||||
|
||||
picObject.Add(new JProperty("tr_id", tourImage.TourId));
|
||||
picObject.Add(new JProperty("num", index));
|
||||
picObject.Add(new JProperty("time", DateTime.Now.ToString("o")));
|
||||
picObject.Add(new JProperty("data", tourImage.ImageData));
|
||||
|
||||
var location = App.CurrentLocation;
|
||||
if (location != null)
|
||||
{
|
||||
var posObject = new JObject();
|
||||
picObject.Add(new JProperty("pos", posObject));
|
||||
|
||||
posObject.Add(new JProperty("lat", location.Latitude));
|
||||
posObject.Add(new JProperty("long", location.Longitude));
|
||||
}
|
||||
|
||||
App.Core.SendJsonMessageAsync("job", payloadObject);
|
||||
|
||||
index++;
|
||||
}
|
||||
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}*/
|
||||
|
||||
if (jobFinished) {
|
||||
widget.job.state = 2;
|
||||
await MyApp.isarInstance.writeTxn(() async {
|
||||
await MyApp.isarInstance.jobs.put(widget.job);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user