main
1part of 'device_scan_cubit.dart';
2
3/// Search of bluetooth devices that meet some criteria.
4@immutable
5sealed class DeviceScanState {}
6
7/// Searching for devices or a reason they are not available.
8class DeviceListLoading extends DeviceScanState {}
9
10/// A device has been selected, either automatically or by the user.
11class DeviceSelected extends DeviceScanState {
12 /// Indicate that a device has been selected.
13 DeviceSelected(this.device);
14
15 /// The selected device.
16 final BluetoothDevice device;
17}
18
19/// Multiple unrecognized devices.
20class DeviceListAvailable extends DeviceScanState {
21 /// Indicate that multiple unrecognized have been found.
22 DeviceListAvailable(this.devices);
23
24 /// All found devices.
25 final List<BluetoothDevice> devices;
26}
27
28/// One unrecognized device has been found.
29///
30/// While not technically correct, this can be understood as a connection
31/// request the user has to accept.
32class SingleDeviceAvailable extends DeviceScanState {
33 /// Indicate that one unrecognized device has been found.
34 SingleDeviceAvailable(this.device);
35
36 /// The only found device.
37 final BluetoothDevice device;
38}