FlutterSocial icon indicating copy to clipboard operation
FlutterSocial copied to clipboard

Authstate listener causes bottom bar to not navigate to other pages

Open Hosea987 opened this issue 4 years ago • 0 comments

I tried an auth state listener so that the app does not have to go to the google sign in page everytime i open the app. So i added this bit of code:

@override Widget build(BuildContext context) { return StreamBuilder<FirebaseUser>( stream: FirebaseAuth.instance.onAuthStateChanged, builder: (context, snapshot) { if (snapshot.connectionState == ConnectionState.active) { FirebaseUser user = snapshot.data; if (user == null) { return buildAuthPage(); } return buildUnAuthPage(); } else { return Scaffold( body: Center( child: CircularProgressIndicator(), ), ); } }, ); }

But the problem is that everytime i click on ant item in the bottom bar it keeps bringing me back to the timeline page. I cant go to the other pages by clikcing on items in the bottom bar. Please help,i have been stuck for 2 weeks now with no solution(newb problems)

Hosea987 avatar Dec 20 '19 10:12 Hosea987