0

The named parameter 'onSubmitted' isn't defined. Try correcting the name to an existing named parameter's name, or defining a named parameter with the name 'onSubmitted

My Code :

    TextFormField(
                          onSubmitted: (value) {
  },
                        controller: _passcon,
                        decoration: InputDecoration(
                            labelText: 'Password',
                            prefixIcon: Icon(Icons.lock)),
                        obscureText: true,
                        validator: (value) {
                          if (value!.isEmpty) {
                            return 'Please enter password';
                          }
                          return null;
                        },
                        onSaved: (value) => _password = value!,
                      ),

please help me sir

Ashrafi Abir
  • 65
  • 1
  • 6

1 Answers1

1

You need to replace onSubmit with onFieldSubmitted. It will fix your problem

Rohan Jariwala
  • 1,564
  • 2
  • 7
  • 24