hitTest method
Implementation
@override
bool hitTest(Offset point) {
if (startPoint == null) return false;
const tolerance = 5.0;
return (point.dy - startPoint!.dy).abs() <= tolerance &&
((direction! > 0 && point.dx >= startPoint!.dx) ||
(direction! < 0 && point.dx <= startPoint!.dx));
}