HealthData.fromHealthDataPoint constructor

HealthData.fromHealthDataPoint(
  1. HealthDataPoint healthDataPoint
)

Create a HealthData from a HealthDataPoint health data object.

Implementation

factory HealthData.fromHealthDataPoint(HealthDataPoint healthDataPoint) =>
    HealthData(
        const Uuid().v1,
        healthDataPoint.value,
        healthDataPoint.unitString,
        healthDataPoint.typeString,
        healthDataPoint.dateFrom.toUtc(),
        healthDataPoint.dateTo.toUtc(),
        HealthPlatform.values[healthDataPoint.sourcePlatform.index],
        healthDataPoint.sourceDeviceId,
        healthDataPoint.sourceId,
        healthDataPoint.sourceName);