onLongPress property
Called whenever the SfCalendar elements long pressed on view.
The long-pressed date, appointments, and element details when the long-press action performed on element available in the CalendarLongPressDetails.
see also:
- CalendarLongPressDetails, which contains the details of the long pressed element in the calendar.
- CalendarElement, to know about the different available elements in the calendar.
- 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 handle the long press action
return Container(
child: SfCalendar(
view: CalendarView.week,
onLongPress: (CalendarLongPressDetails details){
DateTime date = details.date!;
dynamic appointments = details.appointments;
CalendarElement view = details.targetElement;
},
),
);
}
Implementation
final CalendarLongPressCallback? onLongPress;