MethodChannelBluetoothConnectionPlugin class
An implementation of BluetoothConnectionPluginPlatform that uses method channels.
- Inheritance
-
- Object
- PlatformInterface
- BluetoothConnectionPluginPlatform
- MethodChannelBluetoothConnectionPlugin
Constructors
Properties
-
classicConnectionEvents
→ Stream<
ClassicConnectionEvent> -
Stream of Classic Bluetooth connection events
no setteroverride
-
classicDataEvents
→ Stream<
ClassicDataEvent> -
Stream of Classic Bluetooth data events
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- methodChannel → MethodChannel
-
The method channel used to interact with the native platform.
final
-
onDataReceived
→ Stream<
DataEvent> -
Stream of received data from BLE device
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
connect(
String deviceAddress) → Stream< ConnectionEvent> -
Connect to a BLE device
Returns a stream of connection events
override
-
connectToDevice(
String deviceAddress) → Future< Map< String, dynamic> > -
Connect to a Bluetooth device by address
override
-
disconnect(
) → Future< void> -
Disconnect from current BLE device
override
-
disconnectDevice(
) → Future< Map< String, dynamic> > -
Disconnect from the current device
override
-
getBleConnectionState(
) → Future< ConnectionState> -
Get current BLE connection state
override
-
getConnectedDevice(
) → Future< String?> -
Get currently connected BLE device address
override
-
getConnectionState(
) → Future< Map< String, dynamic> > -
Get detailed connection state
override
-
getPairedDevices(
) → Future< List< Map< >String, dynamic> > -
Get a list of paired Bluetooth devices
override
-
getPlatformVersion(
) → Future< String?> -
override
-
hasPermissions(
) → Future< bool> -
Check if required BLE permissions are granted
override
-
isBluetoothEnabled(
) → Future< bool> -
Check if Bluetooth is enabled
override
-
isConnected(
) → Future< bool> -
Check if a device is currently connected
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readData(
) → Future< Map< String, dynamic> > -
Read data from the connected device
override
-
requestPermissions(
) → Future< bool> -
Request required BLE permissions
override
-
sendBleData(
String data) → Future< bool> -
Send data to connected BLE device
override
-
sendData(
String data) → Future< Map< String, dynamic> > -
Send data to the connected device
override
-
startDataStreaming(
) → Future< Map< String, dynamic> > -
Start continuous data streaming
override
-
startScan(
{Duration? timeout, List< String> ? serviceUuids}) → Stream<ScanEvent> -
Start scanning for BLE devices
Returns a stream of discovered devices
override
-
stopDataStreaming(
) → Future< Map< String, dynamic> > -
Stop continuous data streaming
override
-
stopScan(
) → Future< void> -
Stop scanning for BLE devices
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited