CalendarTimeline constructor

CalendarTimeline({
  1. Key? key,
  2. required DateTime initialDate,
  3. required DateTime firstDate,
  4. required DateTime lastDate,
  5. required OnDateSelected onDateSelected,
  6. SelectableDayPredicate? selectableDayPredicate,
  7. double leftMargin = 0,
  8. Color? dayColor,
  9. Color? activeDayColor,
  10. Color? activeBackgroundDayColor,
  11. Color? monthColor,
  12. Color? dotsColor,
  13. Color? dayNameColor,
  14. bool shrink = false,
  15. String? locale,
  16. bool showYears = false,
})

Implementation

CalendarTimeline({
  Key? key,
  required this.initialDate,
  required this.firstDate,
  required this.lastDate,
  required this.onDateSelected,
  this.selectableDayPredicate,
  this.leftMargin = 0,
  this.dayColor,
  this.activeDayColor,
  this.activeBackgroundDayColor,
  this.monthColor,
  this.dotsColor,
  this.dayNameColor,
  this.shrink = false,
  this.locale,
  this.showYears = false,
})  : assert(
        initialDate.difference(firstDate).inDays >= 0,
        'initialDate must be on or after firstDate',
      ),
      assert(
        !initialDate.isAfter(lastDate),
        'initialDate must be on or before lastDate',
      ),
      assert(
        !firstDate.isAfter(lastDate),
        'lastDate must be on or after firstDate',
      ),
      assert(
        selectableDayPredicate == null || selectableDayPredicate(initialDate),
        'Provided initialDate must satisfy provided selectableDayPredicate',
      ),
      assert(
        locale == null || dateTimeSymbolMap().containsKey(locale),
        "Provided locale value doesn't exist",
      ),
      super(key: key);