daysInWeek static method

List<DateTime> daysInWeek(
  1. DateTime date, {
  2. int startOfWeek = 1,
})

Returns the 7 dates of the week containing date.

Implementation

static List<DateTime> daysInWeek(DateTime date, {int startOfWeek = 1}) {
  final start = firstDayOfWeek(date, firstDay: startOfWeek);
  return List.generate(7, (i) => start.add(Duration(days: i)));
}