isPointerAllowed method
- 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 (onLongPressDown == null &&
onLongPressCancel == null &&
onLongPressStart == null &&
onLongPress == null &&
onLongPressMoveUpdate == null &&
onLongPressEnd == null &&
onLongPressUp == null) {
return false;
}
case kSecondaryButton:
if (onSecondaryLongPressDown == null &&
onSecondaryLongPressCancel == null &&
onSecondaryLongPressStart == null &&
onSecondaryLongPress == null &&
onSecondaryLongPressMoveUpdate == null &&
onSecondaryLongPressEnd == null &&
onSecondaryLongPressUp == null) {
return false;
}
case kTertiaryButton:
if (onTertiaryLongPressDown == null &&
onTertiaryLongPressCancel == null &&
onTertiaryLongPressStart == null &&
onTertiaryLongPress == null &&
onTertiaryLongPressMoveUpdate == null &&
onTertiaryLongPressEnd == null &&
onTertiaryLongPressUp == null) {
return false;
}
default:
return false;
}
return super.isPointerAllowed(event);
}