Bluetooth device picker
Generated reference for ovok_flutter: bluetooth device picker.
- Stable unknown
- Release candidate since 0.1.0-rc.4
- Development since 0.1.0-dev.29+c3980d5
BluetoothDevicePicker
class BluetoothDevicePicker extends StatelessWidgetLists nearby supported devices and connects to the selected device.
Constructors
BluetoothDevicePicker.new
BluetoothDevicePicker({
ValueChanged<BluetoothNearbyDevice>? onSelect,
VoidCallback? onDismiss,
String title = 'Choose a device',
String dismissLabel = 'Not now',
String? Function(BluetoothNearbyDevice)? getDeviceImage,
String Function(BluetoothNearbyDevice)? labelForDevice,
BluetoothDevicePickerRowBuilder? renderRow,
Key? key,
})Creates the content for a modal device picker.
| Parameter | Type | Kind | Default |
|---|---|---|---|
onSelect | ValueChanged? | named | |
onDismiss | VoidCallback? | named | |
title | String | named | 'Choose a device' |
dismissLabel | String | named | 'Not now' |
getDeviceImage | String? Function(BluetoothNearbyDevice)? | named | |
labelForDevice | String Function(BluetoothNearbyDevice)? | named | |
renderRow | BluetoothDevicePickerRowBuilder? | named | |
key | Key? | named |
Properties
BluetoothDevicePicker.onSelect
final ValueChanged? onSelectCalled when a selected device starts connecting.
BluetoothDevicePicker.onDismiss
final VoidCallback? onDismissCalled when the picker is dismissed without selecting a device.
BluetoothDevicePicker.title
final String titleThe picker heading.
BluetoothDevicePicker.dismissLabel
final String dismissLabelThe dismiss button label.
BluetoothDevicePicker.getDeviceImage
final String? Function(BluetoothNearbyDevice)? getDeviceImageReturns an optional device image URL.
BluetoothDevicePicker.labelForDevice
final String Function(BluetoothNearbyDevice)? labelForDeviceReturns the device label; defaults to its advertised name or key.
BluetoothDevicePicker.renderRow
final BluetoothDevicePickerRowBuilder? renderRowBuilds a custom row, or returns null to show the default row.
Methods
BluetoothDevicePicker.show
Future<BluetoothNearbyDevice?> show(
BuildContext context, {
ValueChanged<BluetoothNearbyDevice>? onSelect,
VoidCallback? onDismiss,
String title = 'Choose a device',
String dismissLabel = 'Not now',
String? Function(BluetoothNearbyDevice)? getDeviceImage,
String Function(BluetoothNearbyDevice)? labelForDevice,
BluetoothDevicePickerRowBuilder? renderRow,
})Shows the picker as a bottom sheet.
| Parameter | Type | Kind | Default |
|---|---|---|---|
context | BuildContext | positional | |
onSelect | ValueChanged? | named | |
onDismiss | VoidCallback? | named | |
title | String | named | 'Choose a device' |
dismissLabel | String | named | 'Not now' |
getDeviceImage | String? Function(BluetoothNearbyDevice)? | named | |
labelForDevice | String Function(BluetoothNearbyDevice)? | named | |
renderRow | BluetoothDevicePickerRowBuilder? | named |
Returns Future<BluetoothNearbyDevice?>.
BluetoothDevicePickerRowBuilder
typedef BluetoothDevicePickerRowBuilder = Widget Function(BuildContext, BluetoothNearbyDevice, void Function())Builds a custom picker row for one nearby Bluetooth device.
Last updated on