text property

String text

The current string the user is editing.

Implementation

String get text => value.text;
void text= (String newText)

Setting this will notify all the listeners of this TextEditingController that they need to update (it calls notifyListeners). For this reason, this value should only be set between frames, e.g. in response to user actions, not during the build, layout, or paint phases.

Implementation

set text(String newText) {
  value = value.copyWith(text: newText,
                         selection: const TextSelection.collapsed(offset: -1),
                         composing: TextRange.empty);
}