datesOfMonths property

List<DateTime> datesOfMonths

Returns list of all dates of month. All the dates are week based that means it will return array of size 42 which will contain 6 weeks that is the maximum number of weeks a month can have.

Implementation

List<DateTime> get datesOfMonths {
  final monthDays = <DateTime>[];
  for (var i = 1, start = 1; i < 7; i++, start += 7) {
    monthDays.addAll(DateTime(year, month, start).datesOfWeek());
  }
  return monthDays;
}