【发布时间】: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