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 representingthisnumber of days.no setter - hours → Duration
-
Available on num, provided by the NumDurationExtension extension
Returns a Duration representingthisnumber of hours.no setter - microseconds → Duration
-
Available on num, provided by the NumDurationExtension extension
Returns a Duration representingthisnumber of microseconds.no setter - milliseconds → Duration
-
Available on num, provided by the NumDurationExtension extension
Returns a Duration representingthisnumber of milliseconds.no setter - minutes → Duration
-
Available on num, provided by the NumDurationExtension extension
Returns a Duration representingthisnumber of minutes.no setter - ms → Duration
-
Available on num, provided by the NumDurationExtension extension
Returns a Duration representingthisnumber of milliseconds.no setter - seconds → Duration
-
Available on num, provided by the NumDurationExtension extension
Returns a Duration representingthisnumber of seconds.no setter