Search code examples
databasesetstatesyncfusionstate-managementsfcalendar

Syncfusion Flutter Calendar Add own Appointment


This is probably simple for anyone who knows basic state management. I may not have to be familiar with Syncfusion Flutter Calendar to know this.

I basically want the user to add their own appointments to the calendar. In this case to the dataSource (DataSource / CalendarDataSource) -all appointments are "all day" - the user chooses only the day.

Please go to my git and look into the code since stackoverflow wont allow too much code. I simplified the app to keep it short. Please use VCS and try it in a simulator/emulator

Github

Thank you!


Solution

  • Based on the information you provided, we have updated the sample to meet your requirement. In this updated sample, we have added a new appointment for the selected date when the "Save" button is tapped. You can use this logic to add, update, or delete appointments from the Flutter calendar.

    Please find the code snippet for reference.

    code snippets

    Note that when the data source is updated, you will need to notify the data source action through the "notifyListener" method. For more information on this, please refer to our user guide documentation on data source manipulation at https://help.syncfusion.com/flutter/calendar/appointments#datasource-manipulation