contains method

  1. @override
bool contains(
  1. Offset position
)
override

Implementation

@override
bool contains(Offset position) {
  for (int i = 0; i < points.length; i++) {
    final Offset a = points[i];
    final Offset b = i + 1 < points.length ? points[i + 1] : a;
    final Rect rect = Rect.fromPoints(a, b);
    final Rect paddedRect = rect.inflate(tooltipPadding);
    if (paddedRect.contains(position)) {
      return true;
    }
    i++;
  }
  return false;
}