TimeOfDay class
A value representing a time during the day, independent of the date that day might fall on or the time zone.
The time is represented by hour and minute pair.
See also:
- showTimePicker, which returns this type.
- MaterialLocalizations, which provides methods for formatting values of this type according to the chosen Locale.
DateTime
, which represents date and time, and is subject to eras and time zones.
- Annotations
- @immutable
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
-
The hash code for this object. [...]
read-only
- hour → int
-
The selected hour, in 24 hour time from 0..23.
final
- hourOfPeriod → int
-
Which hour of the current period (e.g., am or pm) this time is.
read-only
- minute → int
-
The selected minute.
final
- period → DayPeriod
-
Whether this time of day is before or after noon.
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
Methods
-
format(
BuildContext context) → String - Returns the localized string representation of this time of day. [...]
-
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
Operators
-
operator ==(
dynamic other) → bool - The equality operator. [...]
Constants
- hoursPerDay → const int
-
The number of hours in one day, i.e. 24.
24
- hoursPerPeriod → const int
-
The number of hours in one day period (see also
DayPeriod
), i.e. 12.12
- minutesPerHour → const int
-
The number of minutes in one hour, i.e. 60.
60