Default controllers are rather not flexible. I tried flutter_form_builder but it seems that validation here is broken and it fires all errors after touching any field, I am using redux and I don't want mismatch patterns with flutter_form_bloc package.
My requirements:
pass array of validators (default approach allows only one validator)
fire validation on blur or after form submit and react on changes
simple use with different form fields (text, image picker, select)
I would like to have something that works like a react formik or angular reactive form.
So:
I created class that works as fieldController, it keep value, errors etc for one field
I created a Stateful widget that gets config(initalValue, validators) and have methods for form submitting
I made from value and touched BehaviourSubject, in my fieldWrapper I'm listen on changes of them and run setState- it is the only way to refresh widgets
using form logic is similar to hoc- I can't pass class type to my Form widget but I can pass a function that will return an instance of this class/widget with any props that I want to send from form.
It is rather WIP, I will refactor in this way login and register forms, adopt rest of validators. At this point it is working.
Default controllers are rather not flexible. I tried flutter_form_builder but it seems that validation here is broken and it fires all errors after touching any field, I am using redux and I don't want mismatch patterns with flutter_form_bloc package.
My requirements:
I would like to have something that works like a react formik or angular reactive form.
So:
It is rather WIP, I will refactor in this way login and register forms, adopt rest of validators. At this point it is working.