isWithinRange method
check date within the start and end date range
Implementation
bool isWithinRange(DateTime dateTime) {
if (startDate != null && endDate != null) {
return dateTime.compareTo(startDate!) >= 0 &&
dateTime.compareTo(endDate!) <= 0;
} else {
return false;
}
}