FlutterBleLib icon indicating copy to clipboard operation
FlutterBleLib copied to clipboard

Change ScanResult#isConnectable from nullable boolean to non-nullable enum

Open mikolak opened this issue 4 years ago • 1 comments

https://github.com/Polidea/FlutterBleLib/pull/586#discussion_r610065825

Connectivity with 3 states: Connectivity.noInfo (or notAvailable?), Connectivity.notConnectable, Connectivity.Connectable

mikolak avatar Apr 09 '21 12:04 mikolak

Right now it's Bool? isConnectable so ternarily [null, false, true] it's nullable because it's only available on iOS host OS, on android it is still connectable so null very importantly does not mean false at all! Therefore I'd also recommend using a less misleading representation being the enum Connectivity [ .notAvailable| .unsupported, . notConnectable, .connectable] correspondingly mapping to the Bool? values above.

okocsis avatar Apr 12 '21 07:04 okocsis