isAgeBetween method

bool? isAgeBetween(
  1. int min,
  2. int max
)

Check if DateTime is between a certain min and max age

Implementation

bool? isAgeBetween(int min, int max) {
  if (this == null) return null;
  int? ageCheck = toAge();
  if (ageCheck == null) return null;
  return ageCheck >= min && ageCheck <= max;
}