Fehlerkorrekturen und Erweiterungen

This commit is contained in:
Sven committed 2025-09-02 11:12:02 +02:00
1 parent 19b5b255ef
commit a16a8fcf28
18 files changed
+88 -239

No files matched your search

+14 -2
View File
@@ -42,12 +42,22 @@ class _ApproachAreaPageState extends State<ApproachAreaPage> with ProducerMixin,
_initCompleted = true;
setState(() {});
if (mounted) {
setState(() {});
}
});
_initMessages();
}
@override
void dispose() {
// Unsubscribe from all message topics
unsubscribe(queueId: Constants.messageTopicRankingUpdated);
super.dispose();
}
@override
Widget build(BuildContext context) {
if (!_initCompleted) {
@@ -204,7 +214,9 @@ class _ApproachAreaPageState extends State<ApproachAreaPage> with ProducerMixin,
callback: (message) async {
_ranking = await MyApp.isarInstance.rankings.where().findFirst();
setState(() {});
if (mounted) {
setState(() {});
}
},
);
}
+11 -1
View File
@@ -54,6 +54,14 @@ class _AssignedJobsPageState extends State<AssignedJobsPage> with ProducerMixin,
super.initState();
}
@override
void dispose() {
// Unsubscribe from all message topics
unsubscribe(queueId: Constants.messageTopicJobReceived);
super.dispose();
}
@override
Widget build(BuildContext context) {
if (!_initCompleted) {
@@ -254,7 +262,9 @@ class _AssignedJobsPageState extends State<AssignedJobsPage> with ProducerMixin,
if (job.state == Constants.stateAssigned) {
_jobs.add(job);
setState(() {});
if (mounted) {
setState(() {});
}
}
},
+29 -6
View File
@@ -58,6 +58,14 @@ class _MainPageState extends State<MainPage> with ConsumerMixin, ProducerMixin {
@override
void dispose() {
// Unsubscribe from all message topics
unsubscribe(queueId: Constants.messageTopicRemoveJob);
unsubscribe(queueId: Constants.messageTopicJobReceived);
unsubscribe(queueId: Constants.messageTopicMessageReceived);
unsubscribe(queueId: Constants.messageTopicJobDeleted);
unsubscribe(queueId: Constants.messageTopicUpdateBadges);
unsubscribe(queueId: Constants.messageTopicBWVEnabled);
super.dispose();
}
@@ -304,10 +312,12 @@ class _MainPageState extends State<MainPage> with ConsumerMixin, ProducerMixin {
subscribe(
queueId: Constants.messageTopicBWVEnabled,
callback: (message) {
setState(() {
_showBWVButton =
Util.preferencesGetBool(Constants.prefsBWVEnabled, false);
});
if (mounted) {
setState(() {
_showBWVButton =
Util.preferencesGetBool(Constants.prefsBWVEnabled, false);
});
}
});
}
@@ -337,7 +347,9 @@ class _MainPageState extends State<MainPage> with ConsumerMixin, ProducerMixin {
_loggedOut = false;
setState(() {});
if (mounted) {
setState(() {});
}
}
}
@@ -368,7 +380,9 @@ class _MainPageState extends State<MainPage> with ConsumerMixin, ProducerMixin {
Navigator.of(MyApp.appNavigatorKey.currentContext!).pop();
setState(() {});
if (mounted) {
setState(() {});
}
});
});
},
@@ -441,6 +455,15 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ConsumerMixin {
_initMessages();
}
@override
void dispose() {
// Unsubscribe from all message topics
unsubscribe(queueId: Constants.messageTopicSessionStatusInfoUpdate);
unsubscribe(queueId: Constants.messageTopicLocationStatusUpdated);
super.dispose();
}
@override
Widget build(BuildContext context) {
var cellWidth = (MediaQuery.of(context).size.width - 60 - 60 - 25) / 2;
+3 -1
View File
@@ -58,7 +58,9 @@ class _MessagesPageState extends State<MessagesPage> with ProducerMixin {
_initCompleted = true;
setState(() {});
if (mounted) {
setState(() {});
}
});
}
+4 -1
View File
@@ -64,7 +64,9 @@ class _TaskListPageState extends State<TaskListPage> with ProducerMixin {
_initCompleted = true;
setState(() {});
if (mounted) {
setState(() {});
}
});
super.initState();
@@ -468,6 +470,7 @@ class _TaskListPageState extends State<TaskListPage> with ProducerMixin {
var position = await MyApp.getCurrentPosition();
if (position != null) {
message.task.pos = FinTaskPos();
message.task.pos!.time = DateTime.now().toIso8601String();
message.task.pos!.lat = position.latitude;
message.task.pos!.long = position.longitude;
} else {
+16 -2
View File
@@ -224,6 +224,16 @@ class _MainState extends State<Main> with SingleTickerProviderStateMixin, Produc
void dispose() {
_animationController?.dispose();
// Unsubscribe from all message topics
unsubscribe(queueId: Constants.messageTopicPushContentView);
unsubscribe(queueId: Constants.messageTopicPopContentView);
unsubscribe(queueId: Constants.messageTopicReplaceContentView);
unsubscribe(queueId: Constants.messageTopicConnectionStatusChanged);
unsubscribe(queueId: Constants.messageTopicRemoveJob);
unsubscribe(queueId: Constants.messageTopicJobReceived);
unsubscribe(queueId: Constants.messageTopicJobDeleted);
unsubscribe(queueId: Constants.messageTopicRemoveState0JobFromMap);
super.dispose();
}
@@ -249,7 +259,9 @@ class _MainState extends State<Main> with SingleTickerProviderStateMixin, Produc
_initCompleted = true;
setState(() {});
if (mounted) {
setState(() {});
}
});
}
@@ -451,7 +463,9 @@ class _MainState extends State<Main> with SingleTickerProviderStateMixin, Produc
_currentTitleWidget = await _currentContent.getHeaderWidget(context);
setState(() {});
if (mounted) {
setState(() {});
}
});
}
@@ -47,6 +47,8 @@ class Task {
@embedded
@JsonSerializable()
class FinTaskPos {
late String time;
late double lat;
late double long;
@@ -46,6 +46,8 @@ class SyncJobMessageJob {
@JsonSerializable()
class SyncMessagePos {
late String time;
late double lat;
late double long;
+6 -2
View File
@@ -198,7 +198,9 @@ Future<List<Widget>> _fetchJobWidgets(StateSetter dialogState, Function() onFini
payload: RemoveJobMessage(id: job.id),
);
setState(() {});
if (mounted) {
setState(() {});
}
});
}),
),
@@ -215,7 +217,9 @@ Future<List<Widget>> _fetchJobWidgets(StateSetter dialogState, Function() onFini
payload: RemoveJobMessage(id: job.id),
);
setState(() {});
if (mounted) {
setState(() {});
}
});
}),
)
+1
View File
@@ -590,6 +590,7 @@ class MqttCore with ProducerMixin, ConsumerMixin {
answer.utcUnixTime = DateTime.now().toUtc().millisecondsSinceEpoch ~/ 1000;
answer.pos = SyncMessagePos();
answer.pos!.time = DateTime.now().toUtc().toIso8601String();
answer.pos!.lat = currentPosition != null ? currentPosition.latitude : 0.0;
answer.pos!.long = currentPosition != null ? currentPosition.longitude : 0.0;
answer.pos!.acc = currentPosition != null ? currentPosition.accuracy.toInt() : 0;