isPointerAllowed method

  1. @override
bool isPointerAllowed (PointerDownEvent event)
override

Checks whether or not a pointer is allowed to be tracked by this recognizer.

Implementation

@override
bool isPointerAllowed(PointerDownEvent event) {
  switch (event.buttons) {
    case kPrimaryButton:
      if (onLongPressStart == null &&
          onLongPress == null &&
          onLongPressMoveUpdate == null &&
          onLongPressEnd == null &&
          onLongPressUp == null)
        return false;
      break;
    default:
      return false;
  }
  return super.isPointerAllowed(event);
}