You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
I have a trouble with validation form fields.
Let's say I have firstName and lastName form field with initial value(from database)
so form input is pre-populated with value.
But I want to change just firstName field and it calls onChanged function.
And onChanged function calls FirstNamChanged bloc event like this
I don't touch lastName field, so onChanged function is not called and so intial state of lastName is empty.
So Formz.validate([firstName, state.lastName]) will return invalidated.
How can I pass intial state to FormzInput ?
And I tried to submit the form with empty value. like this
if(formKey.currentState!.validate())
but it returns form is validated
It doesn't seems to call each FormzInputs' validator function
What am I missing?
The text was updated successfully, but these errors were encountered:
if(formKey.currentState!.validate()) calls validator on each TextFormField inside a Form widget, not Formz. It will return valid everytime if there's no validator on each TextFormField.
Hi!
I have a trouble with validation form fields.
Let's say I have firstName and lastName form field with initial value(from database)
so form input is pre-populated with value.
But I want to change just firstName field and it calls onChanged function.
And onChanged function calls FirstNamChanged bloc event like this
I don't touch lastName field, so onChanged function is not called and so intial state of lastName is empty.
So Formz.validate([firstName, state.lastName]) will return invalidated.
How can I pass intial state to FormzInput ?
And I tried to submit the form with empty value. like this
but it returns form is validated
It doesn't seems to call each FormzInputs' validator function
What am I missing?
The text was updated successfully, but these errors were encountered: