the logic is correct but when I try to enter email not exist it showing me the success dialog :( InkWell( onTap: () async { if (email.text == null || email.text.isEmpty) { AwesomeDialog( context: context, dialogType: DialogType.warning, animType: AnimType.rightSlide, title: 'Warning', desc: 'Enter An Email First!', ).show(); return; } try { await FirebaseAuth.instance .sendPasswordResetEmail(email: email.text); AwesomeDialog( context: context, dialogType: DialogType.success, animType: AnimType.rightSlide, title: 'Done', desc:'Your password reset has been sent to your email', ).show(); } catch (e) { print("Error: $e"); // Log the error for debugging purposes AwesomeDialog( context: context, dialogType: DialogType.error, // Change to error dialog type animType: AnimType.rightSlide, title: 'Error', desc: 'Please enter a valid email', ).show(); } }