copyWith method

StopwatchModel copyWith({
  1. Duration? elapsed,
  2. Duration? interval,
  3. bool? running,
  4. int? id,
  5. int? tag,
})

Creates a copy of this model with the given fields replaced.

Implementation

StopwatchModel copyWith({
  Duration? elapsed,
  Duration? interval,
  bool? running,
  int? id,
  int? tag,
}) {
  return StopwatchModel._(
    elapsed: elapsed ?? _elapsed,
    interval: interval ?? this.interval,
    running: running ?? _running,
    id: id ?? _id,
    tag: tag ?? _tag,
  );
}