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);
}),
);
}
}