Fehlerkorrekturen
This commit is contained in:
1 parent
b18a0c4526
commit
faef9ac5d9
3 files changed
+43
-36
No files matched your search
@@ -5,6 +5,9 @@ import 'package:stadtbote/content_views/utils/header_info.dart';
|
|||||||
import 'package:stadtbote/model/ranking.dart';
|
import 'package:stadtbote/model/ranking.dart';
|
||||||
import 'package:stadtbote/popups/tasks_popups/zip_popup.dart';
|
import 'package:stadtbote/popups/tasks_popups/zip_popup.dart';
|
||||||
import 'package:stadtbote/protocoll_messages/zip_message.dart';
|
import 'package:stadtbote/protocoll_messages/zip_message.dart';
|
||||||
|
import 'package:stadtbote/tools/constants.dart';
|
||||||
|
import 'package:stadtbote/tools/message_service.dart';
|
||||||
|
import 'package:stadtbote/tools/messages/ranking_updated.dart';
|
||||||
import 'package:stadtbote/tools/mqtt_core.dart';
|
import 'package:stadtbote/tools/mqtt_core.dart';
|
||||||
|
|
||||||
import '../main.dart';
|
import '../main.dart';
|
||||||
@@ -47,6 +50,8 @@ class _ApproachAreaPageState extends State<ApproachAreaPage> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
|
||||||
Future.delayed(const Duration(seconds: 0), () async {
|
Future.delayed(const Duration(seconds: 0), () async {
|
||||||
_ranking = await MyApp.isarInstance.rankings.where().findFirst();
|
_ranking = await MyApp.isarInstance.rankings.where().findFirst();
|
||||||
|
|
||||||
@@ -55,7 +60,14 @@ class _ApproachAreaPageState extends State<ApproachAreaPage> {
|
|||||||
setState(() {});
|
setState(() {});
|
||||||
});
|
});
|
||||||
|
|
||||||
super.initState();
|
_initMessages();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void deactivate() {
|
||||||
|
super.deactivate();
|
||||||
|
|
||||||
|
MessageService().unsubscribe(Constants.messageTopicRankingUpdated, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -101,7 +113,7 @@ class _ApproachAreaPageState extends State<ApproachAreaPage> {
|
|||||||
margin: const EdgeInsets.all(2),
|
margin: const EdgeInsets.all(2),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
color: i == 0 ? Colors.lightGreen : Colors.white,
|
color: i == 0 ? Constants.colorPrimary : Colors.white,
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
@@ -112,10 +124,11 @@ class _ApproachAreaPageState extends State<ApproachAreaPage> {
|
|||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
Text(
|
Text(
|
||||||
rank.zip,
|
rank.zip,
|
||||||
style: const TextStyle(fontSize: 20),
|
style: TextStyle(fontSize: 20, color: (i == 0 ? Colors.white : Colors.black)),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
rank.area,
|
rank.area,
|
||||||
|
style: TextStyle(fontSize: 13, color: (i == 0 ? Colors.white : Colors.black)),
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@@ -145,7 +158,7 @@ class _ApproachAreaPageState extends State<ApproachAreaPage> {
|
|||||||
Image.asset(imageFilename, width: 30, height: 30),
|
Image.asset(imageFilename, width: 30, height: 30),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Text(
|
Text(
|
||||||
mapVehicleTypeToText(vehicle.type)
|
mapVehicleTypeToText(vehicle.type),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -190,32 +203,12 @@ class _ApproachAreaPageState extends State<ApproachAreaPage> {
|
|||||||
|
|
||||||
MqttCore.instance.publishPayloadMessage("rank", zipMessage.toJson());
|
MqttCore.instance.publishPayloadMessage("rank", zipMessage.toJson());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_initMessages() {
|
||||||
|
MessageService().subscribe<RankingUpdated>(Constants.messageTopicRankingUpdated, this, (rankingUpdateMessage) async {
|
||||||
|
_ranking = await MyApp.isarInstance.rankings.where().findFirst();
|
||||||
|
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
private void SendMessage(int columnNumber, string zipNumber)
|
|
||||||
{
|
|
||||||
var payloadObject = new JObject();
|
|
||||||
|
|
||||||
if (columnNumber == 0)
|
|
||||||
{
|
|
||||||
var setPosObject = new JObject();
|
|
||||||
payloadObject.Add(new JProperty("set_pos", setPosObject));
|
|
||||||
|
|
||||||
setPosObject.Add(new JProperty("zip", zipNumber));
|
|
||||||
setPosObject.Add(new JProperty("track", CreateTrackObject()));
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
var regZipObject = new JObject();
|
|
||||||
payloadObject.Add(new JProperty("reg_zip", regZipObject));
|
|
||||||
|
|
||||||
regZipObject.Add(new JProperty("id", columnNumber));
|
|
||||||
regZipObject.Add(new JProperty("zip", zipNumber));
|
|
||||||
}
|
|
||||||
|
|
||||||
var json = payloadObject.ToString();
|
|
||||||
|
|
||||||
App.Core.SendJsonMessageAsync("rank", payloadObject);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
@@ -82,6 +82,12 @@ class _AssignedJobsPageState extends State<AssignedJobsPage> {
|
|||||||
|
|
||||||
var jobs = await MyApp.isarInstance.jobs.filter().stateEqualTo(Constants.stateAssigned).findAll();
|
var jobs = await MyApp.isarInstance.jobs.filter().stateEqualTo(Constants.stateAssigned).findAll();
|
||||||
for (var job in jobs) {
|
for (var job in jobs) {
|
||||||
|
String remarkString = '';
|
||||||
|
for (var remark in job.rem) {
|
||||||
|
remarkString += '$remark\n';
|
||||||
|
}
|
||||||
|
remarkString = remarkString.trim();
|
||||||
|
|
||||||
entries.add(ExpandableNotifier(
|
entries.add(ExpandableNotifier(
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
contentPadding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
contentPadding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
||||||
@@ -140,7 +146,7 @@ class _AssignedJobsPageState extends State<AssignedJobsPage> {
|
|||||||
)),
|
)),
|
||||||
collapsed: const SizedBox(),
|
collapsed: const SizedBox(),
|
||||||
expanded: Column(
|
expanded: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
height: 200,
|
height: 200,
|
||||||
@@ -152,7 +158,7 @@ class _AssignedJobsPageState extends State<AssignedJobsPage> {
|
|||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: const Text('asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd '),
|
child: Text(remarkString),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -4,11 +4,12 @@ import 'package:animated_toggle_switch/animated_toggle_switch.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_map/flutter_map.dart';
|
import 'package:flutter_map/flutter_map.dart';
|
||||||
import 'package:latlong2/latlong.dart';
|
import 'package:latlong2/latlong.dart';
|
||||||
|
import 'package:stadtbote/tools/util.dart';
|
||||||
|
|
||||||
import '../model/job_tour.dart';
|
import '../model/job_tour.dart';
|
||||||
|
|
||||||
showMapPopup(BuildContext context, JobTour currentTour, List<JobTour> tourList) async {
|
showMapPopup(BuildContext context, JobTour currentTour, List<JobTour> tourList) async {
|
||||||
await showDialog(
|
/*await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
@@ -27,12 +28,16 @@ showMapPopup(BuildContext context, JobTour currentTour, List<JobTour> tourList)
|
|||||||
tourWidgets.add(
|
tourWidgets.add(
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
|
if (tour.pos != null) {
|
||||||
mapController.move(LatLng(tour.pos!.lat, tour.pos!.long), mapController.zoom);
|
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;
|
currentTour = tour;
|
||||||
streamController[tour.sort]!.sink.add(true);
|
streamController[tour.sort]!.sink.add(true);
|
||||||
|
} else {
|
||||||
|
showAlertDialog(context, 'Information', 'Es liegt keine Position für diese Station vor');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 70,
|
width: 70,
|
||||||
@@ -87,17 +92,20 @@ showMapPopup(BuildContext context, JobTour currentTour, List<JobTour> tourList)
|
|||||||
|
|
||||||
List<Marker> markers = [];
|
List<Marker> markers = [];
|
||||||
for (var tour in tourList) {
|
for (var tour in tourList) {
|
||||||
|
if (tour.pos != null) {
|
||||||
markers.add(Marker(
|
markers.add(Marker(
|
||||||
builder: (context) => const Icon(Icons.person_pin_circle, size: 56, color: Colors.blue),
|
builder: (context) => const Icon(Icons.person_pin_circle, size: 56, color: Colors.blue),
|
||||||
point: LatLng(tour.pos!.lat, tour.pos!.long)));
|
point: LatLng(tour.pos!.lat, tour.pos!.long)));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.fromLTRB(30, 0, 30, 0),
|
padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
|
||||||
key: GlobalKey(),
|
key: GlobalKey(),
|
||||||
height: MediaQuery.of(context).size.height * 0.6,
|
height: MediaQuery.of(context).size.height * 0.6,
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 100,
|
height: 100,
|
||||||
|
width: MediaQuery.of(context).size.width * 1,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
@@ -180,5 +188,5 @@ showMapPopup(BuildContext context, JobTour currentTour, List<JobTour> tourList)
|
|||||||
),
|
),
|
||||||
));
|
));
|
||||||
}));
|
}));
|
||||||
});
|
});*/
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user