Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0a06644

Browse files
Clarify that inputFormatters don't run on programmatical changes (#106904)
1 parent 78b38b7 commit 0a06644

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

packages/flutter/lib/src/painting/text_style.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ class TextStyle with Diagnosticable {
504504
/// style (e.g., in a [TextSpan] tree).
505505
///
506506
/// If this is false, properties that don't have explicit values will revert
507-
/// to the defaults: white in color, a font size of 10 pixels, in a sans-serif
507+
/// to the defaults: white in color, a font size of 14 pixels, in a sans-serif
508508
/// font face.
509509
final bool inherit;
510510

packages/flutter/lib/src/widgets/editable_text.dart

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,8 @@ class EditableText extends StatefulWidget {
10701070
/// runs and can validate and change ("format") the input value.
10711071
/// * [onEditingComplete], [onSubmitted], [onSelectionChanged]:
10721072
/// which are more specialized input change notifications.
1073+
/// * [TextEditingController], which implements the [Listenable] interface
1074+
/// and notifies its listeners on [TextEditingValue] changes.
10731075
final ValueChanged<String>? onChanged;
10741076

10751077
/// {@template flutter.widgets.editableText.onEditingComplete}
@@ -1133,9 +1135,16 @@ class EditableText extends StatefulWidget {
11331135
/// {@template flutter.widgets.editableText.inputFormatters}
11341136
/// Optional input validation and formatting overrides.
11351137
///
1136-
/// Formatters are run in the provided order when the text input changes. When
1137-
/// this parameter changes, the new formatters will not be applied until the
1138-
/// next time the user inserts or deletes text.
1138+
/// Formatters are run in the provided order when the user changes the text
1139+
/// this widget contains. When this parameter changes, the new formatters will
1140+
/// not be applied until the next time the user inserts or deletes text.
1141+
/// Similar to the [onChanged] callback, formatters don't run when the text is
1142+
/// changed programmatically via [controller].
1143+
///
1144+
/// See also:
1145+
///
1146+
/// * [TextEditingController], which implements the [Listenable] interface
1147+
/// and notifies its listeners on [TextEditingValue] changes.
11391148
/// {@endtemplate}
11401149
final List<TextInputFormatter>? inputFormatters;
11411150

0 commit comments

Comments
 (0)