Ports
Generated reference for ovok_flutter: ports.
- Stable unknown
- Release candidate since 0.1.0-rc.4
- Development since 0.1.0-dev.27+7d4ccf0
BluetoothCancellation
class BluetoothCancellationCancels a pending peripheral connection or device driver.
Constructors
BluetoothCancellation.new
BluetoothCancellation()Properties
BluetoothCancellation.isCancelled
bool get isCancelledWhether cancellation has been requested.
BluetoothCancellation.whenCancelled
Future<void> get whenCancelledCompletes when cancellation is requested.
Methods
BluetoothCancellation.cancel
void cancel()Requests cancellation once.
Returns void.
BluetoothLink
abstract interface class BluetoothLinkAn open GATT connection that can read and write characteristics.
Methods
BluetoothLink.subscribe
Stream<List<int>> subscribe(String service, String characteristic)Listens to notifications or indications for one characteristic.
| Parameter | Type | Kind | Default |
|---|---|---|---|
service | String | positional | |
characteristic | String | positional |
Returns Stream<List<int>>.
BluetoothLink.write
Future<void> write(
String service,
String characteristic,
List<int> bytes,
)Writes bytes to a characteristic with response.
| Parameter | Type | Kind | Default |
|---|---|---|---|
service | String | positional | |
characteristic | String | positional | |
bytes | List<int> | positional |
Returns Future<void>.
BluetoothLink.close
Future<void> close()Cancels subscriptions and disconnects.
Returns Future<void>.
BluetoothPeripheral
abstract interface class BluetoothPeripheralA Bluetooth peripheral discovered by a BluetoothScanner.
Properties
BluetoothPeripheral.id
String get idThe platform identifier for this peripheral.
BluetoothPeripheral.advertisement
BluetoothAdvertisement get advertisementWhat this peripheral advertises.
Methods
BluetoothPeripheral.openLink
Future<BluetoothLink> openLink(BluetoothCancellation cancellation)Connects and discovers services, stopping if cancellation is requested.
| Parameter | Type | Kind | Default |
|---|---|---|---|
cancellation | BluetoothCancellation | positional |
Returns Future<BluetoothLink>.
BluetoothPermissions
abstract interface class BluetoothPermissionsBluetooth permission checks and system prompts.
Methods
BluetoothPermissions.check
Future<BluetoothPermission> check()Reads the current permission without prompting.
Returns Future<BluetoothPermission>.
BluetoothPermissions.request
Future<BluetoothPermission> request()Prompts for Bluetooth permission when the operating system permits it.
Returns Future<BluetoothPermission>.
BluetoothPermissions.openSettings
Future<void> openSettings()Opens the app's system settings.
Returns Future<void>.
BluetoothReadingSink
abstract interface class BluetoothReadingSinkStores measurements reported by Bluetooth devices.
Methods
BluetoothReadingSink.save
Future<BluetoothSaveResult> save(BluetoothDeviceReading reading)Saves a reading or queues it for an offline retry.
| Parameter | Type | Kind | Default |
|---|---|---|---|
reading | BluetoothDeviceReading | positional |
Returns Future<BluetoothSaveResult>.
BluetoothReadingSink.flushQueued
Future<List<String>> flushQueued()Retries queued readings and returns the IDs that were saved.
Returns Future<List<String>>.
BluetoothSaveResult
class BluetoothSaveResultA completed measurement save.
Constructors
BluetoothSaveResult.saved
BluetoothSaveResult.saved()Creates a saved result.
BluetoothSaveResult.queued
BluetoothSaveResult.queued(String queueId)Creates an offline queued result.
| Parameter | Type | Kind | Default |
|---|---|---|---|
queueId | String | positional |
Properties
BluetoothSaveResult.status
final BluetoothSaveStatus statusThe save outcome.
BluetoothSaveResult.queueId
final String? queueIdThe offline queue ID when queued.
BluetoothScanner
abstract interface class BluetoothScannerThe platform adapter's state and scan stream.
Properties
BluetoothScanner.state
BluetoothAdapterState get stateThe adapter's current state.
BluetoothScanner.stateChanges
Stream<BluetoothAdapterState> get stateChangesAdapter state changes, including the first state when the stream is listened to.
Methods
BluetoothScanner.scan
Stream<BluetoothPeripheral> scan()Scans until the listener cancels or an error occurs.
Returns Stream<BluetoothPeripheral>.
Last updated on