selectPosition method

void selectPosition ({@required SelectionChangedCause cause })

Move selection to the location of the last tap down.

Implementation

void selectPosition({@required SelectionChangedCause cause}) {
  assert(cause != null);
  _layoutText(constraints.maxWidth);
  assert(_lastTapDownPosition != null);
  if (onSelectionChanged != null) {
    final TextPosition position = _textPainter.getPositionForOffset(globalToLocal(_lastTapDownPosition));
    onSelectionChanged(TextSelection.fromPosition(position), this, cause);
  }
}