isSameWeek method

bool isSameWeek(
  1. DateTime other
)

Checks if the current date is in the same week as other

Implementation

bool isSameWeek(DateTime other) {
  final weekStart = subtract(Duration(days: weekday - 1));
  final weekEnd = weekStart.add(Duration(days: 6));
  return other.isAfter(weekStart) && other.isBefore(weekEnd);
}