For a TextFormField
the property to handle this would be onFieldSubmitted
. You can copy the code from your onPressed
of the RaiseButton
to this. For e.g.
onFieldSubmitted: (value) {
if (_formKey.currentState.validate()) {
_formKey.currentState.save();
// var result = await auth.sendPasswordResetEmail(_email);
// print(result);
print(_email);
Navigator.of(context).pop();
}
},