我一直在尝试从新的https://firebase.flutter.dev/ Firebase身份验证中捕获异常,但失败了。 不知道出了什么问题,这是我的电子邮件和密码功能登录代码:
#:import requests requests
WindowManager:
MainWindow:
<MainWindow>:
name: "main"
GridLayout:
cols:1
Button:
text: "Submit"
on_release:
TheRequest = requests.get('https://www.android.com/')
答案 0 :(得分:0)
答案 1 :(得分:0)
您可以使用类似的东西
try {
UserCredential userCredential = await FirebaseAuth.instance.signInWithEmailAndPassword(
email: "barry.allen@example.com",
password: "SuperSecretPassword!"
);
} on FirebaseAuthException catch (e) {
if (e.code == 'user-not-found') {
print('No user found for that email.');
} else if (e.code == 'wrong-password') {
print('Wrong password provided for that user.');
}
}
更多错误代码:https://firebase.google.com/docs/reference/js/firebase.auth.Auth#error-codes_12