i have created in Flutter the following Code:
if (_auth.currentUser != null) {
&& FirebaseAuth.instance.currentUser.reload() != null
Timer(
Duration(seconds: 3),
() => Navigator.of(context).pushAndRemoveUntil(
MaterialPageRoute(
builder: (context) =>
HomeScreen(username: _auth.currentUser.displayName)),
(Route<dynamic> route) => false),
);
} else {
Timer(Duration(seconds: 4),
() => Navigator.pushReplacementNamed(context, "/auth"));
}
}
The Problem is actually that the Part && FirebaseAuth.instance.currentUser.reload() != null
is not working.
Do you now why? I want to reaload the currentUser-Firebase-AuthState every time the App is openend.
Thanks for helping!!!
question from:https://stackoverflow.com/questions/65859037/reload-firebaseauth-in-flutter