range static method
Implementation
static List<DateTime> range({
required DateTime start,
required DateTime end,
Duration difference = const Duration(days: 1),
}) {
if (start.isAfter(end)) {
throw ArgumentError(
'Initial date must be before or equal to the end date',
);
}
List<DateTime> dates = [];
DateTime currentDate = start;
while (!currentDate.isAfter(end)) {
dates.add(currentDate);
currentDate = currentDate.add(difference);
}
return dates;
}