未处理异常:MissingPluginException(No implementation found for method check on channel plugins.flutter.io/connectivity)

您所在的位置:网站首页 conectivitycheckplatformhi 未处理异常:MissingPluginException(No implementation found for method check on channel plugins.flutter.io/connectivity)

未处理异常:MissingPluginException(No implementation found for method check on channel plugins.flutter.io/connectivity)

#未处理异常:MissingPluginException(No implementation found for method check on channel plugins.flutter.io/connectivity) | 来源: 网络整理| 查看: 265

以下是无关的上述任务,但最终结果是相同的.我有连接插件和IOS配置并发症.所以我使用以下方法来检查我的应用程序是否连接到互联网:

static Future checkInternetConnectivity() async { bool isConnected; try { final result = await InternetAddress.lookup('google.com'); if (result.isNotEmpty && result[0].rawAddress.isNotEmpty) { isConnected = true; } } on SocketException catch (_) { isConnected = false; } return isConnected; }AppUtil.checkInternetConnectivity().then((isOnline) async { if (isOnline) {...} else {...} })

我从来没有看到谷歌网站宕机。如果我想听互联网连接,我使用计时器。如果你想检查移动的数据连接或WiFi数据连接,对不起!你仍然必须继续实现连接。



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3