getPositionForPoint method

TextPosition getPositionForPoint (
  1. Offset globalPosition
)

Returns the position in the text for the given global coordinate.

See also:

Implementation

TextPosition getPositionForPoint(Offset globalPosition) {
  _layoutText(minWidth: constraints.minWidth, maxWidth: constraints.maxWidth);
  globalPosition += -_paintOffset;
  return _textPainter.getPositionForOffset(globalToLocal(globalPosition));
}