handleEvent method
Defines the values needed to process the gesture and calls the callback function corresponding to the given event.
Will reject the gesture on its own, constantly referencing whether it must be rejected when pointer moved.
Implementation
@override
void handleEvent(PointerEvent event) {
// Ignores right mouse button click events if only the left button is desired.
if (onlyMainButton && event.buttons == kSecondaryMouseButton) {
return reject();
}
if (event is PointerDownEvent) _pointerDownOffset = event.localPosition;
if (event is PointerMoveEvent) _pointerMoveOffset = event.localPosition;
// Calls the callback function corresponding to the given event.
if (event is PointerDownEvent) onPointerDown(event);
if (event is PointerMoveEvent) {
if (rejectByOffset(currentPointerOffset)) {
reject();
} else {
onPointerMove(event);
}
}
if (event is PointerUpEvent) onPointerUp(event);
if (event is PointerCancelEvent) onPointerCancel(event);
}