HealthDataPoint constructor

HealthDataPoint(
  1. HealthValue _value,
  2. HealthDataType _type,
  3. HealthDataUnit _unit,
  4. DateTime _dateFrom,
  5. DateTime _dateTo,
  6. PlatformType _platform,
  7. String _deviceId,
  8. String _sourceId,
  9. String _sourceName,
)

Implementation

HealthDataPoint(
    this._value,
    this._type,
    this._unit,
    this._dateFrom,
    this._dateTo,
    this._platform,
    this._deviceId,
    this._sourceId,
    this._sourceName) {
  // set the value to minutes rather than the category
  // returned by the native API
  if (type == HealthDataType.MINDFULNESS ||
      type == HealthDataType.HEADACHE_UNSPECIFIED ||
      type == HealthDataType.HEADACHE_NOT_PRESENT ||
      type == HealthDataType.HEADACHE_MILD ||
      type == HealthDataType.HEADACHE_MODERATE ||
      type == HealthDataType.HEADACHE_SEVERE ||
      type == HealthDataType.SLEEP_IN_BED ||
      type == HealthDataType.SLEEP_ASLEEP ||
      type == HealthDataType.SLEEP_AWAKE) {
    this._value = _convertMinutes();
  }
}