getDaysInBetween static method
Returns the dates of startDate
and endDate
.
Implementation
static List<DateTime> getDaysInBetween(DateTime startDate, DateTime endDate) {
if (endDate.isBefore(startDate)) {
endDate = startDate;
}
List<DateTime> days = [];
for (int i = 0; i <= endDate.difference(startDate).inDays; i++) {
days.add(startDate.add(Duration(days: i)));
}
return days;
}