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 && onLongPressUp != null) {
      _longPressAccepted = false;
      invokeCallback<void>('onLongPressUp', onLongPressUp);
    } else {
      resolve(GestureDisposition.rejected);
    }
  } else if (event is PointerDownEvent || event is PointerCancelEvent) {
    // the first touch, initialize the  flag with false
    _longPressAccepted = false;
  }
}