isDateWithInDateRange function
Check the date in between first and last date
Implementation
bool isDateWithInDateRange(dynamic startDate, dynamic endDate, dynamic date) {
if (startDate == null || endDate == null || date == null) {
return false;
}
if (startDate.isAfter(endDate) == true) {
final dynamic temp = startDate;
startDate = endDate;
endDate = temp;
}
if (isSameOrBeforeDate(endDate, date) && isSameOrAfterDate(startDate, date)) {
return true;
}
return false;
}