Skip to content

Requesting TextFormField documentation updates #105603

@EnduringBeta

Description

@EnduringBeta

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

No one assigned

    Labels

    a: text inputEntering text in a text field or keyboard related problemsf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions