A value representing a time during the day

Constructors

TimeOfDay({@required int hour, @required int minute })

Creates a time of day.

const
TimeOfDay.fromDateTime(DateTime time)

Creates a time of day based on the given time.

TimeOfDay.now()

Creates a time of day based on the current time.

factory

Properties

hashCode int

read-only
hour int

The selected hour, in 24 hour time from 0..23.

read-only
hourLabel String

A string representing the hour, in 24 hour time (e.g., '04' or '18').

read-only
hourOfPeriod int

Which hour of the current period (e.g., am or pm) this time is.

read-only
hourOfPeriodLabel String

A string representing the hour of the current period (e.g., '4' or '6').

read-only
minute int

The selected minute.

read-only
minuteLabel String

A string representing the minute (e.g., '07').

read-only
period DayPeriod

Whether this time of day is before or after noon.

read-only
periodLabel String

A string representing the current period (e.g., 'a.m.').

read-only
periodOffset int

The hour at which the current period starts.

read-only
runtimeType Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) bool

The equality operator.

Methods

replacing({int hour, int minute }) TimeOfDay

Returns a new TimeOfDay with the hour and/or minute replaced.

toString() String

Returns a string representation of this object.

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited