DurationShorthand class

Helper class for shorthand duration notation Supports formats like: .500ms, .5s, .5m, 500ms, 5s, 5m

Constructors

DurationShorthand(Duration duration)
const
DurationShorthand.h(double hours)
Create from hours
factory
DurationShorthand.m(double minutes)
Create from minutes
factory
DurationShorthand.ms(double milliseconds)
Create from milliseconds
factory
DurationShorthand.parse(String value)
Parse shorthand duration string Supports: .500ms, .5s, .5m, 500ms, 5s, 5m, 1.5s, etc. Note: Leading dot is just stylistic - ".500ms" = "500ms" = 500 milliseconds For decimal values, use "0.5s" not ".5s" (or use number extensions: 0.5.s)
factory
DurationShorthand.s(double seconds)
Create from seconds
factory

Properties

duration Duration
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited