Fehlerkorrekturen und Erweiterungen

This commit is contained in:
Sven committed 2025-08-20 10:56:41 +02:00
1 parent b3d010b453
commit 52415e0759
18 files changed
+136 -128

No files matched your search

+14 -12
View File
@@ -43,11 +43,14 @@ class _MainPageState extends State<MainPage> with ConsumerMixin, ProducerMixin {
final ValueNotifier<int> _messagesValueNotifier = ValueNotifier<int>(0);
late bool _loggedOut = false;
late bool _showBWVButton = false;
@override
void initState() {
super.initState();
_showBWVButton = Util.preferencesGetBool(Constants.prefsBWVEnabled, false);
_refreshBadges();
_initMessages();
@@ -212,17 +215,15 @@ class _MainPageState extends State<MainPage> with ConsumerMixin, ProducerMixin {
'Anfahrtsbereich',
image: Image.asset('assets/anfahrtsbereich.png', width: 30, height: 30),
() async => {
// TODO MESSAGING
sendMessage(
routingKey: Constants.messageTopicPushContentView,
payload: const ApproachAreaPage(),
)
//await MessageService().publish<ContentViewWidget>(Constants.messageTopicPushContentView, arguments: const ApproachAreaPage())
}),
),
SizedBox(height: _loggedOut == true ? 0 : 20),
Visibility(
visible: !_loggedOut && Util.preferencesGetBool(Constants.prefsBWVEnabled, false),
visible: !_loggedOut && _showBWVButton,
child: getDefaultButton(
'Wunschziel für heute',
image: Image.asset('assets/wunsch_plz.png', width: 30, height: 30),
@@ -296,6 +297,15 @@ class _MainPageState extends State<MainPage> with ConsumerMixin, ProducerMixin {
_refreshBadges();
},
);
subscribe(
queueId: Constants.messageTopicBWVEnabled,
callback: (message) {
setState(() {
_showBWVButton = Util.preferencesGetBool(Constants.prefsBWVEnabled, false);
});
}
);
}
void _refreshBadges() async {
@@ -319,7 +329,7 @@ class _MainPageState extends State<MainPage> with ConsumerMixin, ProducerMixin {
_loggedOut = false;
setState(() {});
setState(() { });
}
}
@@ -577,20 +587,12 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ConsumerMixin {
},
);
/*MessageService().subscribe<SessionStatusInfoUpdate>(Constants.messageTopicSessionStatusInfoUpdate, this, (sessionStatusInfoUpdateMessage) {
_updateHeader();
});*/
subscribe(
queueId: Constants.messageTopicLocationStatusUpdated,
callback: (message) {
_updateHeader();
},
);
/*MessageService().subscribe<LocationStatusUpdate>(Constants.messageTopicLocationStatusUpdated, this, (statusInfoUpdateMessage) {
_updateHeader();
});*/
}
_updateHeader() async {