Commit a3cd226
Changed files (4)
app
lib
components
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,
app/pubspec.lock
@@ -293,6 +293,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "8.2.4"
+ freezed_annotation:
+ dependency: transitive
+ description:
+ name: freezed_annotation
+ sha256: c3fd9336eb55a38cc1bbd79ab17573113a8deccd0ecbbf926cca3c62803b5c2d
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.4.1"
function_tree:
dependency: "direct main"
description:
@@ -317,6 +325,13 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.2"
+ health_data_store:
+ dependency: "direct main"
+ description:
+ path: "../health_data_store"
+ relative: true
+ source: path
+ version: "0.1.0+1"
http:
dependency: transitive
description:
@@ -365,6 +380,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.0"
+ json_annotation:
+ dependency: transitive
+ description:
+ name: json_annotation
+ sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467
+ url: "https://pub.dev"
+ source: hosted
+ version: "4.8.1"
leak_tracker:
dependency: transitive
description: