rejectByOffset method

bool rejectByOffset(
  1. Offset offset
)

Returns whether to reject the gesture based on the given pointer offset.

Implementation

bool rejectByOffset(Offset offset) {
  if (context.rejectBehavior == TouchRippleRejectBehavior.none) return false;
  if (context.rejectBehavior == TouchRippleRejectBehavior.leave) {
    return _renderBox?.hitTest(BoxHitTestResult(), position: offset) ?? true;
  }

  // is TouchRippleCancalBehavior.touchSlop
  return pointerMoveDistance.dx.abs() > kTouchSlop
      || pointerMoveDistance.dy.abs() > kTouchSlop;
}