NumDurationExtension extension

Extension on num (e.g. int and double) to easily create Duration instances.

Examples:

200.ms       // Duration(milliseconds: 200)
3.seconds    // Duration(seconds: 3)
1.5.days     // Duration(hours: 36)

Internally, durations are created in microseconds and rounded to the nearest integer.

on

Properties

days Duration

Available on num, provided by the NumDurationExtension extension

Returns a Duration representing this number of days.
no setter
hours Duration

Available on num, provided by the NumDurationExtension extension

Returns a Duration representing this number of hours.
no setter
microseconds Duration

Available on num, provided by the NumDurationExtension extension

Returns a Duration representing this number of microseconds.
no setter
milliseconds Duration

Available on num, provided by the NumDurationExtension extension

Returns a Duration representing this number of milliseconds.
no setter
minutes Duration

Available on num, provided by the NumDurationExtension extension

Returns a Duration representing this number of minutes.
no setter
ms Duration

Available on num, provided by the NumDurationExtension extension

Returns a Duration representing this number of milliseconds.
no setter
seconds Duration

Available on num, provided by the NumDurationExtension extension

Returns a Duration representing this number of seconds.
no setter