copyWith method
Creates a copy of this range with the given fields replaced.
Parameters:
start(ValueGetter<DateTime>?, optional): New start date.end(ValueGetter<DateTime>?, optional): New end date.
Returns: A new DateTimeRange with updated values.
Implementation
DateTimeRange copyWith({
ValueGetter<DateTime>? start,
ValueGetter<DateTime>? end,
}) {
return DateTimeRange(
start == null ? this.start : start(),
end == null ? this.end : end(),
);
}