Include advice about dispose in TextEditingController api (#33653)
* include advice about dispose The same note in https://flutter.dev/docs/cookbook/forms/text-field-changes * Include remember to dispose texteditingcontroller Almost the same note here https://flutter.dev/docs/cookbook/forms/text-field-changes#2-use-a-texteditingcontroller . * include remember to dispose TextEditingController and link to see also * remove extras spaces and duplicated comment * include details about using Positioned.fill * Revert "include details about using Positioned.fill" This reverts commit c06196f8884d20c547d97edae71d26f7a61701be. * rever comment about Positioned.fill * Include of and remove extra white space Include of and remove extra white space in the end of line * improve link description to cookbook /// * Learn how to use a [TextEditingController] in one of our [cookbook recipe]s.(https://flutter.dev/docs/cookbook/forms/text-field-changes#2-use-a-texteditingcontroller) * include of, remove extra white space and improve description link to cookbook. include of, remove extra white space and improve description link to cookbook. * include of, remove extra white space and improve link description to cookbook include of, remove extra white space and improve link description to cookbook * include of, remove extra white space and improve link description to cookbook include of, remove extra white space and improve link description to cookbook * remove extra white spaces * remove extra white space
This commit is contained in:
committed by
Kate Lovett
parent
f83df74b6b
commit
23174c34b1
@@ -117,6 +117,9 @@ enum OverlayVisibilityMode {
|
||||
/// rounded rectangle border around the text field. If you set the [decoration]
|
||||
/// property to null, the decoration will be removed entirely.
|
||||
///
|
||||
/// Remember to [dispose] of the [TextEditingController] when it is no longer needed.
|
||||
/// This will ensure we discard any resources used by the object.
|
||||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * <https://developer.apple.com/documentation/uikit/uitextfield>
|
||||
@@ -124,6 +127,7 @@ enum OverlayVisibilityMode {
|
||||
/// Design UI conventions.
|
||||
/// * [EditableText], which is the raw text editing control at the heart of a
|
||||
/// [TextField].
|
||||
/// * Learn how to use a [TextEditingController] in one of our [cookbook recipe]s.(https://flutter.dev/docs/cookbook/forms/text-field-changes#2-use-a-texteditingcontroller)
|
||||
class CupertinoTextField extends StatefulWidget {
|
||||
/// Creates an iOS-style text field.
|
||||
///
|
||||
|
||||
@@ -65,6 +65,9 @@ typedef InputCounterWidgetBuilder = Widget Function(
|
||||
/// To integrate the [TextField] into a [Form] with other [FormField] widgets,
|
||||
/// consider using [TextFormField].
|
||||
///
|
||||
/// Remember to [dispose] of the [TextEditingController] when it is no longer needed.
|
||||
/// This will ensure we discard any resources used by the object.
|
||||
///
|
||||
/// {@tool sample}
|
||||
/// This example shows how to create a [TextField] that will obscure input. The
|
||||
/// [InputDecoration] surrounds the field in a border using [OutlineInputBorder]
|
||||
@@ -91,6 +94,7 @@ typedef InputCounterWidgetBuilder = Widget Function(
|
||||
/// [TextField]. The [EditableText] widget is rarely used directly unless
|
||||
/// you are implementing an entirely different design language, such as
|
||||
/// Cupertino.
|
||||
/// * Learn how to use a [TextEditingController] in one of our [cookbook recipe]s.(https://flutter.dev/docs/cookbook/forms/text-field-changes#2-use-a-texteditingcontroller)
|
||||
class TextField extends StatefulWidget {
|
||||
/// Creates a Material Design text field.
|
||||
///
|
||||
|
||||
@@ -29,6 +29,9 @@ import 'theme.dart';
|
||||
/// If a [controller] is not specified, [initialValue] can be used to give
|
||||
/// the automatically generated controller an initial value.
|
||||
///
|
||||
/// Remember to [dispose] of the [TextEditingController] when it is no longer needed.
|
||||
/// This will ensure we discard any resources used by the object.
|
||||
///
|
||||
/// For a documentation about the various parameters, see [TextField].
|
||||
///
|
||||
/// {@tool sample}
|
||||
@@ -60,6 +63,7 @@ import 'theme.dart';
|
||||
/// integration.
|
||||
/// * [InputDecorator], which shows the labels and other visual elements that
|
||||
/// surround the actual text editing widget.
|
||||
/// * Learn how to use a [TextEditingController] in one of our [cookbook recipe]s.(https://flutter.dev/docs/cookbook/forms/text-field-changes#2-use-a-texteditingcontroller)
|
||||
class TextFormField extends FormField<String> {
|
||||
/// Creates a [FormField] that contains a [TextField].
|
||||
///
|
||||
|
||||
@@ -67,6 +67,8 @@ const int _kObscureShowLatestCharCursorTicks = 3;
|
||||
/// added to this controller. If both properties need to be changed then the
|
||||
/// controller's [value] should be set instead.
|
||||
///
|
||||
/// Remember to [dispose] of the [TextEditingController] when it is no longer needed.
|
||||
/// This will ensure we discard any resources used by the object.
|
||||
/// {@tool snippet --template=stateful_widget_material}
|
||||
/// This example creates a [TextField] with a [TextEditingController] whose
|
||||
/// change listener forces the entered text to be lower case and keeps the
|
||||
@@ -113,6 +115,7 @@ const int _kObscureShowLatestCharCursorTicks = 3;
|
||||
/// with a [TextEditingController].
|
||||
/// * [EditableText], which is a raw region of editable text that can be
|
||||
/// controlled with a [TextEditingController].
|
||||
/// * Learn how to use a [TextEditingController] in one of our [cookbook recipe]s.(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.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user