copyWith method

  1. @useResult
LocalTime copyWith({
  1. int? hour,
  2. int? minute,
  3. int? second,
  4. int? millisecond,
  5. int? microsecond,
})

Returns a copy of this with the updated units of time.

LocalTime(12).copyWith(minute: 30); // 12:30

Implementation

@useResult LocalTime copyWith({int? hour, int? minute, int? second, int? millisecond, int? microsecond}) => LocalTime(
  hour ?? this.hour,
  minute ?? this.minute,
  second ?? this.second,
  millisecond ?? this.millisecond,
  microsecond  ?? this.microsecond,
);