debugCheckIsValidTimetableInterval method

bool debugCheckIsValidTimetableInterval()

Implementation

bool debugCheckIsValidTimetableInterval() {
  assert(() {
    if (isValidTimetableInterval) return true;

    throw FlutterError.fromParts([
      ErrorSummary('Invalid interval for timetable: `$this`'),
      ErrorDescription(
        'A (date/time) interval for timetable must have valid timetable '
        '`DateTime`s for its `start` and `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;
}