handleEvent method

  1. @override
void handleEvent (PointerEvent event)
override

Called when a pointer event is routed to this recognizer.

Implementation

@override
void handleEvent(PointerEvent event) {
  assert(state != GestureRecognizerState.ready);
  if (state == GestureRecognizerState.possible && event.pointer == primaryPointer) {
    // TODO(abarth): Maybe factor the slop handling out into a separate class?
    if (event is PointerMoveEvent && _getDistance(event) > kTouchSlop) {
      resolve(GestureDisposition.rejected);
      stopTrackingPointer(primaryPointer);
    } else {
      handlePrimaryPointer(event);
    }
  }
  stopTrackingIfPointerNoLongerDown(event);
}