Skip to content

Commit 2d422a3

Browse files
authored
Small fixes in TextEditingController docs (#143717)
This follows up on #143452, to slightly further address #95978. The double- rather than triple-slash on the blank line caused it to be ignored by dartdoc, so that the two paragraphs it's intended to separate were getting joined as one paragraph instead. Also expand this constructor's summary line slightly to mention its distinctive feature compared with the other constructor, and make other small fixes that I noticed in other docs on this class.
1 parent f2eea96 commit 2d422a3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ class _RenderCompositionCallback extends RenderProxyBox {
173173
/// between the framework and the input method. Consider using
174174
/// [TextInputFormatter]s instead for as-you-type text modification.
175175
///
176-
/// If both the [text] or [selection] properties need to be changed, set the
176+
/// If both the [text] and [selection] properties need to be changed, set the
177177
/// controller's [value] instead.
178178
///
179179
/// Remember to [dispose] of the [TextEditingController] when it is no longer
@@ -195,7 +195,7 @@ class _RenderCompositionCallback extends RenderProxyBox {
195195
/// controlled with a [TextEditingController].
196196
/// * Learn how to use a [TextEditingController] in one of our [cookbook recipes](https://flutter.dev/docs/cookbook/forms/text-field-changes#2-use-a-texteditingcontroller).
197197
class TextEditingController extends ValueNotifier<TextEditingValue> {
198-
/// Creates a controller for an editable text field.
198+
/// Creates a controller for an editable text field, with no initial selection.
199199
///
200200
/// This constructor treats a null [text] argument as if it were the empty
201201
/// string.
@@ -206,7 +206,7 @@ class TextEditingController extends ValueNotifier<TextEditingValue> {
206206
/// selection is not valid, the text field will update the selection when it
207207
/// is focused (the selection will be an empty selection positioned at the
208208
/// end of the text).
209-
//
209+
///
210210
/// Consider using [TextEditingController.fromValue] to initialize both the
211211
/// text and the selection.
212212
///
@@ -293,7 +293,7 @@ class TextEditingController extends ValueNotifier<TextEditingValue> {
293293
);
294294
}
295295

296-
/// The currently selected [text].
296+
/// The currently selected range within [text].
297297
///
298298
/// If the selection is collapsed, then this property gives the offset of the
299299
/// cursor within the text.

0 commit comments

Comments
 (0)