Fehlerkorrekturen und Erweiterungen
This commit is contained in:
1 parent
1f3cc1e995
commit
6c4294512e
8 files changed
+166
-75
No files matched your search
@@ -118,14 +118,14 @@ class _TourDetailsPageState extends State<TourDetailsPage> with ProducerMixin {
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.grey, width: 0.5),
|
||||
border: Border.all(color: Colors.grey, width: 1.5),
|
||||
color: Colors.transparent,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(13))
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Expanded(child: SingleChildScrollView(child: Text(remark))),
|
||||
Expanded(child: Scrollbar(thumbVisibility: true, child: SingleChildScrollView(child: Text(remark)))),
|
||||
]
|
||||
),
|
||||
),
|
||||
@@ -133,13 +133,10 @@ class _TourDetailsPageState extends State<TourDetailsPage> with ProducerMixin {
|
||||
const SizedBox(height: 10),
|
||||
getDefaultButton('Weiter', () async =>
|
||||
{
|
||||
// TODO MESSAGING
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPushContentView,
|
||||
payload: TaskListPage(job: widget.job, tour: widget.tour, readOnly: widget.readOnly),
|
||||
)
|
||||
|
||||
//await MessageService().publish<ContentViewWidget>(Constants.messageTopicPushContentView, arguments: TaskListPage(job: widget.job, tour: widget.tour, readOnly: widget.readOnly))
|
||||
}),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -106,7 +106,7 @@ class _TourListPageState extends State<TourListPage> with ProducerMixin {
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
child: ListView(padding: const EdgeInsets.all(0), children: jobWidgets),
|
||||
child: Scrollbar(thumbVisibility: true, child: ListView(padding: const EdgeInsets.all(0), children: jobWidgets)),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:expandable/expandable.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:shared_map/shared_map.dart';
|
||||
@@ -138,18 +136,109 @@ Future<List<Widget>> _fetchJobWidgets(StateSetter dialogState, Function() onFini
|
||||
for (var jobEntry in entries) {
|
||||
var job = jobEntry.value;
|
||||
|
||||
ExpandableController controller = ExpandableController();
|
||||
controller.expanded = false;
|
||||
|
||||
controller.addListener(() {
|
||||
if (controller.expanded) {
|
||||
_infoExpandedMap[job.id] = true;
|
||||
} else {
|
||||
_infoExpandedMap[job.id] = false;
|
||||
}
|
||||
});
|
||||
var scrollController = ScrollController();
|
||||
|
||||
widgets.add(StatefulBuilder(builder: (BuildContext context, StateSetter setState) {
|
||||
return ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
||||
title: Container(
|
||||
height: 280,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(
|
||||
color: Constants.colorPrimary,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 200,
|
||||
child: Scrollbar(
|
||||
controller: scrollController,
|
||||
thumbVisibility: true,
|
||||
child: SingleChildScrollView(
|
||||
controller: scrollController,
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: Text(
|
||||
DateFormat('dd.MM.yyyy HH:mm').format(DateTime.parse(job.ordertime).toLocal()).toString(),
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(backgroundColor: isJobTooFarInFuture(job) ? Colors.red : Colors.transparent),
|
||||
),
|
||||
),
|
||||
SizedBox(width: double.infinity, child: Text('Auftragsnummer: ${job.id}', textAlign: TextAlign.left)),
|
||||
SizedBox(width: double.infinity, child: Text(job.tours[0].comp, textAlign: TextAlign.left)),
|
||||
SizedBox(width: double.infinity, child: Text(job.tours[0].street, textAlign: TextAlign.left)),
|
||||
SizedBox(width: double.infinity, child: Text(job.tours[0].city, textAlign: TextAlign.left)),
|
||||
Row(
|
||||
children: [
|
||||
Image.asset("assets/${mapVehicleTypeToImageName(job.vhtId)}", width: 60, height: 60),
|
||||
const SizedBox(width: 10),
|
||||
Text(mapVehicleTypeToText(job.vhtId)),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(width: double.infinity, child: Text(job.rem, textAlign: TextAlign.left)),
|
||||
SizedBox(width: double.infinity, child: Text(job.rem, textAlign: TextAlign.left)),
|
||||
SizedBox(width: double.infinity, child: Text(job.rem, textAlign: TextAlign.left)),
|
||||
SizedBox(width: double.infinity, child: Text(job.rem, textAlign: TextAlign.left)),
|
||||
SizedBox(width: double.infinity, child: Text(job.rem, textAlign: TextAlign.left)),
|
||||
SizedBox(width: double.infinity, child: Text(job.rem, textAlign: TextAlign.left)),
|
||||
SizedBox(width: double.infinity, child: Text(job.rem, textAlign: TextAlign.left)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(children: [
|
||||
Expanded(
|
||||
child: getDefaultButton(!job.global ? 'Ablehnen' : 'Ignorieren', () {
|
||||
dialogState(() {
|
||||
_sendAnswer(mapReference, job, !job.global ? 2 : 3);
|
||||
|
||||
jobMap.remove(job.id);
|
||||
|
||||
job.sendMessage(
|
||||
routingKey: Constants.messageTopicRemoveJob,
|
||||
payload: RemoveJobMessage(id: job.id),
|
||||
);
|
||||
|
||||
setState(() {});
|
||||
});
|
||||
}),
|
||||
),
|
||||
const SizedBox(width: 20),
|
||||
Expanded(
|
||||
child: getDefaultButton('Annehmen', enabledTimerActive: false, () {
|
||||
dialogState(() {
|
||||
_sendAnswer(mapReference, job, 1);
|
||||
|
||||
jobMap.remove(job.id);
|
||||
|
||||
job.sendMessage(
|
||||
routingKey: Constants.messageTopicRemoveJob,
|
||||
payload: RemoveJobMessage(id: job.id),
|
||||
);
|
||||
|
||||
setState(() {});
|
||||
});
|
||||
}),
|
||||
)
|
||||
])
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}));
|
||||
|
||||
/*widgets.add(StatefulBuilder(builder: (BuildContext context, StateSetter setState) {
|
||||
return ExpandableNotifier(
|
||||
child: ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
||||
@@ -283,7 +372,8 @@ Future<List<Widget>> _fetchJobWidgets(StateSetter dialogState, Function() onFini
|
||||
),
|
||||
),
|
||||
);
|
||||
}));
|
||||
}))*/
|
||||
;
|
||||
}
|
||||
|
||||
return widgets;
|
||||
|
||||
@@ -604,15 +604,19 @@ class MqttCore with ProducerMixin, ConsumerMixin {
|
||||
|
||||
void _startTrackTimer() {
|
||||
_trackTimer ??= Timer.periodic(const Duration(seconds: 120), (Timer t) {
|
||||
var position = MyApp.currentPosition;
|
||||
if (position != null) {
|
||||
var trackMessage = TrackPosition();
|
||||
trackMessage.time = position.timestamp.toIso8601String();
|
||||
trackMessage.lat = position.latitude;
|
||||
trackMessage.long = position.longitude;
|
||||
trackMessage.acc = position.accuracy.toInt();
|
||||
try {
|
||||
var position = MyApp.currentPosition;
|
||||
if (position != null) {
|
||||
var trackMessage = TrackPosition();
|
||||
trackMessage.time = position.timestamp.toIso8601String();
|
||||
trackMessage.lat = position.latitude;
|
||||
trackMessage.long = position.longitude;
|
||||
trackMessage.acc = position.accuracy.toInt();
|
||||
|
||||
_publishMessage("track", trackMessage.toJson(), false);
|
||||
_publishMessage("track", trackMessage.toJson(), false);
|
||||
}
|
||||
} catch (ex) {
|
||||
Util.logException("Error in periodic track timer: {$ex}");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user