1

On user signout, how to detect signout activity and reload botton navigation bar and pages in flutter with firebase authentication?

Ramesh Kumar
  • 147
  • 14
  • you should be more specific. if you ask how to signout my users, then you already registered users and sign in. if you did them, you already need to learned how to sign out the users. 'cause these processes is not different from each other. I think you should search more about firebase – Timur Turbil Jan 01 '21 at 11:40

1 Answers1

2

I will have to point you to FirebaseAuth.instance.onAuthStateChanged and StreamBuilder. FirebaseAuth.instance.onAuthStateChanged is a stream and will update when the user logs out.

StreamBuilder<FirebaseUser>(
  stream: FirebaseAuth.instance.onAuthStateChanged,
  builder: (BuildContext context, snapshot) {
    if (snapshot.hasData) {
      return LoggedInWidget()
    } else {
      return LoggedOutWidget();
    }
  },
)