TextField.onChanged() doc update (#25473)

This commit is contained in:
Hans Muller 2018-12-18 09:03:57 -08:00 committed by GitHub
parent cbb168e7b9
commit 9b6229ab56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 1 deletions

View file

@ -297,6 +297,13 @@ class TextField extends StatefulWidget {
final bool maxLengthEnforced;
/// {@macro flutter.widgets.editableText.onChanged}
///
/// See also:
///
/// * [inputFormatters], which are called before [onChanged]
/// runs and can validate and change ("format") the input value.
/// * [onEditingComplete], [onSubmitted], [onSelectionChanged]:
/// which are more specialized input change notifications.
final ValueChanged<String> onChanged;
/// {@macro flutter.widgets.editableText.onEditingComplete}

View file

@ -374,8 +374,25 @@ class EditableText extends StatefulWidget {
final TextInputAction textInputAction;
/// {@template flutter.widgets.editableText.onChanged}
/// Called when the text being edited changes.
/// Called when the user initiates a change to the TextField's
/// value: when they have inserted or deleted text.
///
/// This callback does run not when the TextField's text is changed
/// programmatically, via the TextField's [controller]. Typically it
/// isn't necessary to be notified of such changes, since they're
/// initiated by the app itself.
///
/// To be notified of all changes to the TextField's text, cursor,
/// and selection, one can add a listener to its [controller] with
/// [TextEditingController.addListener].
/// {@endtemplate}
///
/// See also:
///
/// * [inputFormatters], which are called before [onChanged]
/// runs and can validate and change ("format") the input value.
/// * [onEditingComplete], [onSubmitted], [onSelectionChanged]:
/// which are more specialized input change notifications.
final ValueChanged<String> onChanged;
/// {@template flutter.widgets.editableText.onEditingComplete}