isThisWeek property

bool get isThisWeek

Checks if the date is this week

Implementation

bool get isThisWeek {
  final now = DateTime.now();
  final startOfWeek = now.subtract(Duration(days: now.weekday - 1));
  final localTime = toLocal();
  return localTime.isAfter(startOfWeek.subtract(const Duration(days: 1)));
}