Defer to TextField in TextFormField docs (#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 #7245
This commit is contained in:
Adam Barth 2017-04-03 20:58:32 -07:00 committed by GitHub
parent f00b3a4b06
commit d88ff90753

View File

@ -18,6 +18,8 @@ import 'text_field.dart';
/// pass a [GlobalKey] to the constructor and use [GlobalKey.currentState] to /// pass a [GlobalKey] to the constructor and use [GlobalKey.currentState] to
/// save or reset the form field. /// save or reset the form field.
/// ///
/// For a documentation about the various parameters, see [TextField].
///
/// See also: /// See also:
/// ///
/// * <https://material.google.com/components/text-fields.html> /// * <https://material.google.com/components/text-fields.html>
@ -26,6 +28,9 @@ import 'text_field.dart';
/// * [InputDecorator], which shows the labels and other visual elements that /// * [InputDecorator], which shows the labels and other visual elements that
/// surround the actual text editing widget. /// surround the actual text editing widget.
class TextFormField extends FormField<String> { class TextFormField extends FormField<String> {
/// Creates a [FormField] that contains a [TextField].
///
/// For a documentation about the various parameters, see [TextField].
TextFormField({ TextFormField({
Key key, Key key,
TextEditingController controller, TextEditingController controller,
@ -53,9 +58,7 @@ class TextFormField extends FormField<String> {
autofocus: autofocus, autofocus: autofocus,
obscureText: obscureText, obscureText: obscureText,
maxLines: maxLines, maxLines: maxLines,
onChanged: (String value) { onChanged: field.onChanged,
field.onChanged(value);
},
); );
}, },
); );