While using the official Firebase Auth, FirebaseAuth.instance.currentUser is always filled with the current user (loaded from storage when there was a previously authenticated user), then, it invokes authStateChanges passing the same user.
This lib starts with FirebaseAuth.instance.currentUser always as null. If there was a persisted user before, it's possible to fetch it only in authStateChanges stream.
In other words: FirebaseAuth.instance.currentUser should have a loaded user (from persistent storage), even if we don't subscribe to any streams.
While using the official Firebase Auth,
FirebaseAuth.instance.currentUseris always filled with the current user (loaded from storage when there was a previously authenticated user), then, it invokesauthStateChangespassing the same user.This lib starts with
FirebaseAuth.instance.currentUseralways as null. If there was a persisted user before, it's possible to fetch it only inauthStateChangesstream.In other words:
FirebaseAuth.instance.currentUsershould have a loaded user (from persistent storage), even if we don't subscribe to any streams.