lastDayOfWeek static method

DateTime lastDayOfWeek({
  1. DateTime? date,
})

Implementation

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));
}