**已关闭。**此问题需要debugging details。当前不接受答案。
编辑问题以包含desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem。这将有助于其他人回答问题。
10个月前就关门了。
这篇文章是昨天编辑并提交审查的。
Improve this question
我正在flutter中制作一个webview应用程序,下面是webview的代码
WebView(
initialUrl: 'https://deoxy.tech/',
javascriptMode: JavascriptMode.unrestricted,
onWebViewCreated: (WebViewController webViewController) {
_controllerCompleter.future.then((value) => _controller = value);
_controllerCompleter.complete(webViewController);
},
),
Web视图工作正常,但问题是当没有Internet连接时,应用程序会显示如下加载错误
我想显示另一个小部件或图像,而不是这个加载错误。像当没有互联网连接,我需要显示“没有互联网连接”屏幕/小部件这样。
我该怎么做?
2条答案
按热度按时间nhaq1z211#
您可以使用this Package检查Internet连接是否可用。
sqyvllje2#
flutter中的互联网检查功能仅在您使用Android或iOS时可用,这是因为当您打开Web应用程序时,它会出现,这意味着您已连接,如果它没有出现,则表示您没有连接,因此检查互联网没有意义