stewajos / team-justice-in-alloc

452 Project - Final
0 stars 1 forks source link

Recipient Validation / Custom Alert Dialog #114

Open carter-et opened 4 years ago

carter-et commented 4 years ago

This one is a bit of toughie. So the way the form validation works is you create a formKey at the start, and for every field you want to validate you add that specific key and a validation method. When you run the validator, you give it the key to search all the validation methods by and run anything that has that key attached. However, what if you make a custom alert that has its own form, inside another form? This is the root o four issue, and requires you to make a Custom alert dialog object that can makes it's own formKey.

I know what you're asking. But why not just make two formKeys called different things? When you create a formKey, you do so with some magic and my knowledge ends there.

This should help. https://stackoverflow.com/questions/53061369/how-to-validate-text-input-on-alertdialog-using-form-and-globalkey

Good luck and happy coding.

carter-et commented 4 years ago

To accomplish this task you need to create a custom alert dialog that creates it's own _formKey. https://stackoverflow.com/questions/53061369/how-to-validate-text-input-on-alertdialog-using-form-and-globalkey