Skip to content

Commit 8bc647c

Browse files
committed
Casting to bool for isAvailable/isOn. Fixes #122
1 parent 1300f23 commit 8bc647c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/src/flutter_blue.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ class FlutterBlue {
3030
static FlutterBlue get instance => _instance;
3131

3232
/// Checks whether the device supports Bluetooth
33-
Future<bool> get isAvailable => _channel.invokeMethod('isAvailable');
33+
Future<bool> get isAvailable =>
34+
_channel.invokeMethod('isAvailable').then<bool>((d) => d);
3435

3536
/// Checks if Bluetooth functionality is turned on
36-
Future<bool> get isOn => _channel.invokeMethod('isOn');
37+
Future<bool> get isOn => _channel.invokeMethod('isOn').then<bool>((d) => d);
3738

3839
/// Gets the current state of the Bluetooth module
3940
Future<BluetoothState> get state {

0 commit comments

Comments
 (0)