Commit f6c730b

derdilla <82763757+NobodyForNothing@users.noreply.github.com>
2024-04-01 16:12:14
add missing documentation
Signed-off-by: derdilla <82763757+NobodyForNothing@users.noreply.github.com>
1 parent 94bbe22
Changed files (3)
app/lib/components/ble_input/ble_input_bloc.dart
@@ -86,7 +86,7 @@ class BleInputBloc extends Bloc<BleInputEvent, BleInputState> {
                 deviceId: event.device.id,
               );
               _ble.subscribeToCharacteristic(characteristic).listen((List<int> data) {
-                add(BleBluetoothMeasurementRecieved(data));
+                add(BleBluetoothMeasurementReceived(data));
               });
               return BleConnectSuccess();
             } else if (update.connectionState == DeviceConnectionState.connecting) {
@@ -100,7 +100,7 @@ class BleInputBloc extends Bloc<BleInputEvent, BleInputState> {
       }
     });
 
-    on<BleBluetoothMeasurementRecieved>((event, emit) {
+    on<BleBluetoothMeasurementReceived>((event, emit) {
       emit(BleMeasurementInProgress());
       final decoded = BPMeasurementCharacteristic.parse(event.data);
       final record = BloodPressureRecord(
app/lib/components/ble_input/ble_input_events.dart
@@ -1,6 +1,6 @@
-// TODO document
 import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
 
+/// Bluetooth measurement event.
 sealed class BleInputEvent {}
 
 /// Request expanding the input field.
@@ -9,15 +9,19 @@ class OpenBleInput extends BleInputEvent {}
 /// Request closing the input field.
 class CloseBleInput extends BleInputEvent {}
 
+/// Connection with a device has been requested.
 class BleInputDeviceSelected extends BleInputEvent {
+  /// Request connection with a device.
   BleInputDeviceSelected(this.device);
 
+  /// The device to connect with.
   final DiscoveredDevice device;
 }
 
 /// A measurement was started over bluetooth.
-class BleBluetoothMeasurementRecieved extends BleInputEvent {
-  BleBluetoothMeasurementRecieved(this.data);
+class BleBluetoothMeasurementReceived extends BleInputEvent {
+  /// Transmit binary data from a bluetooth device.
+  BleBluetoothMeasurementReceived(this.data);
 
   /// The binary data received.
   final List<int> data;
app/lib/components/ble_input/ble_input_state.dart
@@ -1,4 +1,3 @@
-// TODO: doc
 import 'package:blood_pressure_app/components/ble_input/measurement_characteristic.dart';
 import 'package:blood_pressure_app/model/blood_pressure/record.dart';
 import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
@@ -41,6 +40,7 @@ class BleMeasurementInProgress extends BleInputState {}
 
 /// A measurement was taken through the bluetooth device.
 class BleMeasurementSuccess extends BleInputState {
+  /// A measurement that was taken through the bluetooth device.
   BleMeasurementSuccess(this.record, {
     this.bodyMoved,
     this.cuffLoose,