Fehlerkorrekturen
This commit is contained in:
1 parent
b18a0c4526
commit
faef9ac5d9
3 files changed
+51
-44
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/popups/tasks_popups/zip_popup.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 '../main.dart';
|
||||
@@ -47,6 +50,8 @@ class _ApproachAreaPageState extends State<ApproachAreaPage> {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
Future.delayed(const Duration(seconds: 0), () async {
|
||||
_ranking = await MyApp.isarInstance.rankings.where().findFirst();
|
||||
|
||||
@@ -55,7 +60,14 @@ class _ApproachAreaPageState extends State<ApproachAreaPage> {
|
||||
setState(() {});
|
||||
});
|
||||
|
||||
super.initState();
|
||||
_initMessages();
|
||||
}
|
||||
|
||||
@override
|
||||
void deactivate() {
|
||||
super.deactivate();
|
||||
|
||||
MessageService().unsubscribe(Constants.messageTopicRankingUpdated, this);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -101,7 +113,7 @@ class _ApproachAreaPageState extends State<ApproachAreaPage> {
|
||||
margin: const EdgeInsets.all(2),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: i == 0 ? Colors.lightGreen : Colors.white,
|
||||
color: i == 0 ? Constants.colorPrimary : Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 0.5,
|
||||
@@ -112,10 +124,11 @@ class _ApproachAreaPageState extends State<ApproachAreaPage> {
|
||||
child: Column(children: [
|
||||
Text(
|
||||
rank.zip,
|
||||
style: const TextStyle(fontSize: 20),
|
||||
style: TextStyle(fontSize: 20, color: (i == 0 ? Colors.white : Colors.black)),
|
||||
),
|
||||
Text(
|
||||
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),
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
mapVehicleTypeToText(vehicle.type)
|
||||
mapVehicleTypeToText(vehicle.type),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -190,32 +203,12 @@ class _ApproachAreaPageState extends State<ApproachAreaPage> {
|
||||
|
||||
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();
|
||||
for (var job in jobs) {
|
||||
String remarkString = '';
|
||||
for (var remark in job.rem) {
|
||||
remarkString += '$remark\n';
|
||||
}
|
||||
remarkString = remarkString.trim();
|
||||
|
||||
entries.add(ExpandableNotifier(
|
||||
child: ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
||||
@@ -140,7 +146,7 @@ class _AssignedJobsPageState extends State<AssignedJobsPage> {
|
||||
)),
|
||||
collapsed: const SizedBox(),
|
||||
expanded: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
height: 200,
|
||||
@@ -152,7 +158,7 @@ class _AssignedJobsPageState extends State<AssignedJobsPage> {
|
||||
width: 0.5,
|
||||
),
|
||||
),
|
||||
child: const Text('asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd '),
|
||||
child: Text(remarkString),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
+18
-10
@@ -4,11 +4,12 @@ import 'package:animated_toggle_switch/animated_toggle_switch.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map/flutter_map.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:stadtbote/tools/util.dart';
|
||||
|
||||
import '../model/job_tour.dart';
|
||||
|
||||
showMapPopup(BuildContext context, JobTour currentTour, List<JobTour> tourList) async {
|
||||
await showDialog(
|
||||
/*await showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
@@ -27,12 +28,16 @@ showMapPopup(BuildContext context, JobTour currentTour, List<JobTour> tourList)
|
||||
tourWidgets.add(
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
mapController.move(LatLng(tour.pos!.lat, tour.pos!.long), mapController.zoom);
|
||||
if (tour.pos != null) {
|
||||
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);
|
||||
currentTour = tour;
|
||||
streamController[tour.sort]!.sink.add(true);
|
||||
} else {
|
||||
showAlertDialog(context, 'Information', 'Es liegt keine Position für diese Station vor');
|
||||
}
|
||||
},
|
||||
child: SizedBox(
|
||||
width: 70,
|
||||
@@ -87,17 +92,20 @@ showMapPopup(BuildContext context, JobTour currentTour, List<JobTour> tourList)
|
||||
|
||||
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)));
|
||||
if (tour.pos != null) {
|
||||
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),
|
||||
padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
|
||||
key: GlobalKey(),
|
||||
height: MediaQuery.of(context).size.height * 0.6,
|
||||
child: Container(
|
||||
height: 100,
|
||||
width: MediaQuery.of(context).size.width * 1,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: Colors.white,
|
||||
@@ -180,5 +188,5 @@ showMapPopup(BuildContext context, JobTour currentTour, List<JobTour> tourList)
|
||||
),
|
||||
));
|
||||
}));
|
||||
});
|
||||
});*/
|
||||
}
|
||||
Reference in new issue
Block a user