getPositionForPoint method Null safety

TextPosition getPositionForPoint(
  1. Offset globalPosition
)

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

See also:

Implementation

TextPosition getPositionForPoint(Offset globalPosition) {
  _computeTextMetricsIfNeeded();
  globalPosition += -_paintOffset;
  return _textPainter.getPositionForOffset(globalToLocal(globalPosition));
}