findFirstDateOfTheWeek method
Implementation
DateTime? findFirstDateOfTheWeek({bool startWeekWithSunday = false}) {
if (startWeekWithSunday) {
return this?.subtract(Duration(days: (this?.weekday)! % 7));
}
return this?.subtract(Duration(days: (this?.weekday)! - 1));
}