hasPointInRange static method

bool hasPointInRange(
  1. RRect focusedRRect,
  2. Rect textRect
)

Checks if a point represented by a rectangle is within the range of another rounded rectangle.

focusedRRect The rounded rectangle representing the focus area. textRect The rectangle representing the text area.. Returns true if the point represented by textRect is within focusedRRect, otherwise false.

Implementation

static bool hasPointInRange(RRect focusedRRect, Rect textRect) {
  final double minX = focusedRRect.left;
  final double maxX = focusedRRect.right;
  if (textRect.left < minX || textRect.right > maxX) {
    return false;
  }
  final double minY = focusedRRect.top;
  final double maxY = focusedRRect.bottom;
  if (textRect.top < minY || textRect.bottom > maxY) {
    return false;
  }
  return true;
}