selectWord method

void selectWord ({@required SelectionChangedCause cause })

Select a word around the location of the last tap down.

Implementation

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