contains method

bool contains(
  1. DateTime date
)

Returns true if date falls within this range (inclusive of both ends).

Implementation

bool contains(DateTime date) {
  final dateOnly = DateTime(date.year, date.month, date.day);
  final startOnly = DateTime(start.year, start.month, start.day);
  final endOnly = DateTime(end.year, end.month, end.day);
  return !dateOnly.isBefore(startOnly) && !dateOnly.isAfter(endOnly);
}