initialSelectedDate property
The date to initially select on the SfCalendar.
The SfCalendar will select the date that set to this property.
Defaults to null.
See also:
- CalendarController.selectedDate, to selected date programmatically on calendar in the runtime.
- selectionDecoration, to add decoration for the selected cell in calendar.
- initialDisplayDate, to navigate to the given date on calendar initially.
- CalendarController.displayDate, to navigate to the given date on calendar programmatically in runtime.
- onSelectionChanged, the callback which notifies when the selected cell changed on calendar.
- Knowledge base: How to get the selected dates using selection changed callback
- Knowledge base: How to programmatically select the dates
Widget build(BuildContext context) {
return Container(
child: SfCalendar(
view: CalendarView.week,
initialSelectedDate: DateTime(2019, 12, 12, 11, 0, 0),
),
);
}
Implementation
final DateTime? initialSelectedDate;