原因:IOS和Android 9.0+对非HTTPS请求做了一些限制,不能直接访问Http请求或者其他原因导致
解决办法如下:
    1.在android项目下找app->src->main->res下新建xml文件夹,然后新建network_security_config.xml文件及内容如下图:
Flutter报错Insecure HTTP is not allowed by platform插图

Flutter报错Insecure HTTP is not allowed by platform插图1

Flutter报错Insecure HTTP is not allowed by platform插图2
 2.在android的清单文件(AndroidManifest.xml)的application标签内添加属性:
android:networkSecurityConfig="@xml/network_security_config"如下图:

Flutter报错Insecure HTTP is not allowed by platform插图3

  3.然后restart项目,重新运行即可。