I'm new to flutter and stuck at a point where I can't think of solving this issue.I'm using this plugin syncfusion_flutter_calendar to display a calendar where people can view their scheduled jobs.I need to display the scheduled days data to this calendar.which means only the to highlight the days which are scheduled.If I have a data model like below.How can I create the data source for it.
Example :
Class ScheduledJobs {
int? id;
String? jobTitle;
DateTime? scheduledDate;
ScheduledJobs(this.id,this.jobTitle,this.scheduledDate);
}
Hope you guys can help me! thank you..
This is what the body look like.And I need to map the data from above class model to display them.
body: Padding(
padding: const EdgeInsets.only(left: 15, right: 15),
child: Container(
child: SfCalendar(
showDatePickerButton: true,
allowedViews: const <CalendarView>[
CalendarView.day,
CalendarView.week,
CalendarView.month,
CalendarView.schedule
],
view: CalendarView.schedule,
scheduleViewSettings: ScheduleViewSettings(
hideEmptyScheduleWeek: false,
),
dataSource: _calendarDataSource,
loadMoreWidgetBuilder:
(BuildContext context, LoadMoreCallback loadMoreAppointments) {
return FutureBuilder(
future: loadMoreAppointments(),
builder: (context, snapShot) {
return Container(
alignment: Alignment.center,
child: const CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation(Colors.blue),
),
);
},
);
},
),
),
),