Skip to content

Flutter firestore onAuthStateChanged get triggered when tapped on a text field #23813

@praneethfdo

Description

@praneethfdo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions