isWeekend property
bool
isWeekend
Checks if the given date is on a weekend.
Example:
var saturday = DateTime(2023, 1, 7);
print(saturday.isWeekend); // Output: true
Implementation
bool get isWeekend => weekday == DateTime.saturday || weekday == DateTime.sunday;