如何在颤抖中修复'net :: ERR_CLEARTEXT_NOT_PERMITTED' [英] How to fix 'net::ERR_CLEARTEXT_NOT_PERMITTED' in flutter

查看:766
本文介绍了如何在颤抖中修复'net :: ERR_CLEARTEXT_NOT_PERMITTED'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在波动中实现了webView,但是它并没有打开我在服务器上做错的php网站.

I have implemented webView in flutter but it is not opening my php website which is on server what I'm doing wrong.

我是新手,并尝试使用webview将我的网站网页集成到我的应用程序中,但是没有运气.

I am new to flutter and tried webview to integrate my website webpage in my application but no luck.

Widget build(BuildContext context) {
    // TODO: implement build
    return WebviewScaffold(
      appBar: AppBar(iconTheme:IconThemeData(color: Colors.white),title: Text("Intake Form",style:new TextStyle(color: Colors.white,fontWeight: FontWeight.bold)),backgroundColor:Colors.indigoAccent,automaticallyImplyLeading: false),
     url: url,
      //url: "http://xxxxxxxx/",
       withJavascript: true,
       supportMultipleWindows: true,
      withLocalStorage: true,
      allowFileURLs: true,
      enableAppScheme: true,
      appCacheEnabled: true,
      hidden: false,
      scrollBar: true,
      geolocationEnabled: false,
      clearCookies: true,
       // usesCleartextTraffic="true"



    );
  }

我希望输出的结果是运行的webview,但是会引发错误.

I expect the output as running webview but error is thrown.

推荐答案

set在您的AndroidManifest文件中将CleartextTraffic属性设置为true,如下所示.

set usesCleartextTraffic property to true in your AndroidManifest file, like below.

<application
....
android:usesCleartextTraffic="true"
....>

这篇关于如何在颤抖中修复'net :: ERR_CLEARTEXT_NOT_PERMITTED'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆