addAllowedPointer method
Registers a new pointer that's been checked to be allowed by this gesture recognizer.
Subclasses of GestureRecognizer are supposed to override this method instead of addPointer because addPointer will be called for each pointer being added while addAllowedPointer is only called for pointers that are allowed by this recognizer.
Implementation
@override
void addAllowedPointer(PointerEvent event) {
startTrackingPointer(event.pointer, event.transform);
_velocityTrackers[event.pointer] = velocityTrackerBuilder(event);
if (_state == _SwipeState.ready) {
_state = _SwipeState.possible;
_initialPosition = OffsetPair(global: event.position, local: event.localPosition);
_initialButtons = event.buttons;
_pendingDragOffset = OffsetPair.zero;
_globalHorizontalDistanceMoved = 0.0;
_globalVerticalDistanceMoved= 0.0;
} else if (_state == _SwipeState.accepted) {
resolve(GestureDisposition.accepted);
}
}