Fehlerkorrekturen
This commit is contained in:
1 parent
b18a0c4526
commit
faef9ac5d9
3 files changed
+50
-43
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());
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
private void SendMessage(int columnNumber, string zipNumber)
|
||||
{
|
||||
var payloadObject = new JObject();
|
||||
_initMessages() {
|
||||
MessageService().subscribe<RankingUpdated>(Constants.messageTopicRankingUpdated, this, (rankingUpdateMessage) async {
|
||||
_ranking = await MyApp.isarInstance.rankings.where().findFirst();
|
||||
|
||||
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);
|
||||
}
|
||||
*/
|
||||
setState(() {});
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user