contains method

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

Implementation

@override
bool contains(Offset position) {
  final int length = points.length;
  for (int i = 0; i < length; i++) {
    final Offset a = points[i];
    final Offset b = i + 1 < 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;
}