title: User is loged/signed in but the screen does not change
body: <p>I am working with Firebase authentication and lately was not able to do anything because of the following error. When I enter the user's credentials, it gets authenticated on the Firebase console, but my app's screen does not change. What's more, the following error appears in debug console.</p>
  <blockquote>
  <p>2 I/System.out(26261): (HTTPLog)-Static: isSBSettingEnabled false
  I/SurfaceControl(26261): nativeRelease nativeObject
  s[-5476376676702711408] I/SurfaceControl(26261): nativeRelease
  nativeObject e[-5476376676702711408] W/System  (26261): Ignoring
  header X-Firebase-Locale because its value was null. 2
  I/System.out(26261): (HTTPLog)-Static: isSBSettingEnabled false</p>
  </blockquote>
  <pre><code>void authUser(
        String email, String password, String conPassword, bool isLogin) async {
      UserCredential authResult;
      setState(() {
        isLoading = true;
      });
      FocusScope.of(context).unfocus();
      try {
        if (password != conPassword &amp;&amp; isLogin == false) {
          showDialog(
            context: context,
            builder: (_) =&gt; const AlertDialog(
              title: Text('Passwords don\'t match'),
              content: Text('Please check if your passwords match'),
            ),
          );
        }
  
        if (isLogin == false) {
          authResult = await firebaseAuth.createUserWithEmailAndPassword(
            email: email,
            password: password,
          );
        } else {
          authResult = await firebaseAuth.signInWithEmailAndPassword(
            email: email,
            password: password,
          );
        }
  
        setState(() {
          isLoading = false;
        });
      } catch (e) {
        rethrow;
      }
    }
  </code></pre>
  <p>...</p>
  <pre><code>TextFormField(
                    key: const ValueKey('email'),
                    keyboardType: TextInputType.emailAddress,
                    decoration: const InputDecoration(
                      label: Text('Email adress'),
                    ),
                    onSaved: (newValue) {
                      email = newValue!;
                      FocusScope.of(context).requestFocus(_passwordNode);
                    },
                  ),
                  TextFormField(
                    key: const ValueKey('password'),
                    focusNode: _passwordNode,
                    obscureText: true,
                    onSaved: (newValue) {
                      password = newValue!;
                      FocusScope.of(context).requestFocus(_conPasswordNode);
                    },
                    decoration: const InputDecoration(
                      label: Text('Password'),
                    ),
                  ),
                  if (isLogin == false)
                    TextFormField(
                      key: const ValueKey('conPassword'),
                      focusNode: _conPasswordNode,
                      obscureText: true,
                      decoration: const InputDecoration(
                        label: Text('Confirm password'),
                      ),
                      onSaved: (newValue) {
                        conPassword = newValue!;
                      },
                    ),
                  Expanded(
                    child: Container(),
                  ),
                  widget.isLoading == true
                      ? const Center(
                          child: CircularProgressIndicator(),
                        )
                      : ButtonBar(
                          alignment: MainAxisAlignment.center,
                          children: [
                            ElevatedButton(
                              onPressed: () {
                                setState(() {
                                  isLogin = !isLogin;
                                });
                              },
                              child: Text(isLogin == true ? 'SignUp' : 'Login'),
                            ),
                            ElevatedButton(
                              onPressed: _trySubmit,
                              child: const Text('Done'),
                            ),
                          ],
                        ),
  
  
     ...
      void main() {
        runApp(MyApp());
      }
      
      class MyApp extends StatelessWidget {
        @override
        Widget build(BuildContext context) {
          return FutureBuilder(
              future: Firebase.initializeApp(),
              builder: (context, snapshot) {
                if (snapshot.connectionState == ConnectionState.waiting) {
                  return const CircularProgressIndicator();
                }
                return MultiProvider(
                  providers: [
                    ChangeNotifierProvider(
                      create: (ctx) =&gt; RecipeProvider(),
                    ),
            
  
    ],
              child: MaterialApp ...
               home: StreamBuilder&lt;User?&gt;(
                    stream: FirebaseAuth.instance.authStateChanges(),
                    builder: (context, snapshot) {
                      if (snapshot.connectionState == ConnectionState.waiting) {
                        return const CircularProgressIndicator();
                      }
                      if (snapshot.hasData) {
                        return AllRecipesScreen();
                      }
                      return AuthScreen();
                    }),
                routes: {
                  AllRecipesScreen.routeName: (ctx) =&gt; AllRecipesScreen(),
                  RecipeDetailScreen.routeName: (ctx) =&gt; RecipeDetailScreen(),
                  AddRecipeScreen.routeName: (ctx) =&gt; AddRecipeScreen(),
                  AuthScreen.routeName: (ctx) =&gt; AuthScreen(),
                },
              ),
            );
          });
    }
  }
  </code></pre>