onDragUpdate property

AppointmentDragUpdateCallback? onDragUpdate
final

Called whenever the appointment is dragging in the SfCalendar.

The callback arguments contains the dragging appointment, dragging time, dragging offset, source resource and target resource details.

Widget build(BuildContext context) {
  return Scaffold(
    body: SfCalendar(
        view: CalendarView.month,
        showWeekNumber: true,
        allowDragAndDrop: true,
        dragAndDropSettings: DragAndDropSettings(
          allowNavigation: true,
          allowScroll: true,
          autoNavigateDelay: Duration(seconds: 1),
          indicatorTimeFormat: 'HH:mm a',
          showTimeIndicator: true,
        ),
        onDragUpdate: (AppointmentDragUpdateDetails details) {
          dynamic appointment = details.appointment!;
          CalendarResource? sourceResource = details.sourceResource;
          CalendarResource? targetResource = details.targetResource;
          Offset? draggingPosition = details.draggingPosition;
          DateTime? draggingTime = details.draggingTime;
        }),
  );
}

Implementation

final AppointmentDragUpdateCallback? onDragUpdate;