selectAll method Null safety

  1. @override
void selectAll(
  1. SelectionChangedCause cause
)
override

Select the entire text value.

Implementation

@override
void selectAll(SelectionChangedCause cause) {
  if (widget.readOnly && widget.obscureText) {
    // If we can't modify it, and we can't copy it, there's no point in
    // selecting it.
    return;
  }
  userUpdateTextEditingValue(
    textEditingValue.copyWith(
      selection: TextSelection(baseOffset: 0, extentOffset: textEditingValue.text.length),
    ),
    cause,
  );
  if (cause == SelectionChangedCause.toolbar) {
    bringIntoView(textEditingValue.selection.extent);
  }
}