我能够成功进行 google 登录,当我将令牌传递给 firebase 时,它会返回:
W/System (20511): Ignoring header X-Firebase-Locale because its value was null.
I/flutter (20511): [firebase_auth/unknown] com.google.firebase.FirebaseException: An internal error has occurred. [ CONFIGURATION_NOT_FOUND ]
Run Code Online (Sandbox Code Playgroud)
我的 json 文件非常好。我实施:
final _auth = FirebaseAuth.instance;
String email;
String password;
RoundButton(
title: 'register',
color: Colors.blueAccent,
onPressed: () async {
try {
final newUser = await _auth.createUserWithEmailAndPassword(
email: email, password: password);
if (newUser != null) {
Navigator.pushNamed(context, ChatScreen.id);
}
} catch (e) {
print(e);
}
})
Run Code Online (Sandbox Code Playgroud) 我正在开发一个纸牌游戏,它包括 2 个部分。
在 InputPage() 中,用户选择卡片,它有一个新的游戏按钮。但如果他/她不喜欢这些卡片,他/她可以重新开始游戏。InputPage() 中有一个重启游戏按钮,当用户点击它时,页面必须完全重启。我用 Navigator.of 方法做到了这一点。但是当用户转到 GamePage() 时,我收到了这样的错误:
Unhandled Exception: setState() called after dispose(): _GamePageState#d4518(lifecycle state: defunct, not mounted)
This error happens if you call setState() on a State object for a widget that no longer appears in the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error can occur when code calls setState() from a timer or an animation callback.
The preferred solution is to cancel the …Run Code Online (Sandbox Code Playgroud)