我正在寻找一种在InitState方法上加载异步数据的方法,在构建方法运行之前我需要一些数据.我正在使用GoogleAuth代码,我需要执行构建方法,直到Stream运行.
我的initState方法是:
@override
void initState () {
super.initState();
_googleSignIn.onCurrentUserChanged.listen((GoogleSignInAccount account) {
setState(() {
_currentUser = account;
});
});
_googleSignIn.signInSilently();
}
Run Code Online (Sandbox Code Playgroud)
我将不胜感激任何反馈.