The email address is badly formatted. Flutter? Unable to resolve the issue/
Solution 1:
Calling toString()
on a TextEditingController
gives you a description of the controller, not the value of the underlying text field. So this seems wrong:
String res = await AuthMethods().signUpUser(
email: _emailController.toString(),
password: _passwordController.toString(),
username: _username.toString(),
bio: _bioController.toString(),
);**
To get the value of the actual text field, use the text
property of the controller instead. So:
String res = await AuthMethods().signUpUser(
email: _emailController.text,
password: _passwordController.text,
username: _username.text,
bio: _bioController.text,
);
Solution 2:
The answer to the question is very simple.. you are using:
email: _emailController.toString(),
password: _passwordController.toString(),
username: _username.toString(),
bio: _bioController.toString(),
but you should be using
email: _emailController.text,
password: _passwordController.text,
username: _username.text,
bio: _bioController.text,
kindly upvote if useful