static DateTime lastDayOfWeek({DateTime? date}) { if (date == null) date = DateTime.now(); if (date.weekday == 7) return date; return date.add(Duration(days: 7 - date.weekday)); }