MethodChannelFlutterClassicBluetooth class Platform

An implementation of FlutterClassicBluetoothPlatform that uses method channels and event channels to communicate with native code.

Inheritance

Properties

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

Methods

adapterState() Stream<BtcAdapterState>
Returns the current adapter state as a stream that emits on changes.
override
bondDevice(String address) Future<bool>
Initiates pairing with the device at address.
override
bondState(String address) Stream<BtcBondState>
Stream of bond state changes for a specific device.
override
checkPermissions(Set<BtcPermission> permissions) Future<BtcPermissionStatus>
Returns the status of permissions without prompting.
override
connect({required String address, String uuid = BtcUuid.spp, bool secure = true}) Future<BtcConnection>
Connects to the device at address using the given uuid.
override
disableBluetooth() Future<bool>
Requests the system to disable the Bluetooth adapter.
override
disconnect(int id) Future<void>
Disconnects the connection with the given id.
override
discoveryResults() Stream<BtcDevice>
Stream of devices found during discovery.
override
discoveryState() Stream<bool>
Stream that emits true when discovery starts and false when it stops.
override
enableBluetooth() Future<bool>
Requests the system to enable the Bluetooth adapter.
override
getAdapterAddress() Future<String?>
Returns the local adapter's hardware address.
override
getAdapterName() Future<String?>
Returns the local adapter's friendly name.
override
getPairedDevices() Future<List<BtcDevice>>
Returns the list of currently paired/bonded devices.
override
getPlatformCapabilities() Future<BtcPlatformCapabilities>
Returns the platform capabilities for Bluetooth Classic.
override
isDiscovering() Future<bool>
Returns whether a discovery scan is currently in progress.
override
isEnabled() Future<bool>
Returns whether the Bluetooth adapter is currently enabled.
override
isLocationServiceEnabled() Future<bool>
Whether the system location toggle is currently on.
override
isLocationServiceRequired() Future<bool>
Whether scanning on this platform also needs the system location toggle.
override
isSupported() Future<bool>
Returns whether Bluetooth Classic is supported on this device.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openAppSettings() Future<bool>
Opens this app's system settings page.
override
openLocationSettings() Future<bool>
Opens the system location settings screen.
override
requestPermissions(Set<BtcPermission> permissions) Future<BtcPermissionStatus>
Requests permissions and returns the status afterwards.
override
setDiscoverable(int durationSeconds) Future<bool>
Makes the local device discoverable for durationSeconds.
override
startDiscovery() Future<void>
Starts discovering nearby Bluetooth Classic devices.
override
startServer({required String serviceName, String uuid = BtcUuid.spp, bool secure = true}) Future<BtcServerSocket>
Creates an RFCOMM server socket listening on the given uuid.
override
stopDiscovery() Future<void>
Stops an ongoing device discovery.
override
stopServer(int id) Future<void>
Stops the server with the given id.
override
toString() String
A string representation of this object.
inherited
unbondDevice(String address) Future<bool>
Removes the bond with the device at address.
override
write(int id, Uint8List data) Future<void>
Writes data to the connection with the given id.
override

Operators

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