handleSelectAll method Null safety

void handleSelectAll(
  1. TextSelectionDelegate delegate
)

Adjust the selection of the text field managed by the given delegate so that everything is selected.

Does not hide the toolbar.

This is called by subclasses when their select-all affordance is activated by the user.

Implementation

void handleSelectAll(TextSelectionDelegate delegate) {
  delegate.userUpdateTextEditingValue(
    TextEditingValue(
      text: delegate.textEditingValue.text,
      selection: TextSelection(
        baseOffset: 0,
        extentOffset: delegate.textEditingValue.text.length,
      ),
    ),
    SelectionChangedCause.toolBar,
  );
  delegate.bringIntoView(delegate.textEditingValue.selection.extent);
}