copyWith method
Creates a copy of this with the updated units of time.
No normalization is performed.
Period(years: 1, months: 1).copyWith(months: 13); // 1 year 13 months
Implementation
@useResult Period copyWith({
int? years,
int? months,
int? days,
int? hours,
int? minutes,
int? seconds,
int? milliseconds,
int? microseconds,
}) => Period(
years: years ?? this.years,
months: months ?? this.months,
days: days ?? this.days,
hours: hours ?? this.hours,
minutes: minutes ?? this.minutes,
seconds: seconds ?? this.seconds,
milliseconds: milliseconds ?? this.milliseconds,
microseconds: microseconds ?? this.microseconds,
);