isCurrentDayOfWeek property

bool get isCurrentDayOfWeek

Checks if the number (assumed to represent a day of the week, 1-based) corresponds to the current day of the week.

This method follows ISO 8601, where the week starts on Monday (1) and ends on Sunday (7).

Example:

1.isCurrentDayOfWeek; // Returns true if today is Monday
7.isCurrentDayOfWeek; // Returns true if today is Sunday

Implementation

bool get isCurrentDayOfWeek {
  final now = DateTime.now();
  return toInt() == now.weekday;
}