lastDayOfWeek property
DateTime
lastDayOfWeek
Implementation
DateTime get lastDayOfWeek {
/// Handle Daylight Savings by setting hour to 12:00 Noon
/// rather than the default of Midnight
final day = DateTime.utc(this.year, this.month, this.day, 12);
/// Weekday is on a 1-7 scale Monday - Sunday,
/// This Calendar's Week starts on Sunday
var increaseNum = day.weekday % 7;
return day.add(Duration(days: 7 - increaseNum));
}