Updated README.md, updated example
This commit is contained in:
parent
c7c0b9b67f
commit
5cc257895c
16
README.md
16
README.md
|
@ -13,7 +13,7 @@
|
||||||
[![GitHub stars](https://img.shields.io/github/stars/pichillilorenzo/flutter_inappwebview?style=social)](https://github.com/pichillilorenzo/flutter_inappwebview)
|
[![GitHub stars](https://img.shields.io/github/stars/pichillilorenzo/flutter_inappwebview?style=social)](https://github.com/pichillilorenzo/flutter_inappwebview)
|
||||||
|
|
||||||
|
|
||||||
![InAppWebView-logo](https://user-images.githubusercontent.com/5956938/86118415-0ac78300-bad1-11ea-9933-31dc65744f38.png)
|
![InAppWebView-logo](https://user-images.githubusercontent.com/5956938/110180687-8751f480-7e0a-11eb-89cc-d62f85c148cb.png)
|
||||||
|
|
||||||
A Flutter plugin that allows you to add an inline webview, to use an headless webview, and to open an in-app browser window.
|
A Flutter plugin that allows you to add an inline webview, to use an headless webview, and to open an in-app browser window.
|
||||||
|
|
||||||
|
@ -411,8 +411,7 @@ class _MyAppState extends State<MyApp> {
|
||||||
urlController.text = this.url;
|
urlController.text = this.url;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
androidOnPermissionRequest: (InAppWebViewController controller,
|
androidOnPermissionRequest: (controller, origin, resources) async {
|
||||||
String origin, List<String> resources) async {
|
|
||||||
return PermissionRequestResponse(
|
return PermissionRequestResponse(
|
||||||
resources: resources,
|
resources: resources,
|
||||||
action: PermissionRequestResponseAction.GRANT);
|
action: PermissionRequestResponseAction.GRANT);
|
||||||
|
@ -420,15 +419,8 @@ class _MyAppState extends State<MyApp> {
|
||||||
shouldOverrideUrlLoading: (controller, navigationAction) async {
|
shouldOverrideUrlLoading: (controller, navigationAction) async {
|
||||||
var uri = navigationAction.request.url!;
|
var uri = navigationAction.request.url!;
|
||||||
|
|
||||||
if (![
|
if (![ "http", "https", "file", "chrome",
|
||||||
"http",
|
"data", "javascript", "about"].contains(uri.scheme)) {
|
||||||
"https",
|
|
||||||
"file",
|
|
||||||
"chrome",
|
|
||||||
"data",
|
|
||||||
"javascript",
|
|
||||||
"about"
|
|
||||||
].contains(uri.scheme)) {
|
|
||||||
if (await canLaunch(url)) {
|
if (await canLaunch(url)) {
|
||||||
// Launch the App
|
// Launch the App
|
||||||
await launch(
|
await launch(
|
||||||
|
|
|
@ -137,8 +137,7 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
|
||||||
urlController.text = this.url;
|
urlController.text = this.url;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
androidOnPermissionRequest: (InAppWebViewController controller,
|
androidOnPermissionRequest: (controller, origin, resources) async {
|
||||||
String origin, List<String> resources) async {
|
|
||||||
return PermissionRequestResponse(
|
return PermissionRequestResponse(
|
||||||
resources: resources,
|
resources: resources,
|
||||||
action: PermissionRequestResponseAction.GRANT);
|
action: PermissionRequestResponseAction.GRANT);
|
||||||
|
|
Loading…
Reference in New Issue