Skip to content

allow FormFieldState the option to not validate initially when autoValidate is True. #48876

Closed
@tjonganthony

Description

Use case

When FormFieldState has autoValidate as true, it will validate upon build.
See: https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/widgets/form.dart#L419

This is a different behaviour than FormState when autoValidate is set to true where each individual field won't be validated upon build.
However, even when FormState's autoValidate is set to true, if a FormField has autoValidate set to true, then that FormField will be validated upon build.

Proposal

Since this might be a breaking changes for people who depends on validation upon build, I suggest to add an option to opt out for validation upon build on FormFieldState.

However, if we are okay with breaking build, it would be better if we can standardise the behaviour between FormFieldState and FormState.

Metadata

Assignees

No one assigned

    Labels

    a: text inputEntering text in a text field or keyboard related problemsc: proposalA detailed proposal for a change to Flutterf: 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