'autovalidate' is deprecated and shouldn't be used. Use autoValidateMode parameter which provide more specific behaviour related to auto validation. This feature was deprecated after v1.19.0.. Try replacing the use of the deprecated member with the replacement. enter image description here
Auto validation is deprecated and replaced by an enum. So you should migrate to the new version.
All you need to do is replace autovalidate: true with autovalidateMode: AutovalidateMode.always
AutovalidateMode.always
AutovalidateMode.disabled
AutovalidateMode.onUserInteraction
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();
},
);
}
}
More about autovalidateMode