isPointerAllowed method

  1. @override
bool isPointerAllowed(
  1. PointerEvent event
)
override

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

Implementation

@override
bool isPointerAllowed(PointerEvent event) {
  if (_primaryPointer == null) {
    switch (event.buttons) {
      case kPrimaryButton:
        if (onTapDown == null &&
            onDragStart == null &&
            onDragUpdate == null &&
            onDragEnd == null &&
            onTapUp == null &&
            onCancel == null) {
          return false;
        }
      default:
        return false;
    }
  } else {
    if (event.pointer != _primaryPointer) {
      return false;
    }
  }

  return super.isPointerAllowed(event as PointerDownEvent);
}