onDragCancel method

  1. @mustCallSuper
void onDragCancel(
  1. DragCancelEvent event
)

The drag was cancelled.

Unlike onDragEnd, a cancellation is not the natural end of a gesture: it happens when the drag is interrupted (another recognizer wins the gesture arena, a second pointer triggers a scale takeover, a system event, etc.), so it carries no meaningful velocity. The default implementation only resets the drag state. Override this and call onDragEnd(event.toDragEnd()) yourself if you want a cancellation handled identically to a natural drag end.

Implementation

@mustCallSuper
void onDragCancel(DragCancelEvent event) {
  _isDragged = false;
}