I am trying to get the login state of the user in Flutter, whenever I run my application for the first time (Only when I uninstall and reinstall the app) following code return a user.
I already tried to get the user from whenComplete
and then
both return
the same.
FirebaseAuth _firebaseAuth = FirebaseAuth.instance;
FirebaseUser user = await _firebaseAuth.currentUser();
return user;
returned user is a platform user from my android device, and if I reload my app after install user will be removed.
Edit:
- I already tried all the steps in https://stackoverflow.com/a/48660787/979653
- I removed all the users from my Firebase
- My app showing a user id which is not in my Firebase.
Funny thing is minimizing the app removes the unknown user.