handlePrimaryPointer method

  1. @override
void handlePrimaryPointer (PointerEvent event)
override

Override to provide behavior for the primary pointer when the gesture is still possible.

Implementation

@override
void handlePrimaryPointer(PointerEvent event) {
  if (event is PointerUpEvent) {
    if (_longPressAccepted == true) {
      _checkLongPressEnd(event);
    } else {
      // Pointer is lifted before timeout.
      resolve(GestureDisposition.rejected);
    }
    _reset();
  } else if (event is PointerCancelEvent) {
    _reset();
  } else if (event is PointerDownEvent) {
    // The first touch.
    _longPressOrigin = OffsetPair.fromEventPosition(event);
    _initialButtons = event.buttons;
  } else if (event is PointerMoveEvent) {
    if (event.buttons != _initialButtons) {
      resolve(GestureDisposition.rejected);
      stopTrackingPointer(primaryPointer);
    } else if (_longPressAccepted) {
      _checkLongPressMoveUpdate(event);
    }
  }
}