weeks method
Generates an iterable of DateTime objects representing each week within the date range.
Implementation
Iterable<DateTime> weeks() sync* {
var i = startDate.firstDayOfWeek;
while (i.isBefore(endDate)) {
yield i;
i = i.add(const Duration(days: 7));
}
}