copyWith method

StopwatchModel copyWith({
  1. Duration? elapsed,
  2. bool? running,
  3. DateTime? lastTick,
  4. Object? id,
  5. bool clearLastTick = false,
})

Implementation

StopwatchModel copyWith({
  Duration? elapsed,
  bool? running,
  DateTime? lastTick,
  Object? id,
  bool clearLastTick = false,
}) =>
    StopwatchModel(
      elapsed: elapsed ?? this.elapsed,
      running: running ?? this.running,
      lastTick: clearLastTick ? null : (lastTick ?? this.lastTick),
      id: id ?? this.id,
    );