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 (onTapDown == null &&
          onTap == null &&
          onTapUp == null &&
          onTapCancel == null)
        return false;
      break;
    case kSecondaryButton:
      if (onSecondaryTapDown == null &&
          onSecondaryTapUp == null &&
          onSecondaryTapCancel == null)
        return false;
      break;
    default:
      return false;
  }
  return super.isPointerAllowed(event);
}