addAllowedPointer method
- PointerDownEvent event
override
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(PointerDownEvent event) {
// If the device has a maximum pressure of less than or equal to 1, it
// doesn't have touch pressure sensing capabilities. Do not participate
// in the gesture arena.
if (event.pressureMax <= 1.0) {
resolve(GestureDisposition.rejected);
} else {
super.addAllowedPointer(event);
if (_state == _ForceState.ready) {
_state = _ForceState.possible;
_lastPosition = OffsetPair.fromEventPosition(event);
}
}
}