handleEvent method

  1. @override
void handleEvent(
  1. PointerEvent event
)
override

Called when a pointer event is routed to this recognizer.

This will be called for every pointer event while the pointer is being tracked. Typically, this recognizer will start tracking the pointer in addAllowedPointer, which means that handleEvent will be called starting with the PointerDownEvent that was passed to addAllowedPointer.

See also:

Implementation

@override
void handleEvent(PointerEvent event) {
  if (event is PointerMoveEvent) {
    onPanUpdate(event.position);
  }
  if (event is PointerUpEvent) {
    onPanEnd(event.position);
    stopTrackingPointer(event.pointer);
  }
}