Future<FirebaseUser> signInUser([var myuserdata,var mypasswrd
,frouter,srouter]
)async{
FirebaseUser firebaseUser = await FirebaseAuth.instance
.signInWithEmailAndPassword(email:myuserdata,password:mypasswrd).then((onValue){
if(onValue.uid != null){
print('object at non-null uid ${onValue.uid}');
frouter;
//frouter is my homepage;;
}
if(onValue.uid == null){
srouter;
print('object at null uid ${onValue.uid}');
//srouter is my error page;
}
});
print('user id :${firebaseUser.uid}');
return firebaseUser;
}
// it always push me to the error page
//how do I make this work