hitTest method
Used to implement touch behaviour of this dot, for example, it behaves like a square of getSize Check FlDotCirclePainter.hitTest for an example of an implementation
Implementation
bool hitTest(
FlSpot spot,
Offset touched,
Offset center,
double extraThreshold,
) {
final size = getSize(spot);
final spotRect = Rect.fromCenter(
center: center,
width: size.width,
height: size.height,
);
final thresholdRect = spotRect.inflate(extraThreshold);
return thresholdRect.contains(touched);
}