FlutterBluetoothSerial class

Properties

address Future<String>
Returns the hardware address of the local Bluetooth adapter. [...]
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
isAvailable Future<bool>
Checks is the Bluetooth interface avaliable on host device.
read-only
isConnected Future<bool>
@Deprecated('Use `BluetoothConnection.isEnabled` instead'), read-only
isDiscoverable Future<bool>
Describes is the local device in discoverable mode.
read-only
isDiscovering Future<bool>
Describes is the dicovery process of Bluetooth devices running.
read-only
isEnabled Future<bool>
Describes is the Bluetooth interface enabled on host device.
read-only
isOn Future<bool>
Checks is the Bluetooth interface enabled on host device.
@Deprecated('Use `isEnabled` instead'), read-only
name Future<String>
Returns the friendly Bluetooth name of the local Bluetooth adapter. [...]
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
state Future<BluetoothState>
State of the Bluetooth adapter.
read-only

Methods

bondDeviceAtAddress(String address, {String pin, bool passkeyConfirm}) Future<bool>
Starts outgoing bonding (pairing) with device with given address. Returns true if bonded, false if canceled or failed gracefully. [...]
cancelDiscovery() Future<void>
Cancels the discovery
changeName(String name) Future<bool>
Sets the friendly Bluetooth name of the local Bluetooth adapter. [...]
connect(BluetoothDevice device) Future<void>
@Deprecated('Use `BluetoothConnection.toAddress(device.address)` instead')
connectToAddress(String address) Future<void>
@Deprecated('Use `BluetoothConnection.toAddress(address)` instead')
disconnect() Future<void>
@Deprecated('Use `BluetoothConnection.finish` or `BluetoothConnection.close` instead')
getBondedDevices() Future<List<BluetoothDevice>>
Returns list of bonded devices.
getBondStateForAddress(String address) Future<BluetoothBondState>
Checks bond state for given address (might be from system cache).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
onRead() Stream<Uint8List>
@Deprecated('Use `BluetoothConnection.input` instead')
onStateChanged() Stream<BluetoothState>
Allows monitoring the Bluetooth adapter state changes.
openSettings() Future<void>
Opens the Bluetooth platform system settings.
removeDeviceBondWithAddress(String address) Future<bool>
Removes bond with device with specified address. Returns true if unbonded, false if canceled or failed gracefully. [...]
requestDisable() Future<bool>
Tries to disable Bluetooth interface (if enabled).
requestDiscoverable(int durationInSeconds) Future<int>
Asks for discoverable mode (probably always prompt for user interaction in fact). Returns number of seconds acquired or zero if canceled or failed gracefully. [...]
requestDiscoverableNoPrompt(int durationInSeconds) Future<int>
requestEnable() Future<bool>
Tries to enable Bluetooth interface (if disabled). Probably results in asking user for confirmation.
setPairingRequestHandler(Future handler(BluetoothPairingRequest request)) → void
Allows listening and responsing for incoming pairing requests. [...]
startDiscovery() Stream<BluetoothDiscoveryResult>
Starts discovery and provides stream of BluetoothDiscoveryResults.
toString() String
Returns a string representation of this object.
inherited
write(String message) Future<void>
@Deprecated('Use `BluetoothConnection.output` with some decoding (such as `ascii.decode` for strings) instead')
writeBytes(Uint8List message) Future<void>
@Deprecated('Use `BluetoothConnection.output` instead')

Operators

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

Static Properties

instance FlutterBluetoothSerial
read-only

Constants

namespace → const String
'flutter_bluetooth_serial'