getTextPositionBelow method

  1. @override
TextPosition getTextPositionBelow(
  1. TextPosition position

Returns the TextPosition below the given offset into the text.

If the offset is already on the last line, the given offset will be returned.


TextPosition getTextPositionBelow(TextPosition position) {
  // The caret offset gives a location in the upper left hand corner of
  // the caret so the middle of the line above is a half line above that
  // point and the line below is 1.5 lines below that point.
  final double preferredLineHeight = _textPainter.preferredLineHeight;
  final double verticalOffset = 1.5 * preferredLineHeight;
  return _getTextPositionVertical(position, verticalOffset);