I have implemented webView in flutter but it is not opening my php website which is on server what I'm doing wrong.
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://61.246.39.79:8080/",
withJavascript: true,
supportMultipleWindows: true,
withLocalStorage: true,
allowFileURLs: true,
enableAppScheme: true,
appCacheEnabled: true,
hidden: false,
scrollBar: true,
geolocationEnabled: false,
clearCookies: true,
// usesCleartextTraffic="true"
);
}
I expect the output as running webview but error is thrown.
set usesCleartextTraffic property to true in your AndroidManifest file, like below.
<application
....
android:usesCleartextTraffic="true"
....>
Open the android manifest file (android/app/src/main/AndroidManifest.xml) and add
android:usesCleartextTraffic="true" to the application tag
<application
android:name="io.flutter.app.FlutterApplication"
android:label="tangerine_ui"
android:icon="@mipmap/ic_launcher"
android:usesCleartextTraffic="true">
Sumon
In AndroidManifest.xml, add [android:usesCleartextTraffic="true"
] as
<application
......
.......
android:usesCleartextTraffic="true"
.............. >
<.........
................... />
..........
...........>
</application>
it not working in android version 9
来源:https://stackoverflow.com/questions/55592392/how-to-fix-neterr-cleartext-not-permitted-in-flutter