TimeRange class

Represents a range of time with a start and end time.

Used to define time intervals or periods. Both start and end are represented as TimeOfDay values.

Example:

final workHours = TimeRange(
  start: TimeOfDay(hour: 9, minute: 0),
  end: TimeOfDay(hour: 17, minute: 0),
);

Constructors

TimeRange({required TimeOfDay start, required TimeOfDay end})
Creates a TimeRange with the specified start and end times.
const

Properties

end TimeOfDay
The end time of the range.
final
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
start TimeOfDay
The start time of the range.
final

Methods

copyWith({ValueGetter<TimeOfDay>? start, ValueGetter<TimeOfDay>? end}) TimeRange
Creates a copy of this range with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override