'cant reset password in firebase

I am using Flutter with Firebase, I am signing in using the email and it works fine, but I can't send a password reset email to it.

forgotMyPassword(String email)async {
    try {
      await _auth.sendPasswordResetEmail(email: email.trim());
    } on FirebaseAuthException catch (e) {
      print(e.code);
      print(e.message);  
    }
}

it always gives me back this message and code

W/System (25110): Ignoring header X-Firebase-Locale because its value was null. I/flutter (25110): invalid-email I/flutter (25110): The email address is badly formatted.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source