ResoCoder / flutter-ddd-firebase-course

https://resocoder.com/flutter-firebase-ddd-course
GNU General Public License v3.0
470 stars 161 forks source link

'autovalidate' is deprecated and shouldn't be used - sign_in_form.dart #15

Open moshe7 opened 4 years ago

moshe7 commented 4 years ago

It is no longer possible to put a primitive value in "autovalidate" of Form What is your recommendation for State value?

pedromassango commented 4 years ago

replace autovalidate: true by autovalidateMode: AutovalidateMode.always.

See the link bellow for more options https://master-api.flutter.dev/flutter/widgets/AutovalidateMode-class.html

moshe7 commented 4 years ago

Thanks, @pedromassango. Yes, I know that. but I wonder more about design, what is better to leave State as a primitive bool and do a conversion or change the State to AutovalidateMode Enum

BrianMwas commented 4 years ago

I also think setting the type to AutovalidateMode will make it more readable. Setting its initial state to AutovalidateMode.disabled would be the same as false.

moshe7 commented 4 years ago

more readable, but coupling the "state" to the "autovalidate"

EmmanuelAmet commented 2 years ago

autovalidate has been depreciated, now you need to use autovalidateMode: AutovalidateMode.always checkout the flutter documentation for it via: https://docs.flutter.dev/release/breaking-changes/form-field-autovalidation-api