IsoDuration constructor
IsoDuration({})
Creates a new IsoDuration object where each value represents an individual duration part.
This IsoDuration is not like Dart's implementation of Duration whose value is the sum of all individual parts.
All arguments are 0 by default.
See more:
- IsoDuration - ISO 8061 Duration Data Type
Implementation
IsoDuration({
this.years = 0,
this.months = 0,
this.weeks = 0,
this.days = 0,
this.hours = 0,
this.minutes = 0,
this.seconds = 0,
}) : assert(
<double>[years, months, weeks, days, hours, minutes, seconds].every(
(e) => e <= 0,
) ||
<double>[years, months, weeks, days, hours, minutes, seconds]
.every((e) => e >= 0),
'Can not mix positive and negative values!',
);