DurationHelpers extension
- on
Properties
- inDays → int
-
Available on Duration, provided by the DurationHelpers extension
Converts this Duration to daysno setter - inHours → int
-
Available on Duration, provided by the DurationHelpers extension
Converts this Duration to hoursno setter - inMilliseconds → int
-
Available on Duration, provided by the DurationHelpers extension
Converts this Duration to milliseconds (already exists in core, but for chaining clarity)no setter - inMinutes → int
-
Available on Duration, provided by the DurationHelpers extension
Converts this Duration to minutesno setter - inSeconds → int
-
Available on Duration, provided by the DurationHelpers extension
Converts this Duration to seconds (already exists in core, but for chaining clarity)no setter - isNegative → bool
-
Available on Duration, provided by the DurationHelpers extension
Check if this duration is negativeno setter - isZero → bool
-
Available on Duration, provided by the DurationHelpers extension
Check if this duration is zerono setter - readable → String
-
Available on Duration, provided by the DurationHelpers extension
Returns a human-readable string, e.g., "2h 30m 15s"no setter
Methods
-
chunked(
Duration chunkSize) → List< Duration> -
Available on Duration, provided by the DurationHelpers extension
Divide this duration into smaller chunks of givenchunkSizeExample: 5.seconds.chunked(1.seconds) =>1s, 1s, 1s, 1s, 1s -
debounce(
VoidCallback action) → void -
Available on Duration, provided by the DurationHelpers extension
-
isEqualTo(
Duration other) → bool -
Available on Duration, provided by the DurationHelpers extension
-
isLongerThan(
Duration other) → bool -
Available on Duration, provided by the DurationHelpers extension
-
isShorterThan(
Duration other) → bool -
Available on Duration, provided by the DurationHelpers extension
Compare two durations -
sleep(
) → Future< void> -
Available on Duration, provided by the DurationHelpers extension
Delay for this duration (inline usage like:2.seconds.sleep()) -
throttle(
VoidCallback action) → void -
Available on Duration, provided by the DurationHelpers extension
Operators
-
operator +(
Duration other) → Duration -
Available on Duration, provided by the DurationHelpers extension
Add two durations together (handy for chaining) -
operator -(
Duration other) → Duration -
Available on Duration, provided by the DurationHelpers extension
Subtract two durations (also handy for chaining)