chipweinberger/flutter_blue_plus

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

Closed this issue · 1 comments

Requirements

  • I've looked at the README 'Common Problems' section

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

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.