-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.
Description
I've already made the code changes on my fork, but the guidance says to have an issue, so here it is!
Multiple times I have tried to use TextFormField without a form but while keeping validation. The docs say this is possible, but one key piece of information isn't there that I'm probably not the only one to miss repeatedly.
To use without a Form, pass a GlobalKey to the constructor and use GlobalKey.currentState to save or reset the form field.
Namely, the GlobalKey used for the widget seems to need to be of type <FormFieldState>. Otherwise you don't have access to validate(), save(), reset(), etc.
I also noticed the use of "we" in there, which doesn't follow passive voice guidance.
Metadata
Metadata
Assignees
Labels
a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.