setListOfDate method
void
setListOfDate(
- DateTime monthDate
)
Implementation
void setListOfDate(DateTime monthDate) {
dateList.clear();
final DateTime newDate = DateTime(monthDate.year, monthDate.month, 0);
int previousMothDay = 0;
if (newDate.weekday < 7) {
previousMothDay = newDate.weekday;
for (int i = 1; i <= previousMothDay; i++) {
dateList.add(newDate.subtract(Duration(days: previousMothDay - i)));
}
}
for (int i = 0; i < (42 - previousMothDay); i++) {
dateList.add(newDate.add(Duration(days: i + 1)));
}
}