hitTest method

bool hitTest(
  1. Rect rect,
  2. Offset position, {
  3. TextDirection? textDirection,
})

Tests whether the outer boundary of this border contains position.

The position must be in the same coordinate space as rect. The default implementation checks position against the path returned by getOuterPath.

The textDirection argument must be provided and non-null if the border has a text direction dependency. It may be null if the border will not need the text direction to describe its geometry.

See also:

Implementation

bool hitTest(Rect rect, Offset position, {TextDirection? textDirection}) {
  return getOuterPath(rect, textDirection: textDirection).contains(position);
}