flutter - 如何解决flutter firebase auth中的网络错误?
问题描述
每次我尝试注册或登录我的应用程序时都会收到此消息。我正在使用 Firebase 身份验证。
I/flutter (11519): Error :PlatformException(ERROR_NETWORK_REQUEST_FAILED, A network error (such as timeout, interrupted connection or unreachable host) has occurred., null)
解决方案
你可以试着把它放在一个try / catch
街区里。
这只是伪代码,但我希望您能了解如何处理它。
try {
// login with facebook code
} catch (error) {
if (error.code === 'the network error code') {
// show dialog
}
}
推荐阅读
- mysql - mysql查询不尊重日期参数
- java - 如何定义一个 Edit_Text 以在所有 java 代码中使用它
- python - rpy2 无法在 Mac 上加载 R 库 ggplot2
- angular - JSON 中位置 0 的意外标记 Z
- r - 在 if else 语句中向变量添加数字
- python - 通过 Python Shell 打开图像
- text - 如何从我的 Rust 中的 HTML 中删除所有空格和 ASCII 元素,如“\n”?
- javascript - 我们可以为 mongo grid fs 添加另一个值吗?
- mysql - MySQL中的Field()在hive中有什么功能吗?
- sql - 如何避免交叉连接