PeriodBuilder class

A mutable builder class for Period values. Each property can be set independently, and then a Period can be created from the result using the build method.

Constructors

PeriodBuilder([Period period = Period.zero])
Creates a new period builder with an initially zero period or creates a new period builder with the values from an existing period. Calling this constructor instead of Period.toBuilder allows object initializers to be used.

Properties

days int
Gets or sets the number of days within the period.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
hours int
Gets or sets the number of hours within the period.
getter/setter pair
microseconds int
Gets or sets the number of ticks within the period.
getter/setter pair
milliseconds int
Gets or sets the number of milliseconds within the period.
getter/setter pair
minutes int
Gets or sets the number of minutes within the period.
getter/setter pair
months int
Gets or sets the number of months within the period.
getter/setter pair
nanoseconds int
Gets or sets the number of nanoseconds within the period.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
seconds int
Gets or sets the number of seconds within the period.
getter/setter pair
weeks int
Gets or sets the number of weeks within the period.
getter/setter pair
years int
Gets or sets the number of years within the period.
getter/setter pair

Methods

build() Period
Builds a period from the properties in this builder.
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
operator [](PeriodUnits unit) int
Gets or sets the value of a single unit.
operator []=(PeriodUnits unit, int value) → void