DurationFormat class

units must be in descending order

Anything more precise than DurationUnit.second is not yet implemented

Constructors

DurationFormat(List<DurationUnit> units)
units should be provi ded in descending order
const

Properties

hashCode int
The hash code for this object.
no setterinherited
isAuto bool
no setter
last DurationUnit
Returns units.last, will throw StateError if units is empty
no setter
length int
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
units List<DurationUnit>
final

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

Static Methods

resolveAuto(Duration duration, [bool includeWeeks = false]) DurationFormat
Returns most suitable DurationFormat for duration

Constants

all → const DurationFormat
auto → const DurationFormat
Tries to find the most optimal format for the duration
dh → const DurationFormat
X day(s) y hour(s)
hm → const DurationFormat
X minute(s) y second(s)
md → const DurationFormat
X month(s) y day(s)
ms → const DurationFormat
X minute(s) y second(s)
s → const DurationFormat
X second(s)
wd → const DurationFormat
X week(s) y day(s)
ym → const DurationFormat
X year(s) y months