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) {
final localPosition = _renderBox.globalToLocal(event.position);
if (event is PointerDownEvent) {
_pointerDownOffset = localPosition;
}
// Is current pointer move event
_pointerMoveOffset = localPosition;
/// Calls the callback function corresponding to the given event.
if (event is PointerDownEvent) onPointerDown(event);
if (event is PointerMoveEvent) {
final isRejectable = rejectByOffset(currentPointerOffset);
isRejectable ? reject() : onPointerMove(event);
}
if (event is PointerUpEvent) onPointerUp(event);
if (event is PointerCancelEvent) onPointerCancel(event);
}