isThisWeek static method

bool isThisWeek(
  1. DateTime date
)

Implementation

static bool isThisWeek(DateTime date){
  Duration diff = DateTime.now().difference(date);
  final diffDays = diff.inDays < 0 ? diff.inDays*-1 : diff.inDays;
  return diffDays <= 7;
}