Models
Generated reference for ovok_flutter: models.
- Stable unknown
- Release candidate since 0.1.0-rc.4
- Development since 0.1.0-dev.27+7d4ccf0
BluetoothAdapterState
enum BluetoothAdapterStateThe state of the device's Bluetooth adapter.
Values
BluetoothAdapterState.unknown
static const BluetoothAdapterState unknownThe platform has not reported its adapter state yet.
BluetoothAdapterState.on
static const BluetoothAdapterState onBluetooth is ready for use.
BluetoothAdapterState.off
static const BluetoothAdapterState offBluetooth is turned off.
BluetoothAdapterState.unauthorized
static const BluetoothAdapterState unauthorizedThe app is not authorized to use Bluetooth.
BluetoothAdapterState.unsupported
static const BluetoothAdapterState unsupportedThis device does not support Bluetooth LE.
BluetoothAdvertisement
class BluetoothAdvertisementWhat a peripheral advertised during scanning.
Constructors
BluetoothAdvertisement.new
BluetoothAdvertisement({
required String name,
required Iterable<String> serviceUuids,
String? manufacturerData,
})Creates an advertisement snapshot.
| Parameter | Type | Kind | Default |
|---|---|---|---|
name | String | required named | |
serviceUuids | Iterable<String> | required named | |
manufacturerData | String? | named |
Properties
BluetoothAdvertisement.name
final String nameThe advertised name, or an empty string when unavailable.
BluetoothAdvertisement.serviceUuids
final List<String> serviceUuidsThe advertised service UUIDs.
BluetoothAdvertisement.manufacturerData
final String? manufacturerDataThe base64 encoded manufacturer data, or null when absent.
BluetoothConnectionState
enum BluetoothConnectionStateThe state of a supported nearby device.
Values
BluetoothConnectionState.idle
static const BluetoothConnectionState idleThe device has not started connecting.
BluetoothConnectionState.connecting
static const BluetoothConnectionState connectingThe runtime is opening the device connection.
BluetoothConnectionState.connected
static const BluetoothConnectionState connectedThe device connection is open.
BluetoothConnectionState.measuring
static const BluetoothConnectionState measuringThe device is sending measurements.
BluetoothConnectionState.disconnected
static const BluetoothConnectionState disconnectedThe device connection is closed.
BluetoothConnectionState.failed
static const BluetoothConnectionState failedThe device connection failed.
BluetoothDeviceReading
class BluetoothDeviceReadingA measurement reported by a supported Bluetooth device.
Constructors
BluetoothDeviceReading.new
BluetoothDeviceReading({
required String id,
required BluetoothReadingDevice device,
required JsonMap measurement,
required DateTime receivedAt,
required BluetoothSaveState save,
})Creates a device reading snapshot.
| Parameter | Type | Kind | Default |
|---|---|---|---|
id | String | required named | |
device | BluetoothReadingDevice | required named | |
measurement | JsonMap | required named | |
receivedAt | DateTime | required named | |
save | BluetoothSaveState | required named |
Properties
BluetoothDeviceReading.id
final String idA reading ID; timestamped readings use the same ID when resent.
BluetoothDeviceReading.device
final BluetoothReadingDevice deviceThe device that produced the reading.
BluetoothDeviceReading.measurement
final JsonMap measurementThe decoded Ovok measurement.
BluetoothDeviceReading.receivedAt
final DateTime receivedAtWhen this app received the reading.
BluetoothDeviceReading.save
final BluetoothSaveState saveWhether the measurement was saved.
Methods
BluetoothDeviceReading.copyWith
BluetoothDeviceReading copyWith({required BluetoothSaveState save})Returns a copy with the supplied save state.
| Parameter | Type | Kind | Default |
|---|---|---|---|
save | BluetoothSaveState | required named |
Returns BluetoothDeviceReading.
BluetoothNearbyDevice
class BluetoothNearbyDeviceA supported peripheral discovered by a scan.
Constructors
BluetoothNearbyDevice.new
BluetoothNearbyDevice({
required String id,
required String key,
required String name,
required BluetoothConnectionState connection,
BluetoothError? error,
})Creates a nearby device snapshot.
| Parameter | Type | Kind | Default |
|---|---|---|---|
id | String | required named | |
key | String | required named | |
name | String | required named | |
connection | BluetoothConnectionState | required named | |
error | BluetoothError? | named |
Properties
BluetoothNearbyDevice.id
final String idThe platform identifier for the peripheral.
BluetoothNearbyDevice.key
final String keyThe device key reported with its readings.
BluetoothNearbyDevice.name
final String nameThe name from its advertisement.
BluetoothNearbyDevice.connection
final BluetoothConnectionState connectionThe current connection state.
BluetoothNearbyDevice.error
final BluetoothError? errorThe last connection error, when one occurred.
Methods
BluetoothNearbyDevice.copyWith
BluetoothNearbyDevice copyWith({
String? name,
BluetoothConnectionState? connection,
BluetoothError? error,
bool clearError = false,
})Returns a copy with the supplied fields changed.
| Parameter | Type | Kind | Default |
|---|---|---|---|
name | String? | named | |
connection | BluetoothConnectionState? | named | |
error | BluetoothError? | named | |
clearError | bool | named | false |
Returns BluetoothNearbyDevice.
BluetoothPermission
enum BluetoothPermissionThe app's Bluetooth permission state.
Values
BluetoothPermission.unknown
static const BluetoothPermission unknownThe runtime has not checked permission yet.
BluetoothPermission.granted
static const BluetoothPermission grantedBluetooth access is permitted.
BluetoothPermission.denied
static const BluetoothPermission deniedThe user can still be asked for access.
BluetoothPermission.blocked
static const BluetoothPermission blockedOnly system settings can grant access.
BluetoothReadingDevice
class BluetoothReadingDeviceThe identity of the device that produced a reading.
Constructors
BluetoothReadingDevice.new
BluetoothReadingDevice({
required String id,
required String key,
required String name,
})Creates a device identity for a reading.
| Parameter | Type | Kind | Default |
|---|---|---|---|
id | String | required named | |
key | String | required named | |
name | String | required named |
Properties
BluetoothReadingDevice.id
final String idThe platform identifier for the peripheral.
BluetoothReadingDevice.key
final String keyThe device key reported with its readings.
BluetoothReadingDevice.name
final String nameThe name from its advertisement.
BluetoothSaveState
class BluetoothSaveStateThe outcome of saving a device reading.
Constructors
BluetoothSaveState.saving
BluetoothSaveState.saving()Creates a reading that is waiting for a save result.
BluetoothSaveState.saved
BluetoothSaveState.saved()Creates a reading that was saved.
BluetoothSaveState.queued
BluetoothSaveState.queued(String queueId)Creates a reading queued for an offline retry.
| Parameter | Type | Kind | Default |
|---|---|---|---|
queueId | String | positional |
BluetoothSaveState.failed
BluetoothSaveState.failed(BluetoothError error)Creates a reading whose save failed and can be retried.
| Parameter | Type | Kind | Default |
|---|---|---|---|
error | BluetoothError | positional |
Properties
BluetoothSaveState.status
final BluetoothSaveStatus statusThe save state.
BluetoothSaveState.queueId
final String? queueIdThe offline queue ID when status is queued.
BluetoothSaveState.error
final BluetoothError? errorThe failure when status is failed.
BluetoothSaveStatus
enum BluetoothSaveStatusWhether a device reading was saved or needs another attempt.
Values
BluetoothSaveStatus.saving
static const BluetoothSaveStatus savingThe sink has not answered yet.
BluetoothSaveStatus.saved
static const BluetoothSaveStatus savedThe sink saved the reading.
BluetoothSaveStatus.queued
static const BluetoothSaveStatus queuedThe sink queued the reading for a later retry.
BluetoothSaveStatus.failed
static const BluetoothSaveStatus failedThe sink could not save or queue the reading.
BluetoothSnapshot
class BluetoothSnapshotA consistent view of the Bluetooth runtime's current state.
Constructors
BluetoothSnapshot.new
BluetoothSnapshot({
required BluetoothAdapterState adapter,
required BluetoothPermission permission,
required bool scanning,
required BluetoothError? scanError,
required Iterable<BluetoothNearbyDevice> devices,
required Iterable<String> paired,
required Iterable<BluetoothDeviceReading> readings,
})Creates an immutable runtime snapshot.
| Parameter | Type | Kind | Default |
|---|---|---|---|
adapter | BluetoothAdapterState | required named | |
permission | BluetoothPermission | required named | |
scanning | bool | required named | |
scanError | BluetoothError? | required named | |
devices | Iterable<BluetoothNearbyDevice> | required named | |
paired | Iterable<String> | required named | |
readings | Iterable<BluetoothDeviceReading> | required named |
Properties
BluetoothSnapshot.adapter
final BluetoothAdapterState adapterThe current Bluetooth adapter state.
BluetoothSnapshot.permission
final BluetoothPermission permissionThe last observed Bluetooth permission state.
BluetoothSnapshot.scanning
final bool scanningWhether scanning has been requested.
BluetoothSnapshot.scanError
final BluetoothError? scanErrorThe last scan error, when one occurred.
BluetoothSnapshot.devices
final List<BluetoothNearbyDevice> devicesSupported peripherals, in discovery order.
BluetoothSnapshot.paired
final List<String> pairedPaired device IDs.
BluetoothSnapshot.readings
final List<BluetoothDeviceReading> readingsRecent readings, oldest first.
Methods
BluetoothSnapshot.device
BluetoothNearbyDevice? device(String id)Finds a nearby device by id.
| Parameter | Type | Kind | Default |
|---|---|---|---|
id | String | positional |
Returns BluetoothNearbyDevice?.
BluetoothSnapshot.copyWith
BluetoothSnapshot copyWith({
BluetoothAdapterState? adapter,
BluetoothPermission? permission,
bool? scanning,
BluetoothError? scanError,
bool clearScanError = false,
Iterable<BluetoothNearbyDevice>? devices,
Iterable<String>? paired,
Iterable<BluetoothDeviceReading>? readings,
})Returns a new snapshot with selected fields replaced.
| Parameter | Type | Kind | Default |
|---|---|---|---|
adapter | BluetoothAdapterState? | named | |
permission | BluetoothPermission? | named | |
scanning | bool? | named | |
scanError | BluetoothError? | named | |
clearScanError | bool | named | false |
devices | Iterable<BluetoothNearbyDevice>? | named | |
paired | Iterable<String>? | named | |
readings | Iterable<BluetoothDeviceReading>? | named |
Returns BluetoothSnapshot.
Last updated on