debugCheckIsValidTimetableDateInterval method

bool debugCheckIsValidTimetableDateInterval()

Implementation

bool debugCheckIsValidTimetableDateInterval() {
  assert(() {
    if (isValidTimetableDateInterval) return true;

    throw FlutterError.fromParts([
      ErrorSummary('Invalid date interval for timetable: `$this`'),
      ErrorDescription(
        'A date interval for timetable must have a valid timetable date for '
        'its `start` and a valid timetable `DateTime` at with '
        '`dateTime.isAtEndOfDay` for `end`.',
      ),
      ErrorHint(
        'The actual time zone is ignored when displaying events, timetable '
        'only uses the `year`, `month`, `day`, `hour`, `minute`, `second`, '
        'and `millisecond` fields.',
      ),
      ...NullableDateTimeTimetable._dateTimeExplanation,
    ]);
  }());
  return true;
}