onDragUpdate method

  1. @override
bool onDragUpdate(
  1. DragUpdateEvent event
)
override

The user has moved the pointer that initiated the drag gesture.

This event will be delivered to the component(s) that captured the initial onDragStart, even if the point of touch moves outside of the boundaries of the component; the local coordinates simply fall outside the component's own bounds in that case.

The exception is when hit testing stops reaching the component altogether while it still holds the drag, for example if an ancestor turns on IgnoreEvents mid-gesture. It still receives the event, but with no rendering trace behind it, so reading event.localStartPosition, localEndPosition or localDelta throws. Use canvasStartPosition / canvasEndPosition if you need a position that is always available.

Implementation

@override
bool onDragUpdate(DragUpdateEvent event) {
  _unscaledDelta.add(event.localDelta);
  return false;
}