setValue method

String setValue(
  1. String? text
)

Implementation

String setValue(String? text) {
  String newValue = sanitizeValue(text);
  TextRange composing = _textSelectionDelegate._textEditingValue.composing;
  TextSelection selection = TextSelection.collapsed(offset: newValue.length);
  TextEditingValue newTextEditingValue = TextEditingValue(
    text: newValue,
    selection: selection,
    composing: composing,
  );
  _formatAndSetValue(newTextEditingValue);
  return newValue;
}