【问题标题】:How to display a custom alert dialog in Flutter based on Firebase Auth error message?如何根据 Firebase Auth 错误消息在 Flutter 中显示自定义警报对话框?
【发布时间】:2020-08-26 22:27:19
【问题描述】:

如何在 Flutter 中根据来自 Firebase Auth 的错误消息显示自定义警报对话框。假设如果用户提交了错误的电子邮件或密码,甚至用户的电子邮件已经在 firebase 上注册,那么它将根据错误弹出一个警报对话框。提前谢谢你

【问题讨论】:

  • 欢迎来到 SO!到目前为止,您能提供您的代码吗?

标签: flutter firebase-authentication alert


【解决方案1】:

你可以在catch里面调用showDialog方法

  catch (e) {
          print(e);
          showDialog(
          context: context,
          builder: (context) {
            return AlertDialog(
            // set your custom alert dialog here 
            );
          });
  }

【讨论】:

    猜你喜欢
    • 2020-03-21
    • 1970-01-01
    • 1970-01-01
    • 2011-06-17
    • 2012-12-16
    • 1970-01-01
    • 1970-01-01
    • 2021-03-19
    相关资源
    最近更新 更多