getPositionForOffset abstract method

TextPosition getPositionForOffset(
  1. 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:


TextPosition getPositionForOffset(Offset offset);