CalendarTimeline constructor
CalendarTimeline({
- Key? key,
- required DateTime initialDate,
- required DateTime firstDate,
- required DateTime lastDate,
- required OnDateSelected onDateSelected,
- SelectableDayPredicate? selectableDayPredicate,
- double leftMargin = 0,
- Color? dayColor,
- Color? activeDayColor,
- Color? activeBackgroundDayColor,
- Color? monthColor,
- Color? dotsColor,
- Color? dayNameColor,
- bool shrink = false,
- String? locale,
- 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);