isValidRange static method
Returns whether date
is in the range start
and end
.
Implementation
static bool isValidRange({
required DateTime date,
required DateTime? start,
required DateTime? end,
}) {
if (start != null && date.isBefore(start)) {
return false;
}
if (end != null && date.isAfter(end)) {
return false;
}
return true;
}