Skip to content

Commit b46d414

Browse files
Reference the build docs instead of restating them on TextEditingController.text
1 parent 63acd5d commit b46d414

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -277,17 +277,18 @@ class TextEditingController extends ValueNotifier<TextEditingValue> {
277277
/// reasonable selection range within the new [text].
278278
///
279279
/// Setting this notifies all the listeners of this [TextEditingController]
280-
/// that they need to update (it calls [notifyListeners]), so it should only
281-
/// be set between frames, e.g. in response to user actions, and not during
282-
/// the build, layout, or paint phases: the framework does not allow widgets
283-
/// to be marked as needing to build during those phases, and throws an
284-
/// exception when a listener attempts it.
285-
///
286-
/// This property can be set from a listener added to this
287-
/// [TextEditingController].
280+
/// that they need to update (it calls [notifyListeners]). For this reason,
281+
/// this value should only be set between frames, e.g. in response to user
282+
/// actions, not during the build, layout, or paint phases. This property can
283+
/// be set from a listener added to this [TextEditingController].
288284
///
289285
/// Setting this does not run [TextInputFormatter]s. Apply them manually if
290286
/// needed.
287+
///
288+
/// See also:
289+
///
290+
/// * [StatelessWidget.build], which explains why a build method must not
291+
/// have side effects such as setting this value.
291292
set text(String newText) {
292293
value = value.copyWith(
293294
text: newText,

0 commit comments

Comments
 (0)