try {
await FirebaseAuth.instance
.sendPasswordResetEmail(email: emailAddress.text);
if (context.mounted) {
QuickAlert.show(
context: context,
type: QuickAlertType.success,
title: 'sending..',
);
}
} on FirebaseAuthException catch (e) {
if (e.code == "user-not-found") {
Fluttertoast.showToast(
msg: "This is Center Short Toast",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
timeInSecForIosWeb: 1,
backgroundColor: Colors.red,
textColor: Colors.white,
fontSize: 16.0);
}
}
},
child: const Text(
"Forgot Password?",
textAlign: TextAlign.end,
),
This code is for sending a message to reset Password, and I tried to show an error when the user enter a wrong email that doesn’t exist, but nothing work and this error kept shoing in the debug consle, I don’t know if this error is related with the code that I wrote but when I cli on Forgot password it shows up, please in idea hoe can I fix it.
New contributor
عبدالرحمن السكاكر is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.