onSelectionChanged property
Called whenever a SfCalendar cell is selected.
The callback details argument contains the selected date and its resource details.
see also:
- CalendarSelectionDetails, which contains the details of the selected element in the calendar.
- CalendarElement, to know about the different available elements in the calendar.
- initialSelectedDate, to selected the date programmatically on calendar initially.
- CalendarController.selectedDate, to selected date programmatically on calendar in the runtime.
- selectionDecoration, to add decoration for the selected cell in calendar.
- onTap, the callback which notifies when the calendar elements tapped on view.
- Knowledge base: How to get the selected dates using the selection changed
return Container(
child: SfCalendar(
view: CalendarView.timelineDay,
onSelectionChanged: (CalendarSelectionDetails details){
DateTime date = details.date!;
CalendarResource resource = details.resource!;
},
),
);
}
Implementation
final CalendarSelectionChangedCallback? onSelectionChanged;