DurationComponentsExtension extension

Extension on Dart's Duration class to provide access to individual time components like days, hours, minutes, seconds, and milliseconds.

This is useful for scenarios where you need to extract specific components from a Duration object without converting everything to the largest unit.

on

Properties

days → int

Available on Duration, provided by the DurationComponentsExtension extension

Returns the number of days in this Duration.
no setter
hours → int

Available on Duration, provided by the DurationComponentsExtension extension

Returns the number of hours in this Duration that do not complete a full day.
no setter
milliseconds → int

Available on Duration, provided by the DurationComponentsExtension extension

Returns the number of milliseconds in this Duration that do not complete a full second.
no setter
minutes → int

Available on Duration, provided by the DurationComponentsExtension extension

Returns the number of minutes in this Duration that do not complete a full hour.
no setter
seconds → int

Available on Duration, provided by the DurationComponentsExtension extension

Returns the number of seconds in this Duration that do not complete a full minute.
no setter