deleteForward method

void deleteForward()

Deletes the character after the cursor (delete key).

Implementation

void deleteForward() {
  if (hasSelection) {
    deleteSelection();
    return;
  }
  if (_cursorPosition < _text.length) {
    _text = _text.substring(0, _cursorPosition) +
        _text.substring(_cursorPosition + 1);
    notifyListeners();
  }
}