chipweinberger / flutter_blue_plus

Flutter plugin for connecting and communicationg with Bluetooth Low Energy devices, on Android, iOS, macOS
Other
788 stars 478 forks source link

[Help]: Regarding the issue of global monitoring of Bluetooth status navigation page? #1058

Closed xhc-code closed 1 week ago

xhc-code commented 1 week ago

Requirements

Have you checked this problem on the example app?

Yes

FlutterBluePlus Version

flutter_blue_plus: ^1.34.4

Flutter Version

Flutter 3.24.3 • channel stable

What OS?

Android

OS Version

Android 14

Bluetooth Module

Bluetooth 4.0 version

What is your problem?

How to continuously monitor the status of Bluetooth at the global level using the Flutter framework? No matter which page you are on, when you hear that Bluetooth is turned off, you will directly jump to the page where Bluetooth is turned off. Can this be achieved? If the current BuildContext instance is not obtained, there is no way to navigate. The navigatorKey property of MaterialApp cannot be used because the onGeneratedRoute property is not used. Is there any other way to achieve this requirement?

The example program only monitors the Bluetooth status on a single page, listening on the Bluetooth Adapter State Observer, which does not meet my requirements.

Logs

not have
chipweinberger commented 1 week ago

Yes its possible. But this is a flutter problem. Not a bluetooth problem.

I'm not good enough with flutter to give advice on this. Good luck.