isWithinLastDays method
True if this is on or after now minus n days and not after now.
Implementation
@useResult
bool isWithinLastDays(int n, DateTime now) {
final DateTime cutoff = DateTime(now.year, now.month, now.day - n);
return !isBefore(cutoff) && !isAfter(now);
}