getStateStream method
Emits the current BluetoothState when the adapter state changes.
See BluetoothManagerAndroid.getStateStream, BluetoothManagerIOS.getStateStream and BluetoothManagerMacOS.getStateStream for details.
Implementation
Stream<BluetoothState> getStateStream({int timer = 1000}) async* {
if (Platform.isAndroid) {
yield* bmAndroid.getStateStream(timer: timer);
} else if (Platform.isIOS) {
yield* bmIOS.getStateStream(timer: timer);
} else if (Platform.isMacOS) {
yield* bmMacOS.getStateStream(timer: timer);
} else {
throw '[get_state_stream] platform_not_supported - only Android, iOS and macOS are supported';
}
}