FlutterBluetoothSerial class
Properties
-
address
→ Future<
String?> -
Returns the hardware address of the local Bluetooth adapter.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
isAvailable
→ Future<
bool?> -
Checks is the Bluetooth interface avaliable on host device.
no setter
-
isConnected
→ Future<
bool> -
no setter
-
isDiscoverable
→ Future<
bool?> -
Describes is the local device in discoverable mode.
no setter
-
isDiscovering
→ Future<
bool?> -
Describes is the dicovery process of Bluetooth devices running.
no setter
-
isEnabled
→ Future<
bool?> -
Describes is the Bluetooth interface enabled on host device.
no setter
-
isOn
→ Future<
bool?> -
Checks is the Bluetooth interface enabled on host device.
no setter
-
name
→ Future<
String?> -
Returns the friendly Bluetooth name of the local Bluetooth adapter.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
state
→ Future<
BluetoothState> -
State of the Bluetooth adapter.
no setter
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> -
connectToAddress(
String? address) → Future< void> -
disconnect(
) → Future< void> -
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 nonexistent method or property is accessed.
inherited
-
onRead(
) → Stream< Uint8List> ? -
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.
-
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
BluetoothDiscoveryResult
s. -
toString(
) → String -
A string representation of this object.
inherited
-
write(
String message) → Future< void> -
writeBytes(
Uint8List message) → Future< void>
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → FlutterBluetoothSerial
-
no setter