copyWith method

TimerSettings copyWith({
  1. int? workDuration,
  2. int? shortBreakDuration,
  3. int? longBreakDuration,
  4. int? pomodorosUntilLongBreak,
})

Creates a copy of this TimerSettings with the given fields replaced with new values.

Implementation

TimerSettings copyWith({
  int? workDuration,
  int? shortBreakDuration,
  int? longBreakDuration,
  int? pomodorosUntilLongBreak,
}) {
  return TimerSettings(
    workDuration: workDuration ?? this.workDuration,
    shortBreakDuration: shortBreakDuration ?? this.shortBreakDuration,
    longBreakDuration: longBreakDuration ?? this.longBreakDuration,
    pomodorosUntilLongBreak:
        pomodorosUntilLongBreak ?? this.pomodorosUntilLongBreak,
  );
}