Skip to content

Commit d88ff90

Browse files
authored
Defer to TextField in TextFormField docs (flutter#9144)
TextFormField doesn't actually have many properties because it wraps a TextField. Rather than trying to document all the arguments in the constructor, we now refer to the docs for TextField, which explain the parameters in a more readable way. Fixes flutter#7245
1 parent f00b3a4 commit d88ff90

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

+6-3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import 'text_field.dart';
1818
/// pass a [GlobalKey] to the constructor and use [GlobalKey.currentState] to
1919
/// save or reset the form field.
2020
///
21+
/// For a documentation about the various parameters, see [TextField].
22+
///
2123
/// See also:
2224
///
2325
/// * <https://material.google.com/components/text-fields.html>
@@ -26,6 +28,9 @@ import 'text_field.dart';
2628
/// * [InputDecorator], which shows the labels and other visual elements that
2729
/// surround the actual text editing widget.
2830
class TextFormField extends FormField<String> {
31+
/// Creates a [FormField] that contains a [TextField].
32+
///
33+
/// For a documentation about the various parameters, see [TextField].
2934
TextFormField({
3035
Key key,
3136
TextEditingController controller,
@@ -53,9 +58,7 @@ class TextFormField extends FormField<String> {
5358
autofocus: autofocus,
5459
obscureText: obscureText,
5560
maxLines: maxLines,
56-
onChanged: (String value) {
57-
field.onChanged(value);
58-
},
61+
onChanged: field.onChanged,
5962
);
6063
},
6164
);

0 commit comments

Comments
 (0)