isWithinRange method

bool isWithinRange(
  1. DateTime startDate,
  2. DateTime endDate
)

Checks if a DateTime is within a Rage (two dates that makes an Interval)

Implementation

bool isWithinRange(DateTime startDate, DateTime endDate) =>
    Interval(startDate, endDate).includes(this);