We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f3daf21 commit ab3c7f1Copy full SHA for ab3c7f1
lib/src/flutter_blue.dart
@@ -96,11 +96,14 @@ class FlutterBlue {
96
/// Returns a stream of [BluetoothDeviceState]
97
/// Timeout closes the stream after a specified [Duration]
98
/// To cancel connection to device, simply cancel() the stream subscription
99
- Stream<BluetoothDeviceState> connect(BluetoothDevice device,
100
- {Duration timeout}) async* {
+ Stream<BluetoothDeviceState> connect(
+ BluetoothDevice device, {
101
+ Duration timeout,
102
+ bool autoConnect = true,
103
+ }) async* {
104
var request = protos.ConnectRequest.create()
105
..remoteId = device.id.toString()
- ..androidAutoConnect = true;
106
+ ..androidAutoConnect = autoConnect;
107
var connected = false;
108
StreamSubscription subscription;
109
StreamController controller;
0 commit comments