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 (_initialButtons == null) {
    switch (event.buttons) {
      case kPrimaryButton:
        if (onSwipe == null && onCancel == null)
          return false;
        break;
      default:
        return false;
    }
  } else {
    // There can be multiple drags simultaneously. Their effects are combined.
    if (event.buttons != _initialButtons) {
      return false;
    }
  }
  return super.isPointerAllowed(event as PointerDownEvent);
}