flutter_blue icon indicating copy to clipboard operation
flutter_blue copied to clipboard

Fixing problem when canceling the scan subscription.

Open andretietz opened this issue 5 years ago • 1 comments

When canceling a scan subscription, the scanner is not stopped. This causes a second scan to fail. When calling stopScan on doOnCancel, it works as expected and stoppes the scan.

Due to the documentation of this method they're covering 2 different scenarios. https://pub.dev/documentation/rxdart/latest/rx/Observable/doOnDone.html https://pub.dev/documentation/rxdart/latest/rx/Observable/doOnCancel.html

If you take the doOnDone example, subscribe to it and cancel the subscription, the text won't be shown. this is the reason why for the scan method both options should lead to stopScan

andretietz avatar Aug 27 '19 15:08 andretietz