getMeasurement method

  1. @override
Future<Measurement?> getMeasurement()
override

Subclasses should implement / override this method to collect the Measurement. This method will be called every time data has been buffered for a duration and should return the final measurement for the buffered data.

Can return null if no data is available. Can return an Error if an error occurs.

Implementation

@override
Future<Measurement?> getMeasurement() async =>
    userAccelerometerEventList.isEmpty
        ? null
        : Measurement(
            sensorStartTime: sensorStartTime,
            sensorEndTime: sensorEndTime,
            data: AccelerationFeatures.fromAccelerometerReadings(
                userAccelerometerEventList));