gpt4 book ai didi

webview - flutter flutter_webview_plugin 总是加载

转载 作者:IT王子 更新时间:2023-10-29 07:00:45 28 4
gpt4 key购买 nike

我在ios模拟器上运行代码,但是ios一直在加载,webview状态是startLoad,但是无法finishLoad,页面总是加载,代码如下:

@override
Widget build(BuildContext context) {
List<Widget> titleContent = [];
titleContent.add(new Text(
"资讯详情",
style: new TextStyle(color: Colors.white),
));
if (!loaded) {
titleContent.add(new CupertinoActivityIndicator());
}
titleContent.add(new Container(width: 50.0));
print(widget.id);
return new WebviewScaffold(
url: "http://www.baidu.com",
appBar: new AppBar(
title: new Row(
mainAxisAlignment: MainAxisAlignment.center,
children: titleContent,
),
actions: <Widget>[
new IconButton(
icon: icon,
onPressed: () {
print('收藏');
setState(() {
icon = new Icon(Icons.star);
});
},
),
new IconButton(
icon: new Icon(Icons.share),
onPressed: () {
print('分享');
},
),
],
iconTheme: new IconThemeData(color: Colors.white),
),
withZoom: false,
withLocalStorage: false,
withJavascript: true,
withLocalUrl: true,
);

页面如下: the page like this

谢谢

最佳答案

监听 httpError 流。也许您遇到了一些错误,因为通常它应该可以工作。

FlutterWebviewPlugin().onHttpError.listen((WebViewHttpError item) {
print(" WebView onHttpError.code: ${item.code}");
});

关于webview - flutter flutter_webview_plugin 总是加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51202550/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com