Skip to content

Commit 3e14f18

Browse files
authored
Docs on TextField disposed by a scrollable (#148149)
Includes docs about the need to manually maintain a TextEditingController when using TextField in a ListView.builder (which was already documented on TextFormField).
1 parent 1d6ab6f commit 3e14f18

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/flutter/lib/src/material/text_field.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,15 @@ class _TextFieldSelectionGestureDetectorBuilder extends TextSelectionGestureDete
126126
/// disposed.
127127
/// {@endtemplate}
128128
///
129-
/// Remember to call [TextEditingController.dispose] of the [TextEditingController]
129+
/// Remember to call [TextEditingController.dispose] on the [TextEditingController]
130130
/// when it is no longer needed. This will ensure we discard any resources used
131131
/// by the object.
132132
///
133+
/// If this field is part of a scrolling container that lazily constructs its
134+
/// children, like a [ListView] or a [CustomScrollView], then a [controller]
135+
/// should be specified. The controller's lifetime should be managed by a
136+
/// stateful widget ancestor of the scrolling container.
137+
///
133138
/// ## Obscured Input
134139
///
135140
/// {@tool dartpad}

0 commit comments

Comments
 (0)