copyWith method

SleepModel copyWith({
  1. String? id,
  2. dynamic averageBreath,
  3. dynamic averageHeartRate,
  4. dynamic averageHrv,
  5. dynamic awakeTime,
  6. String? bedtimeEnd,
  7. String? bedtimeStart,
  8. DateTime? day,
  9. dynamic deepSleepDuration,
  10. dynamic efficiency,
  11. dynamic heartRate,
  12. dynamic hrv,
  13. dynamic latency,
  14. dynamic lightSleepDuration,
  15. bool? lowBatteryAlert,
  16. dynamic lowestHeartRate,
  17. dynamic movement30Sec,
  18. int? period,
  19. dynamic readiness,
  20. dynamic readinessScoreDelta,
  21. dynamic remSleepDuration,
  22. dynamic restlessPeriods,
  23. dynamic sleepPhase5Min,
  24. dynamic sleepScoreDelta,
  25. dynamic sleepAlgorithmVersion,
  26. int? timeInBed,
  27. dynamic totalSleepDuration,
  28. SleepType? type,
})

Implementation

SleepModel copyWith(
    {String? id,
    dynamic averageBreath,
    dynamic averageHeartRate,
    dynamic averageHrv,
    dynamic awakeTime,
    String? bedtimeEnd,
    String? bedtimeStart,
    DateTime? day,
    dynamic deepSleepDuration,
    dynamic efficiency,
    dynamic heartRate,
    dynamic hrv,
    dynamic latency,
    dynamic lightSleepDuration,
    bool? lowBatteryAlert,
    dynamic lowestHeartRate,
    dynamic movement30Sec,
    int? period,
    dynamic readiness,
    dynamic readinessScoreDelta,
    dynamic remSleepDuration,
    dynamic restlessPeriods,
    dynamic sleepPhase5Min,
    dynamic sleepScoreDelta,
    dynamic sleepAlgorithmVersion,
    int? timeInBed,
    dynamic totalSleepDuration,
    enums.SleepType? type}) {
  return SleepModel(
      id: id ?? this.id,
      averageBreath: averageBreath ?? this.averageBreath,
      averageHeartRate: averageHeartRate ?? this.averageHeartRate,
      averageHrv: averageHrv ?? this.averageHrv,
      awakeTime: awakeTime ?? this.awakeTime,
      bedtimeEnd: bedtimeEnd ?? this.bedtimeEnd,
      bedtimeStart: bedtimeStart ?? this.bedtimeStart,
      day: day ?? this.day,
      deepSleepDuration: deepSleepDuration ?? this.deepSleepDuration,
      efficiency: efficiency ?? this.efficiency,
      heartRate: heartRate ?? this.heartRate,
      hrv: hrv ?? this.hrv,
      latency: latency ?? this.latency,
      lightSleepDuration: lightSleepDuration ?? this.lightSleepDuration,
      lowBatteryAlert: lowBatteryAlert ?? this.lowBatteryAlert,
      lowestHeartRate: lowestHeartRate ?? this.lowestHeartRate,
      movement30Sec: movement30Sec ?? this.movement30Sec,
      period: period ?? this.period,
      readiness: readiness ?? this.readiness,
      readinessScoreDelta: readinessScoreDelta ?? this.readinessScoreDelta,
      remSleepDuration: remSleepDuration ?? this.remSleepDuration,
      restlessPeriods: restlessPeriods ?? this.restlessPeriods,
      sleepPhase5Min: sleepPhase5Min ?? this.sleepPhase5Min,
      sleepScoreDelta: sleepScoreDelta ?? this.sleepScoreDelta,
      sleepAlgorithmVersion:
          sleepAlgorithmVersion ?? this.sleepAlgorithmVersion,
      timeInBed: timeInBed ?? this.timeInBed,
      totalSleepDuration: totalSleepDuration ?? this.totalSleepDuration,
      type: type ?? this.type);
}