moveCursorRight method

void moveCursorRight()

Move cursor right

Implementation

void moveCursorRight() {
  if (!_selection.isCollapsed) {
    // If text is selected, jump to the end of the selection block
    _selection = TextSelection.collapsed(offset: _selection.end);
    notifyListeners();
    return;
  }

  final offset = _selection.baseOffset;
  if (offset < _text.length) {
    _selection = TextSelection.collapsed(offset: offset + 1);
    notifyListeners();
  }
}