mirror of
https://github.com/flutter/flutter
synced 2024-10-14 04:02:56 +00:00
Docs explaining how to avoid the problem of height toggling with error (#29811)
Documentation that explains a common use case seen in Github issues where users were surprised by TextFormField growth to accommodate validation messages.
This commit is contained in:
parent
673e989230
commit
ed9509697c
|
@ -288,6 +288,13 @@ class FormField<T> extends StatefulWidget {
|
|||
/// The returned value is exposed by the [FormFieldState.errorText] property.
|
||||
/// The [TextFormField] uses this to override the [InputDecoration.errorText]
|
||||
/// value.
|
||||
///
|
||||
/// Alternating between error and normal state can cause the height of the
|
||||
/// [TextFormField] to change if no other subtext decoration is set on the
|
||||
/// field. To create a field whose height is fixed regardless of whether or
|
||||
/// not an error is displayed, either wrap the [TextFormField] in a fixed
|
||||
/// height parent like [SizedBox], or set the [TextFormField.helperText]
|
||||
/// parameter to a space.
|
||||
final FormFieldValidator<T> validator;
|
||||
|
||||
/// Function that returns the widget representing this form field. It is
|
||||
|
|
Loading…
Reference in a new issue