HumanizedDuration extension
Formatting, arithmetic, and utility methods for Duration.
- on
Properties
- abs → Duration
-
Available on Duration, provided by the HumanizedDuration extension
Returns the absolute non-negative value of this duration.no setter -
delay
→ Future<
void> -
Available on Duration, provided by the HumanizedDuration extension
Waits for this duration.no setter - hoursPart → int
-
Available on Duration, provided by the HumanizedDuration extension
Returns the absolute hours component of the duration.no setter - inDaysDouble → double
-
Available on Duration, provided by the HumanizedDuration extension
Total duration in fractional days.no setter - inHoursDouble → double
-
Available on Duration, provided by the HumanizedDuration extension
Total duration in fractional hours.no setter - inMillisecondsDouble → double
-
Available on Duration, provided by the HumanizedDuration extension
Total duration in fractional milliseconds.no setter - inMinutesDouble → double
-
Available on Duration, provided by the HumanizedDuration extension
Total duration in fractional minutes.no setter - inSecondsDouble → double
-
Available on Duration, provided by the HumanizedDuration extension
Total duration in fractional seconds.no setter - inWeeksDouble → double
-
Available on Duration, provided by the HumanizedDuration extension
Total duration in fractional weeks.no setter - isNegative → bool
-
Available on Duration, provided by the HumanizedDuration extension
Returnstrueif this duration is less than zero.no setter - isPositive → bool
-
Available on Duration, provided by the HumanizedDuration extension
Returnstrueif this duration is greater than zero.no setter - isZero → bool
-
Available on Duration, provided by the HumanizedDuration extension
Returnstrueif this duration is exactly zero.no setter - millisecondsPart → int
-
Available on Duration, provided by the HumanizedDuration extension
Returns the absolute milliseconds component of the duration, from 0 to 999.no setter - minutesPart → int
-
Available on Duration, provided by the HumanizedDuration extension
Returns the absolute minutes component of the duration, from 0 to 59.no setter - secondsPart → int
-
Available on Duration, provided by the HumanizedDuration extension
Returns the absolute seconds component of the duration, from 0 to 59.no setter - totalDays → double
-
Available on Duration, provided by the HumanizedDuration extension
Returns the total duration in floating-point days.no setter - totalHours → double
-
Available on Duration, provided by the HumanizedDuration extension
Returns the total duration in floating-point hours.no setter - totalMinutes → double
-
Available on Duration, provided by the HumanizedDuration extension
Returns the total duration in floating-point minutes.no setter
Methods
-
ceilToMinutes(
) → Duration -
Available on Duration, provided by the HumanizedDuration extension
Rounds this duration up to the nearest minute. -
clamp(
Duration min, Duration max) → Duration -
Available on Duration, provided by the HumanizedDuration extension
Clamps this duration betweenminandmax. -
coerceAtLeast(
Duration min) → Duration -
Available on Duration, provided by the HumanizedDuration extension
Ensures this duration is at leastmin. -
coerceAtMost(
Duration max) → Duration -
Available on Duration, provided by the HumanizedDuration extension
Ensures this duration is at mostmax. -
delayed<
T> (T callback()) → Future< T> -
Available on Duration, provided by the HumanizedDuration extension
Runscallbackafter this duration. -
floorToMinutes(
) → Duration -
Available on Duration, provided by the HumanizedDuration extension
Truncates this duration down to the nearest minute. -
isLongerThan(
Duration other) → bool -
Available on Duration, provided by the HumanizedDuration extension
Returnstrueif this duration is strictly longer thanother. -
isShorterThan(
Duration other) → bool -
Available on Duration, provided by the HumanizedDuration extension
Returnstrueif this duration is strictly shorter thanother. -
isWithin(
Duration range, Duration other) → bool -
Available on Duration, provided by the HumanizedDuration extension
Returnstrueif this duration is withinrangeofother. -
progressOf(
Duration total, {bool clampResult = true}) → double -
Available on Duration, provided by the HumanizedDuration extension
Returns a 0.0-1.0 progress value relative tototal. -
remainingIn(
Duration total) → Duration -
Available on Duration, provided by the HumanizedDuration extension
Remaining duration when this duration is elapsed withintotal. -
roundToMinutes(
) → Duration -
Available on Duration, provided by the HumanizedDuration extension
Rounds this duration to the nearest minute. -
roundToSeconds(
) → Duration -
Available on Duration, provided by the HumanizedDuration extension
Rounds this duration to the nearest second. -
toFrames(
double fps) → int -
Available on Duration, provided by the HumanizedDuration extension
Converts this duration to a frame count atfps. -
toHHMMSS(
) → String -
Available on Duration, provided by the HumanizedDuration extension
Formats this duration asHH:MM:SSorMM:SS. -
toHuman(
) → String -
Available on Duration, provided by the HumanizedDuration extension
Formats this duration as compact human-readable text. -
toHumanizedString(
) → String -
Available on Duration, provided by the HumanizedDuration extension
Formats this duration as1:02:34or2:05. -
toPaddedString(
) → String -
Available on Duration, provided by the HumanizedDuration extension
Formats this duration as01:02:34or02:05. -
toRelativeString(
) → String -
Available on Duration, provided by the HumanizedDuration extension
Formats this duration as relative text. -
toSeconds(
) → double -
Available on Duration, provided by the HumanizedDuration extension
Total fractional seconds, including milliseconds. -
toVerboseString(
{bool includeSeconds = true}) → String -
Available on Duration, provided by the HumanizedDuration extension
Formats this duration as compact parts such as1h 2m 34s. -
toWordString(
{bool includeSeconds = true}) → String -
Available on Duration, provided by the HumanizedDuration extension
Formats this duration with fully written-out units.
Operators
-
operator *(
num factor) → Duration -
Available on Duration, provided by the HumanizedDuration extension
Multiplies this duration byfactor. -
operator /(
num divisor) → Duration -
Available on Duration, provided by the HumanizedDuration extension
Divides this duration bydivisor.
Static Methods
-
fromFrames(
int frames, double fps) → Duration -
Available on Duration, provided by the HumanizedDuration extension
Reconstructs a duration fromframesatfps.