moveSelectionLeft method Null safety

void moveSelectionLeft(
  1. SelectionChangedCause cause
)

Move the current selection left by one character.

The given SelectionChangedCause indicates the cause of this change and will be passed to onSelectionChanged.

See also:

Implementation

void moveSelectionLeft(SelectionChangedCause cause) {
  assert(selection != null);

  final TextSelection nextSelection = _moveGivenSelectionLeft(
    selection!,
    _plainText,
  );
  if (nextSelection == selection) {
    return;
  }
  _cursorResetLocation -= selection!.extentOffset - nextSelection.extentOffset;
  _setSelection(nextSelection, cause);
}