getPositionForOffset abstract method
- Offset offset
Returns the text position closest to the given offset.
This method always returns a TextPosition for any given offset
, even
when the offset
is not close to any text, or when the paragraph is empty.
This is useful for determining the text to select when the user drags the
text selection handle.
See also:
- getClosestGlyphInfoForOffset, which returns more information about the closest character to an Offset.
Implementation
TextPosition getPositionForOffset(Offset offset);