如何在flutter webview中打开localhost

San*_*rma 5 ip webview flutter flutterwebviewplugin

我正在尝试什么:

在 flutter WebView 中打开本地主机。我正在使用这个插件,这个项目正在 Django 中运行,URL 为:http://127.0.0.1:8000/。我想在我的 flutter 应用程序中打开它。

我尝试过的:

搜索SO答案后,URL:http://myIPaddress:8000/。

更新

我通过手机提供互联网。

这是我的本地 IP 地址

我使用的http://192.168.43.55:8080/不起作用,而且http://192.168.43.1:8080/

任何建议都会起作用,谢谢。

小智 5

尝试使用http://10.0.2.2:8000. 如果您收到明文错误,请在应用程序标记下AndroidManifest.xml添加android:usesCleartextTraffic="true"