updated example
This commit is contained in:
parent
f728248dbd
commit
2a3e368780
|
@ -21,7 +21,8 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
|
||||||
mediaPlaybackRequiresUserGesture: false,
|
mediaPlaybackRequiresUserGesture: false,
|
||||||
allowsInlineMediaPlayback: true,
|
allowsInlineMediaPlayback: true,
|
||||||
iframeAllow: "camera; microphone",
|
iframeAllow: "camera; microphone",
|
||||||
iframeAllowFullscreen: true
|
iframeAllowFullscreen: true,
|
||||||
|
javaScriptEnabled: false
|
||||||
);
|
);
|
||||||
|
|
||||||
PullToRefreshController? pullToRefreshController;
|
PullToRefreshController? pullToRefreshController;
|
||||||
|
@ -113,10 +114,10 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
|
||||||
children: [
|
children: [
|
||||||
InAppWebView(
|
InAppWebView(
|
||||||
key: webViewKey,
|
key: webViewKey,
|
||||||
// initialUrlRequest:
|
|
||||||
// URLRequest(url: Uri.parse("https://flutter.dev")),
|
|
||||||
initialUrlRequest:
|
initialUrlRequest:
|
||||||
URLRequest(url: Uri.parse(Uri.base.toString().replaceFirst("/#/", "/") + 'page.html')),
|
URLRequest(url: Uri.parse("https://flutter.dev")),
|
||||||
|
// initialUrlRequest:
|
||||||
|
// URLRequest(url: Uri.parse(Uri.base.toString().replaceFirst("/#/", "/") + 'page.html')),
|
||||||
// initialFile: "assets/index.html",
|
// initialFile: "assets/index.html",
|
||||||
initialUserScripts: UnmodifiableListView<UserScript>([]),
|
initialUserScripts: UnmodifiableListView<UserScript>([]),
|
||||||
initialSettings: settings,
|
initialSettings: settings,
|
||||||
|
@ -217,6 +218,12 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
|
||||||
webViewController?.reload();
|
webViewController?.reload();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
ElevatedButton(
|
||||||
|
child: Icon(Icons.refresh),
|
||||||
|
onPressed: () {
|
||||||
|
webViewController?.evaluateJavascript(source: "document.title='test';");
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
])));
|
])));
|
||||||
|
|
Loading…
Reference in New Issue