hitTest method

  1. @override
bool hitTest(
  1. Offset point
)
override

Implementation

@override
bool hitTest(Offset point) {
  if (yPosition == null || centerX == null) return false;
  const tolerance = 5.0;
  // 检测点击是否在射线上(从centerX到右边界)
  return (point.dy - yPosition!).abs() <= tolerance &&
      point.dx >= centerX! - tolerance;
}