[英]flutter: how to make pull down to refresh flutter webview using the official webview_flutter package
[英]Is it possible to handle webSetting In Flutter WebView [by webview_flutter package]
这里我包含了一些来自原生 android 的 java 代码,我需要在 [Flutter-webview][1] 中设置这些设置
m_webView.getSettings().setLoadsImagesAutomatically(true);
m_webView.getSettings().setAllowFileAccessFromFileURLs(true);
m_webView.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
m_webView.getSettings().setBuiltInZoomControls(true);
m_webView.getSettings().setSupportZoom(true);
m_webView.getSettings().setLoadsImagesAutomatically(true);
m_webView.getSettings().setJavaScriptEnabled(true);
m_webView.getSettings().setDomStorageEnabled(true);
m_webView.getSettings().setAllowFileAccess(true);
m_webView.getSettings().setAllowFileAccessFromFileURLs(false);
m_webView.getSettings().setAllowUniversalAccessFromFileURLs(false);
m_webView.setVerticalScrollBarEnabled(false);
m_webView.setHorizontalScrollBarEnabled(false);
m_webView.setScrollContainer(false);```
[1]: https://pub.dev/packages/webview_flutter
要检查可用的参数,您可以按 ctrl+左键单击 webview class 从 flutter ZEFE90A8E604A7C8B7EDDZ 导入的按钮。
const WebView({
Key? key,
this.onWebViewCreated,
this.initialUrl,
this.initialCookies = const <WebViewCookie>[],
this.javascriptMode = JavascriptMode.disabled,
this.javascriptChannels,
this.navigationDelegate,
this.gestureRecognizers,
this.onPageStarted,
this.onPageFinished,
this.onProgress,
this.onWebResourceError,
this.debuggingEnabled = false,
this.gestureNavigationEnabled = false,
this.userAgent,
this.zoomEnabled = true,
this.initialMediaPlaybackPolicy =
AutoMediaPlaybackPolicy.require_user_action_for_all_media_types,
this.allowsInlineMediaPlayback = false,
this.backgroundColor,
}) : assert(javascriptMode != null),
assert(initialMediaPlaybackPolicy != null),
assert(allowsInlineMediaPlayback != null),
super(key: key);
幸运的是,该参数仍然是人类语言,您可以根据需要探索可用的参数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.