updated example
This commit is contained in:
parent
f728248dbd
commit
2a3e368780
|
@ -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';");
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
])));
|
||||
|
|
Loading…
Reference in New Issue