In the Flutter Event Calendar, you can programmatically select the date using selectedDate property of the CalendarController. Inside the state, initialize the calendar controller. final CalendarController _calendarController= CalendarController(); Using onViewChanged callback of the Flutter event calendar, you can set the first date of visible dates as selected date. child: SfCalendar( view: CalendarView.month, controller: _calendarController, onViewChanged: viewChanged, ), void viewChanged(ViewChangedDetails viewChangedDetails) { SchedulerBinding.instance!.addPostFrameCallback((Duration duration) { _calendarController.selectedDate = viewChangedDetails.visibleDates[0]; }); }
|
This page will automatically be redirected to the sign-in page in 10 seconds.