isWeekday property

bool get isWeekday

Return true if given date is not on Saturday or Sunday.

final checkDate =
   DateTime.parse('2023-09-12 20:18:00.123456789z'); //Tuesday
checkDate.isWeekday;                                 //true

Implementation

bool get isWeekday {
  return ![6, 7].contains(weekday);
}