Adding Extra fields other than the available fields in the Appointment class

I understand that the sfCalendar Appointmemt class provides some fields like subject, notes, location, starttime,endtime etc..

Is it possible to add some other custom variables or to extend this class so that we can add some extra variables that can be then available on calendertap callback?

1 Reply 1 reply marked as answer

IR Indumathi Ravichandran Syncfusion Team December 17, 2020 11:36 AM UTC

Hi Meenu, 
 
Thank you for contacting Syncfusion support. 
 
Based on the provided, we have checked and your requirement is “Adding required fields for appointments in the Flutter event calendar”. Your requirement can be achieved by using custom appointment. We have prepared the simple sample for the same. Please find the sample from the following link. 
 
 
Code snippet: 
class Meeting {
  Meeting({
this.eventName, this.from, this.to, this.background, this.isAllDay=false,this.id});

  String
eventName;
  DateTime
from;
  DateTime
to;
  Color
background;
  bool
isAllDay;
  int
id;
}
 
MeetingDataSource  getCalendarDataSource() {
  List<Meeting> appointments=<Meeting>[];
  appointments.add(
Meeting(
    from:
DateTime.now(),
    to:
DateTime.now().add(const Duration(hours: 1)),
    eventName:
'Meeting',
    background: Colors.
pink,
    isAllDay:
true,
    id:
1
 
)); 
} 
 
Also please find the UG link for adding custom appointments in the Flutter calendar. 
 
UG link: 
 
We hope that this helps you. Please let us know if you need further assistance. 
 
Regards, 
Indumathi R  


Marked as answer
Loader.
Up arrow icon