I am facing an error while trying to create a user with an email and password. It is giving an error with the value null.
body: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
TextField(
decoration: InputDecoration(labelText: "Email"),
onChanged: (value) {
setState(() {
_email = value;
});
},
),
TextField(
decoration: InputDecoration(labelText: "Password"),
onChanged: (value) {
setState(() {
_password = value;
});
},
obscureText: true,
),
FlatButton(
onPressed: () async {
try {
final newuser = await _auth.createUserWithEmailAndPassword(
_email, _password); // this is the line for the error
if (newuser != Null) {
Navigator.pushNamed(context, '/homepage');
}
} catch (e) {
print(e);
}
},
child: Text("Sign Up"))
],
),
));
if some one can help me with this it will be helpful