dotintent / FlutterBleLib

Bluetooth Low Energy library for Flutter with support for simulating peripherals
Apache License 2.0
531 stars 195 forks source link

Adding Stream<bool> isScanning method? #536

Open ElHyperion opened 3 years ago

ElHyperion commented 3 years ago

I need to keep track of the scanning status and I believe that adding methods such as Future<bool> getScanningState() and Stream<bool> observeScanningState() would help me and several other users of this library aswell. The flutter_blue library for example has a similar method (Stream<bool> get isScanning).

I still haven't been able to figure out how to properly wrap a Stream around the scanning state, which would also return the current value automatically when listening to it, and adding such methods to the library could ease the pain a lot, and I believe others would welcome it aswell.