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:

  1. Form contains only one TextFormField
  2. You didn't bind key to Form
  3. Some widgets in your Form are not wrapped with FormField widget