moveSelectionToEnd method Null safety

void moveSelectionToEnd(
  1. SelectionChangedCause cause
)

Move the current selection to the end of the field.

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

See also:

Implementation

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

  if (selection!.isCollapsed && selection!.extentOffset == _plainText.length) {
    return;
  }
  final TextSelection nextSelection = TextSelection.collapsed(
    offset: _plainText.length,
  );
  _setSelection(nextSelection, cause);
}