0

I would like to find and connect bluetooth devie on background isolate without any diplay. I develop app using flutter dart. I found a good example using flutter_blue 0.7.3 that starts with the following widget. How can I do this part in background, especially

StreamBuilder<BluetoothState> ? 

Thanks

--link to example https://pub.dev/packages/flutter_blue/example

---widget

class FlutterBlueApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      color: Colors.lightBlue,
      home: StreamBuilder<BluetoothState>(
          stream: FlutterBlue.instance.state,
          initialData: BluetoothState.unknown,
          builder: (c, snapshot) {
            final state = snapshot.data;
            if (state == BluetoothState.on) {
              return FindDevicesScreen();
            }
            return BluetoothOffScreen(state: state);
          }),
    );
  }
}
Kobi
  • 127
  • 1
  • 11

1 Answers1

1

i decided to connect to using displayed widgets and check the messages i a timer and display status using providerq in the main page

Kobi
  • 127
  • 1
  • 11