Skip to content

Allow access to MaterialStatesController in TextField and TextFormField #133273

@akvgergo

Description

@akvgergo

Is there an existing issue for this?

Use case

Currently there is no way to determine if a TextFormField is currently in an errored state, as in, it's showing an error message and using errorBorder. It's possible to determine whether it's focused, but only if we supply our own FocusNode. My specific use case
is displaying different colors and shadow on other UI elements, specifically on text and wrapper containers depending on the TextField's MaterialState.

Proposal

My proposal would be to allow us to supply our own MaterialStatesController (Similarly to ElevatedButton) so that we have full access to information regarding those Widgets' states.

Metadata

Metadata

Labels

P2Important issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions