我正在尝试在我的 Flutter 应用程序中使用 firbase 进行身份验证。一旦用户登录并进入已验证屏幕,就会显示此错误。我正在使用具有简单逻辑的 google_signin 插件。
bool isAuth = false;
//check if the user is signed in
@override
void initState() {
super.initState();
googleSignIn.onCurrentUserChanged.listen((account) {
handleSignIn(account);
}, onError: (err) {
print("Error signing in: $err");
});
//maintain the signin
googleSignIn.signInSilently(suppressErrors: false).then((account) {
handleSignIn(account);
}).catchError((err) {
print("Error signing in: $err");
});
}
handleSignIn(GoogleSignInAccount account) {
if (account != null) {
print('User signed in!: $account');
setState(() {
isAuth = true;
});
} else {
setState(() {
isAuth = false;
});
}
}
//sign in using google
login() {
googleSignIn.signIn();
}
logout() {
googleSignIn.signOut();
}
Widget buildAuthScreen() {
return Center(
child: RaisedButton(
child: Text("LogOut"),
onPressed: logout(),
),
);
}
Run Code Online (Sandbox Code Playgroud)
然后 unauth 屏幕具有用于登录的基本登录布局...
ali*_*tor 13
如果你没有在你的 中做任何不必要的事情main,你可以忽略它。
跳过的帧数取决于:
需要在启动时启动的静态和顶级变量的数量。
将执行计算工作的 CPU 速度,例如在启动时解析 JSON。
用于启动数据库和共享首选项的设备存储速度。
无论您是使用应用程序的调试版本还是发布版本。
在应用程序启动之前需要一些必要数据时的网络连接速度。
无论您使用的是模拟器还是物理设备。
主页中小部件树的大小。
| 归档时间: |
|
| 查看次数: |
6033 次 |
| 最近记录: |