hitTest method

  1. @override
bool hitTest(
  1. FlSpot spot,
  2. Offset touched,
  3. Offset center,
  4. double extraThreshold,
)
override

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

@override
bool hitTest(
  FlSpot spot,
  Offset touched,
  Offset center,
  double extraThreshold,
) {
  final distance = (touched - center).distance.abs();
  return distance < radius + extraThreshold;
}