updated example

This commit is contained in:
Lorenzo Pichilli 2022-04-30 21:23:16 +02:00
parent f728248dbd
commit 2a3e368780
1 changed files with 11 additions and 4 deletions

View File

@ -21,7 +21,8 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
mediaPlaybackRequiresUserGesture: false,
allowsInlineMediaPlayback: true,
iframeAllow: "camera; microphone",
iframeAllowFullscreen: true
iframeAllowFullscreen: true,
javaScriptEnabled: false
);
PullToRefreshController? pullToRefreshController;
@ -113,10 +114,10 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
children: [
InAppWebView(
key: webViewKey,
// initialUrlRequest:
// URLRequest(url: Uri.parse("https://flutter.dev")),
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",
initialUserScripts: UnmodifiableListView<UserScript>([]),
initialSettings: settings,
@ -217,6 +218,12 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
webViewController?.reload();
},
),
ElevatedButton(
child: Icon(Icons.refresh),
onPressed: () {
webViewController?.evaluateJavascript(source: "document.title='test';");
},
),
],
),
])));