The previous auto validation API for the `Form` and `FormField` widgets didn't control when auto validation should occur. So the auto validation for these widgets always happened on first build when the widget was first visible to the user, and you weren't able to control when the auto validation should happen.
Original behavior
Due to the original API not allowing developers to change the auto validation behavior for validating only when the user interacts with the form field, we added new API that allows developers to configure how they want auto validation to behave for the `Form` and `FormField` widgets.
New behavior
The following changes were made:
- Who is affected
- Applications and packages relying on the previous behaviour or signature. Code that uses Form, FormField, AutovalidateMode.
- Practical impact
- Behaviour or API differences that can break builds or change runtime behaviour.
- What action should I take?
- Follow the official migration guide below, update affected call sites, run `dart fix --apply` where a fix is available, then run your tests.
Before and after (from the official guide)
| 1 | class MyWidget extends StatelessWidget { | |
| 2 | @override | |
| 3 | Widget build(BuildContext context) { | |
| 4 | return FormField( | |
| 5 | − | autovalidate: true, |
| 6 | builder: (FormFieldState state) { | |
| 7 | return Container(); | |
| 8 | }, | |
| 9 | ); | |
| 10 | } | |
| 11 | } |
| 1 | class MyWidget extends StatelessWidget { | |
| 2 | @override | |
| 3 | Widget build(BuildContext context) { | |
| 4 | return FormField( | |
| 5 | + | autovalidateMode: AutovalidateMode.always, |
| 6 | builder: (FormFieldState state) { | |
| 7 | return Container(); | |
| 8 | }, | |
| 9 | ); | |
| 10 | } | |
| 11 | } |
Raw before / after
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return FormField(
autovalidate: true,
builder: (FormFieldState state) {
return Container();
},
);
}
}class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return FormField(
autovalidateMode: AutovalidateMode.always,
builder: (FormFieldState state) {
return Container();
},
);
}
}Official migration guide (excerpt, © The Flutter Authors, CC BY 3.0)
To migrate to the new auto validation API you need to
replace the usage of the deprecated autovalidate
parameter to the new autovalidateMode parameter.
If you want the same behavior as before you can use:
autovalidateMode = AutovalidateMode.always.
This makes your Form and FormField widgets auto
validate on first build and every time it changes.
Code before migration:
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return FormField(
autovalidate: true,
builder: (FormFieldState state) {
return Container();
},
);
}
}Code after migration:
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return FormField(
autovalidateMode: AutovalidateMode.always,
builder: (FormFieldState state) {
return Container();
},
);
}
}AI_PROVIDER (for example to openai-compatible with a local Ollama or LM Studio endpoint) to enable grounded explanations. Everything else on this page works without an AI provider.Listed in the official breaking-changes index (docs.flutter.dev/release/breaking-changes).
An official announcement or migration guide documents an intended behaviour or API change. A verified source change (git diff) shows code changed but does not by itself prove a public API is breaking. AI interpretations are labelled and never used to classify a change.
- Official migration guide
- AutovalidateMode
- Issue 56363
- Issue 18885
- Issue 15404
- Issue 36154
- Issue 48876
- PR 56365: FormField should autovalidate only if its content was changed
- PR 59766: FormField should autovalidate only if its content was changed (fixed)
- Source commit
- b3045439b7c0
- Source last updated
- Oct 21, 2026
- Last synchronized
- Oct 21, 2026
- Publication status
- published
Publication history
- Oct 21, 2026, 8:31 PM: new → published (ingestion) — Backed by an official breaking-change/migration guide.
AI_PROVIDER (for example to openai-compatible with a local Ollama or LM Studio endpoint) to enable grounded explanations. Everything else on this page works without an AI provider.