I am new to flutter I am trying to create a large form, where I am using form key to validate form and global object to store value using on Saved method on TextFormFeild of flutter how can i do same thing with DropdownButtonFormField.
Specifically, i don’t want to use DropdownButtonFormFeild onChanged method instead i want to do it using onSaved method.
2
Answers
If you can use validator on TextFormField, then you can use it on dropdown too.
Wrap with Form, add formKey then just trigger the validation with button.
Example:
You can use validator like commong TextFormField
Try this: