onTap property Null safety
final
Called whenever the SfCalendar elements tapped on view.
The tapped date, appointments, and element details when the tap action performed on element available in the CalendarTapDetails.
see also:
- CalendarTapDetails, which contains the details of the tapped 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.
- onSelectionChanged, the callback which notifies when the selected cell changed on calendar.
- Knowledge base: How to get appointment details for the onTap
- Knowledge base: How to add a special region dynamically using onTap, onViewChanged
- Knowledge base: How to interact with event calendar with appointments loaded
- Knowledge base: How to add the appointments using the onTap
- Knowledge base: How to design and configure your appointment editor
return Container(
child: SfCalendar(
view: CalendarView.week,
onTap: (CalendarTapDetails details){
DateTime date = details.date!;
dynamic appointments = details.appointments;
CalendarElement view = details.targetElement;
},
),
);
}
Implementation
final CalendarTapCallback? onTap;