TimeOfDay class
Represents a time of day with hour, minute, and second.
Provides constructors for various time representations including AM/PM notation, DateTime conversion, and Duration conversion.
Constructors
- TimeOfDay({required int hour, required int minute, int second = 0})
-
Creates a TimeOfDay with specified components.
const
- TimeOfDay.am({required int hour, required int minute, int second = 0})
-
Creates an AM time.
const
- TimeOfDay.fromDateTime(DateTime dateTime)
- Creates a TimeOfDay from a DateTime.
- TimeOfDay.fromDuration(Duration duration)
- Creates a TimeOfDay from a Duration.
- TimeOfDay.now()
- Creates a TimeOfDay representing the current time.
- TimeOfDay.pm({required int hour, required int minute, int second = 0})
-
Creates a PM time (adds 12 to the hour).
const
Properties
Methods
-
copyWith(
{ValueGetter< int> ? hour, ValueGetter<int> ? minute, ValueGetter<int> ? second}) → TimeOfDay - Creates a copy with specified fields replaced.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
replacing(
{int? hour, int? minute, int? second}) → TimeOfDay - For backward compatibility
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override