DateTimeRange constructor Null safety

DateTimeRange(
  1. {required DateTime start,
  2. required DateTime end}
)

Creates a date range for the given start and end DateTime.

Implementation

DateTimeRange({
  required this.start,
  required this.end,
}) : assert(start != null),
     assert(end != null),
     assert(!start.isAfter(end));