NoSuchMethodError: The method 'validate' was called on null
Try to wrap your TextFieldField
in Form widget and also put key parameter. You might want to check out TextField
and errorText
property.
You have to wrap your TextFormFields
with the Form
widget.
As per docs,
Each individual form field should be wrapped in a FormField widget, with the Form widget as a common ancestor of all of those*.
In my case i forgot the key parameter of Form.
This error occures when:
Form
contains only oneTextFormField
- You didn't bind key to
Form
- Some widgets in your
Form
are not wrapped withFormField
widget