getFirstDayOfWeekForWeek method
Implementation
DateTime getFirstDayOfWeekForWeek(
int weekIndex, int year, int month) {
DateTime firstDayOfMonth = DateTime(year, month, 1);
while (firstDayOfMonth.weekday != 1) {
firstDayOfMonth =
firstDayOfMonth.subtract(const Duration(days: 1));
}
return firstDayOfMonth.add(Duration(days: 7 * weekIndex));
}