copyWith method

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

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

OffsetTime(Offset(8), 12).copyWith(offset: Offset(12)); // 12:00+12:00

Implementation

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