I'm using the following handler to handle auth state change,
Widget handleCurrentScreen() {
return StreamBuilder<FirebaseUser>(
stream: FirebaseAuth.instance.onAuthStateChanged,
builder: (BuildContext context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return Scaffold(
appBar: AppBar(
title: Text("Splash"),
),
body: Text("Splash"),
);
} else {
if (snapshot.hasData) {
return HomePage(_auth,_googleSignIn);
}
return LoginScreen3();
}
}
);
}
There's a text field in HomePage() and when I tap on it my screen is directed to Splash screen as this assertion becomes true snapshot.connectionState == ConnectionState.waiting. I can't think of any reason why connection state change to waiting? Anyone l