On Auth State Changed

Use the onAuthStateChanged method to listen for changes in the authentication state, such as when a user signs in or out.

Method

final user = await FirebaseApp.firebaseAuth?.onAuthStateChanged();

Parameters

  • None

Return

  • User?: Returns the currently authenticated user. If no user is signed in, it returns null.

This method provides a stream of authentication state changes, allowing your application to react to user sign-ins and sign-outs in real-time.

Last updated