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.
This commit is contained in:
Greg Price 2024-02-19 21:49:05 -08:00 committed by GitHub
parent f2eea969f7
commit 2d422a3261
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -173,7 +173,7 @@ class _RenderCompositionCallback extends RenderProxyBox {
/// between the framework and the input method. Consider using
/// [TextInputFormatter]s instead for as-you-type text modification.
///
/// If both the [text] or [selection] properties need to be changed, set the
/// If both the [text] and [selection] properties need to be changed, set the
/// controller's [value] instead.
///
/// Remember to [dispose] of the [TextEditingController] when it is no longer
@ -195,7 +195,7 @@ class _RenderCompositionCallback extends RenderProxyBox {
/// controlled with a [TextEditingController].
/// * 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).
class TextEditingController extends ValueNotifier<TextEditingValue> {
/// Creates a controller for an editable text field.
/// Creates a controller for an editable text field, with no initial selection.
///
/// This constructor treats a null [text] argument as if it were the empty
/// string.
@ -206,7 +206,7 @@ class TextEditingController extends ValueNotifier<TextEditingValue> {
/// selection is not valid, the text field will update the selection when it
/// is focused (the selection will be an empty selection positioned at the
/// end of the text).
//
///
/// Consider using [TextEditingController.fromValue] to initialize both the
/// text and the selection.
///
@ -293,7 +293,7 @@ class TextEditingController extends ValueNotifier<TextEditingValue> {
);
}
/// The currently selected [text].
/// The currently selected range within [text].
///
/// If the selection is collapsed, then this property gives the offset of the
/// cursor within the text.