【问题标题】:W/System (10375): Ignoring header X-Firebase-Locale because its value was nullW/System (10375):忽略标头 X-Firebase-Locale,因为它的值为 null
【发布时间】:2021-04-25 12:46:12
【问题描述】:

当我使用 firebase 注册或登录用户时,它不会让用户切换到另一个屏幕,正如您在下面的代码中看到的那样,它应该允许用户转到该页面,但事实并非如此。它只是继续加载。这是我不断收到的错误:

W/System (10375):忽略标头 X-Firebase-Locale,因为它的值为 null。

   home: StreamBuilder(
                stream: FirebaseAuth.instance.authStateChanges(),
                builder: (ctx, userSnapshot) {
                  if (userSnapshot.hasData) {
                    return NavigationScreen(
                      currentIndex: 1,
                    );
                  }
                  return AuthScreen();
                }),

我知道创建了一个帐户,因为当我重新启动应用程序时,它会转到另一个屏幕,并且它还会在它继续加载时告诉我:

 D/FirebaseAuth( 4303): Notifying id token listeners about user ( 2ab0Z7FcYlMr96lxbvBAPOfeLvk1 ).
D/FirebaseAuth( 4303): Notifying auth state listeners about user ( 2ab0Z7FcYlMr96lxbvBAPOfeLvk1 )

【问题讨论】:

    标签: firebase flutter dart firebase-authentication


    【解决方案1】:

    老问题,但万一其他人被卡住了:

    而不是:

    return NavigationScreen(currentIndex: 1,);

    写出代码以推送到不同的页面。 像这样:

    Navigator.push(context, MaterialPageRoute(builder: (context)=> NavigationScreen(currentIndex: 1,)));
    

    【讨论】:

      猜你喜欢
      • 2021-02-19
      • 2022-08-23
      • 2021-06-29
      • 2021-03-11
      • 1970-01-01
      • 2022-10-05
      • 2021-06-25
      • 2021-10-16
      相关资源
      最近更新 更多