How to clear the appointments in month agenda view using onViewChange callback in the Flutter Calendar?
In the Flutter Event Calendar, you can clear the selected date appointments using onViewChanged callback of the calendar.
STEP 1: Inside the state initialize the calendar controller.
final CalendarController _calendarController = CalendarController();
STEP 2:
In onViewChanged callback set the selected date value as null for clearing the selected date appointments.
void calendarViewChanged(ViewChangedDetails viewChangedDetails) { SchedulerBinding.instance!.addPostFrameCallback((timeStamp) { _calendarController.selectedDate = null; }); }
STEP 3: Assign _calendarController to controller property of the calendar.
child: SfCalendar( view: CalendarView.month, controller: _calendarController, dataSource: _getDataSource(), onViewChanged: calendarViewChanged, monthViewSettings: MonthViewSettings(showAgenda: true), ),
Conclusion
Hope you enjoyed learning about how to clear the appointments in month agenda view using onViewChange callback in the Flutter Calendar.
You can refer to our Flutter Calendar feature tour page to learn about its other groundbreaking feature representations. You can explore our documentation to understand how to present and manipulate data.
For current customers, you can check out our Angular components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our Angular Diagram and other Angular components.You can also explore our Flutter calendar example to understand how to create and manupulate data.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!