Skip to content
Boring Doc
BreakingHigh impactOfficial migration guidesince 1.22.0landed 1.21.0-5.0.pre

The new Form, FormField auto-validation API

Framework · Official source

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)

dart+1−1
Before
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 }
After
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();
      },
    );
  }
}
Migration assistantAI-generated · grounded in cited sources
AI explanations are not configured
Set 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.
Official migration guide·Verified classification (95%)

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.

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 explanationAI-generated · grounded in cited sources
AI explanations are not configured
Set 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.
Was this useful?