firstDayOfWeek property
The first day of the week.
final tuesday = DateTime(2023, 4, 11);
final monday = tuesday.firstDayOfWeek; // 2023-04-10
Implementation
@useResult DateTime get firstDayOfWeek => copyWith(day: day - weekday + 1, hour: 0, minute: 0, second: 0, millisecond: 0, microsecond: 0);