DateTimeRange class

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

Immutable value type for representing a continuous period between two dates. Commonly used with date range pickers to specify selected date intervals.

Example:

final range = DateTimeRange(
  DateTime(2024, 1, 1),
  DateTime(2024, 1, 31),
);

Constructors

DateTimeRange(DateTime start, DateTime end)
Creates a DateTimeRange.
const

Properties

end DateTime
The end date/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 DateTime
The start date/time of the range.
final

Methods

copyWith({ValueGetter<DateTime>? start, ValueGetter<DateTime>? end}) DateTimeRange
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