CentralMethodChannel class

An implementation of CentralPlatformInterface that uses method channels.

Inheritance

Constructors

CentralMethodChannel()

Properties

channel → MethodChannel
The method channel used to interact with the native platform.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

checkBluetoothAdapterStatus() → Future<BluetoothStatus>
Checks the status of the Bluetooth adapter on the device.
override
connect({required String deviceAddress}) → Future<Stream<BleConnectionState>>
Initiates a connection to a BLE peripheral and returns a Stream representing the connection state.
override
disconnect(String deviceAddress) → Future<void>
Asynchronously terminates the connection between the host mobile device and a Bluetooth Low Energy (BLE) peripheral.
override
discoverServices(String deviceAddress) → Future<Stream<List<BleService>>>
Initiates the service discovery process for a connected Bluetooth Low Energy (BLE) device and returns a Stream of discovered services and their characteristics.
override
emitCurrentBluetoothStatus() → Future<Stream<BluetoothStatus>>
Emits the current Bluetooth adapter status to the Dart side.
override
emitCurrentPermissionStatus() → Future<Stream<BluetoothPermissionStatus>>
Emits the current Bluetooth permission status to the Dart side.
override
getConnectedDevices(List<String> serviceUUIDs) → Future<List<ConnectedBleDevice>>
Gets a list of identifiers for all connected devices.
override
getCurrentConnectionState(String deviceAddress) → Future<BleConnectionState>
Fetches the current connection state of a Bluetooth Low Energy (BLE) device.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readCharacteristic({required BleCharacteristic characteristic, required Duration timeout}) → Future<BleCharacteristicValue>
Reads the value of a specified Bluetooth characteristic.
override
requestBluetoothPermissions() → Future<BluetoothPermissionStatus>
Requests Bluetooth permissions from the user.
override
startScan({List<ScanFilter>? filters, ScanSettings? settings}) → Future<Stream<BleDevice>>
Starts a scan for nearby Bluetooth Low Energy (BLE) devices and returns a stream of discovered devices.
override
stopScan() → Future<void>
Stops an ongoing Bluetooth scan and handles any potential errors.
override
subscribeToCharacteristic(BleCharacteristic characteristic) → Future<Stream<BleCharacteristicValue>>
Subscribes to a Bluetooth characteristic to listen for updates.
override
toString() → String
A string representation of this object.
inherited
unsubscribeFromCharacteristic(BleCharacteristic characteristic) → Future<void>
Unsubscribes from a Bluetooth characteristic.
override
writeCharacteristic({required BleCharacteristic characteristic, required String value, int? writeType}) → Future<void>
Asynchronously writes data to a specified Bluetooth Low Energy (BLE) characteristic.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited