如何在验证电子邮件后在 flutter 中重定向用户?
你好,我是颤振的新手。我在一个flutter项目中尝试了firebase电子邮件和密码身份验证。但我面临一些问题,即当用户确认其电子邮件时,它不会重定向到另一个新页面。谁能建议我该怎么做?
onPressed: () {
if (emailAuthVerified.isUserVerified()) {
EmailVerificationAlert();
}
Navigator.pushNamed(context, WelcomeScreen.routeName);
}
Hello I am new in flutter. I tried the firebase email and password authentication in a flutter project. but I face some problem that is when a user confirm their email it doesn't redirect to another new page. can anyone suggest me what to do?
onPressed: () {
if (emailAuthVerified.isUserVerified()) {
EmailVerificationAlert();
}
Navigator.pushNamed(context, WelcomeScreen.routeName);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
电子邮件验证后,您必须
reload()
您的用户信息/个人资料,因为idTokenChanges()
、userChanges()
&authStateChanges()
将无法捕获这些更改。这是参考:https://firebase.flutter.dev/docs/auth/usage
After email verification you would have to
reload()
your user info/profile sinceidTokenChanges()
,userChanges()
&authStateChanges()
won't be able to catch these changes.Here's the reference: https://firebase.flutter.dev/docs/auth/usage