The autovalidate parameter is deprecated.

A new parameter called autovalidateMode,
an Enum that accepts values from the AutovalidateMode
Enum class, is added.

Migration guide

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: