InAppWebViewSettings class
This class represents all InAppBrowser settings available.
Officially Supported Platforms/Implementations:
- Android WebView
- iOS WKWebView
- macOS WKWebView
- Web <iframe>
- Windows WebView2
Constructors
-
InAppWebViewSettings({bool? useShouldOverrideUrlLoading, bool? useOnLoadResource, bool? useOnDownloadStart, @Deprecated("Use InAppWebViewController.clearAllCache instead") bool? clearCache = false, String? userAgent = "", String? applicationNameForUserAgent = "", bool? javaScriptEnabled = true, bool? javaScriptCanOpenWindowsAutomatically = false, bool? mediaPlaybackRequiresUserGesture = true, int? minimumFontSize, bool? verticalScrollBarEnabled = true, bool? horizontalScrollBarEnabled = true, List<
String> ? resourceCustomSchemes = const [], List<ContentBlocker> ? contentBlockers = const [], UserPreferredContentMode? preferredContentMode = UserPreferredContentMode.RECOMMENDED, bool? useShouldInterceptAjaxRequest, bool? useOnAjaxReadyStateChange, bool? useOnAjaxProgress, bool? interceptOnlyAsyncAjaxRequests = true, bool? useShouldInterceptFetchRequest, bool? incognito = false, bool? cacheEnabled = true, bool? transparentBackground = false, bool? disableVerticalScroll = false, bool? disableHorizontalScroll = false, bool? disableContextMenu = false, bool? supportZoom = true, bool? allowFileAccessFromFileURLs = false, bool? allowUniversalAccessFromFileURLs = false, int? textZoom, @Deprecated("Use CookieManager.removeSessionCookies instead") bool? clearSessionCache = false, bool? builtInZoomControls = true, bool? displayZoomControls = false, bool? databaseEnabled = true, bool? domStorageEnabled = true, bool? useWideViewPort = true, bool? safeBrowsingEnabled = true, MixedContentMode? mixedContentMode, bool? allowContentAccess = true, bool? allowFileAccess = true, String? appCachePath, bool? blockNetworkImage = false, bool? blockNetworkLoads = false, CacheMode? cacheMode = CacheMode.LOAD_DEFAULT, String? cursiveFontFamily = "cursive", int? defaultFixedFontSize = 16, int? defaultFontSize = 16, String? defaultTextEncodingName = "UTF-8", ActionModeMenuItem? disabledActionModeMenuItems, String? fantasyFontFamily = "fantasy", String? fixedFontFamily = "monospace", @Deprecated("Use algorithmicDarkeningAllowed instead") ForceDark? forceDark, @Deprecated("Use algorithmicDarkeningAllowed instead") ForceDarkStrategy? forceDarkStrategy, bool? geolocationEnabled = true, LayoutAlgorithm? layoutAlgorithm, bool? loadWithOverviewMode = true, bool? loadsImagesAutomatically = true, int? minimumLogicalFontSize = 8, bool? needInitialFocus = true, bool? offscreenPreRaster = false, String? sansSerifFontFamily = "sans-serif", String? serifFontFamily = "sans-serif", String? standardFontFamily = "sans-serif", @Deprecated('') bool? saveFormData = true, bool? thirdPartyCookiesEnabled = true, bool? hardwareAcceleration = true, int? initialScale = 0, bool? supportMultipleWindows = false, String? regexToCancelSubFramesLoading, String? regexToAllowSyncUrlLoading, bool? useHybridComposition = true, bool? useShouldInterceptRequest, bool? useOnRenderProcessGone, OverScrollMode? overScrollMode = OverScrollMode.IF_CONTENT_SCROLLS, bool? networkAvailable, ScrollBarStyle? scrollBarStyle = ScrollBarStyle.SCROLLBARS_INSIDE_OVERLAY, VerticalScrollbarPosition? verticalScrollbarPosition = VerticalScrollbarPosition.SCROLLBAR_POSITION_DEFAULT, int? scrollBarDefaultDelayBeforeFade, bool? scrollbarFadingEnabled = true, int? scrollBarFadeDuration, RendererPriorityPolicy? rendererPriorityPolicy, bool? disableDefaultErrorPage = false, Color? verticalScrollbarThumbColor, Color? verticalScrollbarTrackColor, Color? horizontalScrollbarThumbColor, Color? horizontalScrollbarTrackColor, bool? algorithmicDarkeningAllowed = false, bool? enterpriseAuthenticationAppLinkPolicyEnabled = true, WebAuthenticationSupport? webAuthenticationSupport, String? containerId, ProxySettings? proxySettings, bool? paymentRequestEnabled, Uint8List? defaultVideoPoster, Set<String> ? requestedWithHeaderOriginAllowList, bool? disallowOverScroll = false, bool? enableViewportScale = false, bool? suppressesIncrementalRendering = false, bool? allowsAirPlayForMediaPlayback = true, bool? allowsLinkPreview = true, bool? ignoresViewportScaleLimits = false, bool? allowsInlineMediaPlayback = false, bool? allowsPictureInPictureMediaPlayback = true, bool? isFraudulentWebsiteWarningEnabled = true, SelectionGranularity? selectionGranularity = SelectionGranularity.DYNAMIC, List<DataDetectorTypes> ? dataDetectorTypes = const [DataDetectorTypes.NONE], bool? automaticallyAdjustsScrollIndicatorInsets = false, bool? accessibilityIgnoresInvertColors = false, ScrollViewDecelerationRate? decelerationRate = ScrollViewDecelerationRate.NORMAL, bool? alwaysBounceVertical = false, bool? alwaysBounceHorizontal = false, bool? scrollsToTop = true, bool? isPagingEnabled = false, double? maximumZoomScale = 1.0, double? minimumZoomScale = 1.0, ScrollViewContentInsetAdjustmentBehavior? contentInsetAdjustmentBehavior = ScrollViewContentInsetAdjustmentBehavior.NEVER, bool? isDirectionalLockEnabled = false, String? mediaType, double? pageZoom = 1.0, bool? applePayAPIEnabled = false, WebUri? allowingReadAccessTo, bool? disableLongPressContextMenuOnLinks = false, bool? disableInputAccessoryView = false, bool? disableAutocorrection = false, Color? underPageBackgroundColor, bool? isTextInteractionEnabled = true, IOSWritingToolsBehavior? writingToolsBehavior, bool? isSiteSpecificQuirksModeEnabled = true, bool? upgradeKnownHostsToHTTPS = true, bool? isElementFullscreenEnabled = true, bool? useNativeFullscreenContainer = true, bool? isFindInteractionEnabled = false, EdgeInsets? minimumViewportInset, EdgeInsets? maximumViewportInset, bool? isInspectable = false, bool? shouldPrintBackgrounds = false, bool? allowBackgroundAudioPlaying = false, WebViewAssetLoader? webViewAssetLoader, Set<String> ? javaScriptHandlersOriginAllowList, bool? javaScriptHandlersForMainFrameOnly, bool? javaScriptBridgeEnabled = true, Set<String> ? javaScriptBridgeOriginAllowList, bool? javaScriptBridgeForMainFrameOnly, Set<String> ? pluginScriptsOriginAllowList, bool? pluginScriptsForMainFrameOnly = false, int? scrollMultiplier = 1, bool? statusBarEnabled = true, bool? browserAcceleratorKeysEnabled = true, bool? generalAutofillEnabled = true, bool? passwordAutosaveEnabled = false, bool? pinchZoomEnabled = true, bool? reputationCheckingRequired = true, bool? nonClientRegionSupportEnabled = false, bool? isUserInteractionEnabled = true, bool? handleAcceleratorKeyPressed = false, double? alpha, bool? useOnShowFileChooser, String? iframeAllow, bool? iframeAllowFullscreen, Set<Sandbox> ? iframeSandbox, ReferrerPolicy? iframeReferrerPolicy, String? iframeName, String? iframeCsp, String? iframeRole, String? iframeAriaHidden, bool? enableWriteConsoleMessagesToStdout = false, bool? enableSmoothScrolling = true, bool? enableCaretBrowsing = false, bool? enablePageCache = true, bool? drawCompositingIndicators = false, bool? enableResizableTextAreas = true, bool? enableTabsToLinks = true, String? pictographFontFamily, List<String> ? corsAllowlist, bool? itpEnabled = false, bool? darkMode, bool? disableAnimations, bool? fontAntialias, FontHintingStyle? fontHintingStyle, FontSubpixelLayout? fontSubpixelLayout, double? fontDPI, int? cursorBlinkTime, int? doubleClickDistance, int? doubleClickTime, int? dragThreshold, int? keyRepeatDelay, int? keyRepeatInterval, bool? javaScriptCanAccessClipboard = false, bool? allowModalDialogs = false, bool? disableWebSecurity = false, bool? enableWebRTC = true, String? webRTCUdpPortsRange, bool? enableMedia = true, bool? enableEncryptedMedia = true, bool? enableMediaCapabilities = true, bool? enableMockCaptureDevices = false, String? mediaContentTypesRequiringHardwareSupport, bool? enableJavaScriptMarkup = true, bool? enable2DCanvasAcceleration = false, }) - Officially Supported Platforms/Implementations:
Properties
- accessibilityIgnoresInvertColors ↔ bool?
-
A Boolean value indicating whether the WebView ignores an accessibility request to invert its colors.
The default value is
false.getter/setter pair - algorithmicDarkeningAllowed ↔ bool?
-
Control whether algorithmic darkening is allowed.
getter/setter pair
- allowBackgroundAudioPlaying ↔ bool?
-
Set to
trueto allow audio playing when the app goes in background or the screen is locked or another app is opened. However, there will be no controls in the notification bar or on the lockscreen. Also, make sure to not call PlatformInAppWebViewController.pause, otherwise it will stop audio playing. The default value isfalse.getter/setter pair - allowContentAccess ↔ bool?
-
Enables or disables content URL access within WebView. Content URL access allows WebView to load content from a content provider installed in the system. The default value is
true.getter/setter pair - allowFileAccess ↔ bool?
-
Enables or disables file access within WebView. Note that this enables or disables file system access only.
Assets and resources are still accessible using
file:///android_assetandfile:///android_res. The default value istrue.getter/setter pair - allowFileAccessFromFileURLs ↔ bool?
-
Sets whether cross-origin requests in the context of a file scheme URL should be allowed to access content from other file scheme URLs.
Note that some accesses such as image HTML elements don't follow same-origin rules and aren't affected by this setting.
getter/setter pair
- allowingReadAccessTo ↔ WebUri?
-
Used in combination with PlatformWebViewCreationParams.initialUrlRequest or PlatformWebViewCreationParams.initialData (using the
file://scheme), it represents the URL from which to read the web content. This URL must be a file-based URL (using thefile://scheme). Specify the same value as the URLRequest.url if you are using it with the PlatformWebViewCreationParams.initialUrlRequest parameter or the InAppWebViewInitialData.baseUrl if you are using it with the PlatformWebViewCreationParams.initialData parameter to prevent WebView from reading any other content. Specify a directory to give WebView permission to read additional files in the specified directory.getter/setter pair - allowModalDialogs ↔ bool?
-
Sets whether modal dialogs are allowed.
When enabled, modal dialogs (such as
window.showModalDialog()) are allowed.getter/setter pair - allowsAirPlayForMediaPlayback ↔ bool?
-
Set to
trueto allow AirPlay. The default value istrue.getter/setter pair -
Set to
trueto allow the horizontal swipe gestures trigger back-forward list navigations.getter/setter pair - allowsInlineMediaPlayback ↔ bool?
-
Set to
trueto allow HTML5 media playback to appear inline within the screen layout, using browser-supplied controls rather than native controls. For this to work, add thewebkit-playsinlineattribute to any<video>elements. The default value isfalse.getter/setter pair - allowsLinkPreview ↔ bool?
-
Set to
trueto allow that pressing on a link displays a preview of the destination for the link. The default value istrue.getter/setter pair - allowsPictureInPictureMediaPlayback ↔ bool?
-
Set to
trueto allow HTML5 videos play picture-in-picture. The default value istrue.getter/setter pair -
Sets whether top-level navigation to data: URLs is allowed.
When disabled, navigating to data: URLs in the top frame is blocked.
getter/setter pair
- allowUniversalAccessFromFileURLs ↔ bool?
-
Sets whether cross-origin requests in the context of a file scheme URL should be allowed to access content from any origin.
This includes access to content from other file scheme URLs or web contexts.
Note that some access such as image HTML elements doesn't follow same-origin rules and isn't affected by this setting.
getter/setter pair
- alpha ↔ double?
-
The view’s alpha value. The value of this property is a floating-point number
in the range 0.0 to 1.0, where 0.0 represents totally transparent and 1.0 represents totally opaque.
getter/setter pair
- alwaysBounceHorizontal ↔ bool?
-
A Boolean value that determines whether bouncing always occurs when horizontal scrolling reaches the end of the content view.
If this property is set to
trueand InAppWebViewSettings.disallowOverScroll isfalse, horizontal dragging is allowed even if the content is smaller than the bounds of the scroll view. The default value isfalse.getter/setter pair - alwaysBounceVertical ↔ bool?
-
A Boolean value that determines whether bouncing always occurs when vertical scrolling reaches the end of the content.
If this property is set to
trueand InAppWebViewSettings.disallowOverScroll isfalse, vertical dragging is allowed even if the content is smaller than the bounds of the scroll view. The default value isfalse.getter/setter pair - appCachePath ↔ String?
-
Sets the path to the Application Caches files. In order for the Application Caches API to be enabled, this option must be set a path to which the application can write.
This option is used one time: repeated calls are ignored.
getter/setter pair
- applePayAPIEnabled ↔ bool?
-
Set to
trueto enable Apple Pay API for theWebViewat its first page load or on the next page load (using PlatformInAppWebViewController.setOptions). The default value isfalse.getter/setter pair - applicationNameForUserAgent ↔ String?
-
Append to the existing user-agent. Setting userAgent will override this.
getter/setter pair
- automaticallyAdjustsScrollIndicatorInsets ↔ bool?
-
Configures whether the scroll indicator insets are automatically adjusted by the system.
The default value is
false.getter/setter pair - blockNetworkImage ↔ bool?
-
Sets whether the WebView should not load image resources from the network (resources accessed via http and https URI schemes). The default value is
false.getter/setter pair - blockNetworkLoads ↔ bool?
-
Sets whether the WebView should not load resources from the network. The default value is
false.getter/setter pair - browserAcceleratorKeysEnabled ↔ bool?
-
When this setting is set to
false, it disables all accelerator keys that access features specific to a web browser, including but not limited to:getter/setter pair - builtInZoomControls ↔ bool?
-
Set to
trueif the WebView should use its built-in zoom mechanisms. The default value istrue.getter/setter pair - cacheEnabled ↔ bool?
-
Sets whether WebView should use browser caching. The default value is
true.getter/setter pair - cacheMode ↔ CacheMode?
-
Overrides the way the cache is used. The way the cache is used is based on the navigation type. For a normal page load, the cache is checked and content is re-validated as needed.
When navigating back, content is not revalidated, instead the content is just retrieved from the cache. The default value is CacheMode.LOAD_DEFAULT.
getter/setter pair
- clearCache ↔ bool?
-
Use PlatformInAppWebViewController.clearAllCache instead.
getter/setter pair
- clearSessionCache ↔ bool?
-
Use PlatformCookieManager.removeSessionCookies instead.
getter/setter pair
- containerId ↔ String?
-
Joins the named Android WebView storage container at construction time.
getter/setter pair
-
contentBlockers
↔ List<
ContentBlocker> ? -
List of ContentBlocker that are a set of rules used to block content in the browser window.
getter/setter pair
- contentInsetAdjustmentBehavior ↔ ScrollViewContentInsetAdjustmentBehavior?
-
Configures how safe area insets are added to the adjusted content inset.
The default value is ScrollViewContentInsetAdjustmentBehavior.NEVER.
getter/setter pair
-
corsAllowlist
↔ List<
String> ? -
Sets the CORS allowlist for this WebView.
getter/setter pair
- cursiveFontFamily ↔ String?
-
Sets the cursive font family name. The default value is
"cursive".getter/setter pair - cursorBlinkTime ↔ int?
-
Sets the cursor blink time in milliseconds.
This controls how frequently the text cursor blinks in input fields.
getter/setter pair
- darkMode ↔ bool?
-
Sets whether dark mode is enabled for web content.
When enabled, websites that support the
prefers-color-scheme: darkCSS media query will render in dark mode.getter/setter pair - databaseEnabled ↔ bool?
-
Set to
trueif you want the database storage API is enabled. The default value istrue.getter/setter pair -
dataDetectorTypes
↔ List<
DataDetectorTypes> ? -
Specifying a dataDetectoryTypes value adds interactivity to web content that matches the value.
For example, Safari adds a link to “apple.com” in the text “Visit apple.com” if the dataDetectorTypes property is set to DataDetectorTypes.LINK.
The default value is DataDetectorTypes.NONE.
getter/setter pair
- decelerationRate ↔ ScrollViewDecelerationRate?
-
A ScrollViewDecelerationRate value that determines the rate of deceleration after the user lifts their finger.
The default value is ScrollViewDecelerationRate.NORMAL.
getter/setter pair
- defaultFixedFontSize ↔ int?
-
Sets the default fixed font size. The default value is
16.getter/setter pair - defaultFontSize ↔ int?
-
Sets the default font size. The default value is
16.getter/setter pair - defaultTextEncodingName ↔ String?
-
Sets the default text encoding name to use when decoding html pages. The default value is
"UTF-8".getter/setter pair - defaultVideoPoster ↔ Uint8List?
-
When not playing, video elements are represented by a 'poster' image.
The image to use can be specified by the poster attribute of the video tag in HTML.
If the attribute is absent, then a default poster will be used.
This property allows the WebView to provide that default image.
getter/setter pair
- disableAnimations ↔ bool?
-
Sets whether animations are disabled for accessibility.
When enabled, CSS animations and transitions may be reduced or disabled
for users with motion sensitivity.
getter/setter pair
- disableAutocorrection ↔ bool?
-
Set to
trueto disable autocorrection and spelling suggestions for editable HTML elements in the WebView. This applies the HTMLautocorrect="off"andspellcheck="false"hints at document start, including editable elements added later by the page. This is a content hint and does not change the system keyboard setting globally. On platforms with a web content engine, it maps toautocorrect="off"andspellcheck="false"for editable elements. The default value isfalse.getter/setter pair - disableContextMenu ↔ bool?
-
Set to
trueto disable context menu. The default value isfalse.getter/setter pair - disabledActionModeMenuItems ↔ ActionModeMenuItem?
-
Disables the action mode menu items according to menuItems flag.
getter/setter pair
- disableDefaultErrorPage ↔ bool?
-
Sets whether the default Android WebView’s internal error page should be suppressed or displayed for bad navigations.
truemeans suppressed (not shown),falsemeans it will be displayed. The default value isfalse.getter/setter pair - disableHorizontalScroll ↔ bool?
-
Set to
trueto disable horizontal scroll. The default value isfalse.getter/setter pair - disableInputAccessoryView ↔ bool?
-
Set to
trueto disable the inputAccessoryView above system keyboard. The default value isfalse.getter/setter pair - disableLongPressContextMenuOnLinks ↔ bool?
-
Set to
trueto disable the context menu (copy, select, etc.) that is shown when the user emits a long press event on a HTML link. This is implemented using also JavaScript, so it must be enabled or it won't work. The default value isfalse.getter/setter pair - disableVerticalScroll ↔ bool?
-
Set to
trueto disable vertical scroll. The default value isfalse.getter/setter pair - disableWebSecurity ↔ bool?
-
Disables web security. When disabled, same-origin policy is not enforced.
getter/setter pair
- disallowOverScroll ↔ bool?
-
Set to
trueto disable the bouncing of the WebView when the scrolling has reached an edge of the content. The default value isfalse.getter/setter pair - displayZoomControls ↔ bool?
-
Set to
trueif the WebView should display on-screen zoom controls when using the built-in zoom mechanisms. The default value isfalse.getter/setter pair - domStorageEnabled ↔ bool?
-
Set to
trueif you want the DOM storage API is enabled. The default value istrue.getter/setter pair - doubleClickDistance ↔ int?
-
Sets the double-click distance threshold in pixels.
Two clicks within this distance are considered a double-click.
getter/setter pair
- doubleClickTime ↔ int?
-
Sets the double-click time threshold in milliseconds.
Two clicks within this time are considered a double-click.
getter/setter pair
- dragThreshold ↔ int?
-
Sets the drag threshold in pixels.
The pointer must move at least this many pixels to start a drag operation.
getter/setter pair
- drawCompositingIndicators ↔ bool?
-
Sets whether compositing indicators are drawn.
When enabled, visual indicators are shown for compositing layers.
This is primarily useful for debugging rendering performance.
getter/setter pair
- enable2DCanvasAcceleration ↔ bool?
-
Sets whether 2D canvas hardware acceleration is enabled.
When enabled, 2D canvas operations are accelerated using the GPU.
getter/setter pair
- enableCaretBrowsing ↔ bool?
-
Sets whether caret browsing mode is enabled.
Caret browsing mode allows users to navigate through web pages using the keyboard,
with a visible caret (text cursor) that can be moved through the content.
getter/setter pair
- enableEncryptedMedia ↔ bool?
-
Sets whether Encrypted Media Extensions (EME) are enabled.
EME provides APIs for playing protected (DRM) content.
getter/setter pair
- enableJavaScriptMarkup ↔ bool?
-
Sets whether JavaScript markup (
getter/setter pair
- enableMedia ↔ bool?
-
Sets whether media (audio/video) is enabled.
When disabled, media elements will not be able to play.
getter/setter pair
- enableMediaCapabilities ↔ bool?
-
Sets whether the Media Capabilities API is enabled.
The Media Capabilities API provides information about the decoding abilities of the device.
getter/setter pair
- enableMockCaptureDevices ↔ bool?
-
Sets whether mock capture devices are enabled.
When enabled, the browser will use mock devices for getUserMedia() instead of real hardware.
This is useful for testing.
getter/setter pair
- enablePageCache ↔ bool?
-
Sets whether the page cache is enabled.
The page cache allows for faster back/forward navigation by keeping pages in memory.
getter/setter pair
- enableResizableTextAreas ↔ bool?
-
Sets whether text areas are resizable.
When enabled, text areas can be resized by the user.
getter/setter pair
- enableSmoothScrolling ↔ bool?
-
Sets whether smooth scrolling is enabled.
When enabled, scrolling animations are smooth instead of jumping instantly.
getter/setter pair
-
Sets whether spatial navigation is enabled.
Spatial navigation allows users to navigate between focusable elements
using arrow keys instead of Tab.
getter/setter pair
- enableTabsToLinks ↔ bool?
-
Sets whether tab key can be used to navigate to links.
When enabled, pressing Tab will focus on links in the page.
getter/setter pair
- enableViewportScale ↔ bool?
-
Set to
trueto allow a viewport meta tag to either disable or restrict the range of user scaling. The default value isfalse.getter/setter pair - enableWebRTC ↔ bool?
-
Enables WebRTC support for real-time communication features.
getter/setter pair
- enableWriteConsoleMessagesToStdout ↔ bool?
-
Sets whether console messages are written to stdout.
When enabled, console messages from the web page will be written to the standard output.
This is useful for debugging purposes.
getter/setter pair
- enterpriseAuthenticationAppLinkPolicyEnabled ↔ bool?
-
Sets whether EnterpriseAuthenticationAppLinkPolicy if set by admin is allowed to have any
effect on WebView.
getter/setter pair
- fantasyFontFamily ↔ String?
-
Sets the fantasy font family name. The default value is
"fantasy".getter/setter pair - fixedFontFamily ↔ String?
-
Sets the fixed font family name. The default value is
"monospace".getter/setter pair - fontAntialias ↔ bool?
-
Sets whether font antialiasing is enabled.
When enabled, fonts are rendered with antialiasing for smoother edges.
getter/setter pair
- fontDPI ↔ double?
-
Sets the font DPI (dots per inch) for text rendering.
This affects the size at which fonts are rendered.
getter/setter pair
- fontHintingStyle ↔ FontHintingStyle?
-
Sets the font hinting style.
Hinting adjusts font outlines to improve rendering at small sizes.
getter/setter pair
- fontSubpixelLayout ↔ FontSubpixelLayout?
-
Sets the font subpixel layout for LCD rendering.
This determines how subpixel rendering is performed based on the
physical arrangement of the display's RGB subpixels.
getter/setter pair
- forceDark ↔ ForceDark?
-
Use algorithmicDarkeningAllowed instead.
getter/setter pair
- forceDarkStrategy ↔ ForceDarkStrategy?
-
Use algorithmicDarkeningAllowed instead.
getter/setter pair
- generalAutofillEnabled ↔ bool?
-
Specifies whether autofill for information like names, street and email addresses, phone numbers, and arbitrary input is enabled.
getter/setter pair
- geolocationEnabled ↔ bool?
-
Sets whether Geolocation is enabled. The default is
true.getter/setter pair - handleAcceleratorKeyPressed ↔ bool?
-
A Boolean value that determines whether to listen and handle the
PlatformWebViewCreationParams.onAcceleratorKeyPressed event.
getter/setter pair
- hardwareAcceleration ↔ bool?
-
Boolean value to enable Hardware Acceleration in the WebView.
The default value is
true.getter/setter pair - hashCode → int
-
The hash code for this object.
no setterinherited
-
This property is used to customize the PDF toolbar items.
getter/setter pair
- horizontalScrollBarEnabled ↔ bool?
-
Define whether the horizontal scrollbar should be drawn or not. The default value is
true.getter/setter pair - horizontalScrollbarThumbColor ↔ Color?
-
Sets the horizontal scrollbar thumb color.
getter/setter pair
- horizontalScrollbarTrackColor ↔ Color?
-
Sets the horizontal scrollbar track color.
getter/setter pair
- iframeAllow ↔ String?
-
Specifies a feature policy for the
<iframe>. The policy defines what features are available to the<iframe>based on the origin of the request (e.g. access to the microphone, camera, battery, web-share API, etc.).getter/setter pair - iframeAllowFullscreen ↔ bool?
-
Set to true if the
<iframe>can activate fullscreen mode by calling therequestFullscreen()method.getter/setter pair - iframeAriaHidden ↔ String?
-
A string that reflects the
aria-hiddenHTML attribute, indicating whether the element is exposed to an accessibility API.getter/setter pair - iframeCsp ↔ String?
-
A Content Security Policy enforced for the embedded resource.
getter/setter pair
- iframeName ↔ String?
-
A string that reflects the
nameHTML attribute, containing a name by which to refer to the frame.getter/setter pair - iframeReferrerPolicy ↔ ReferrerPolicy?
-
A string that reflects the
referrerpolicyHTML attribute indicating which referrer to use when fetching the linked resource.getter/setter pair - iframeRole ↔ String?
-
A string that reflects the
roleHTML attribute, containing a WAI-ARIA role for the element.getter/setter pair -
iframeSandbox
↔ Set<
Sandbox> ? -
Applies extra restrictions to the content in the frame.
getter/setter pair
- ignoresViewportScaleLimits ↔ bool?
-
Set to
trueif you want that the WebView should always allow scaling of the webpage, regardless of the author's intent. The ignoresViewportScaleLimits property overrides theuser-scalableHTML property in a webpage. The default value isfalse.getter/setter pair - incognito ↔ bool?
-
Set to
trueto open a browser window with incognito mode. The default value isfalse.getter/setter pair - initialScale ↔ int?
-
Sets the initial scale for this WebView. 0 means default. The behavior for the default scale depends on the state of useWideViewPort and loadWithOverviewMode.
If the content fits into the WebView control by width, then the zoom is set to 100%. For wide content, the behavior depends on the state of loadWithOverviewMode.
If its value is true, the content will be zoomed out to be fit by width into the WebView control, otherwise not.
If initial scale is greater than 0, WebView starts with this value as initial scale.
Please note that unlike the scale properties in the viewport meta tag, this method doesn't take the screen density into account.
The default is
0.getter/setter pair - interceptOnlyAsyncAjaxRequests ↔ bool?
-
Set to
falseto be able to listen to also syncXMLHttpRequests at the PlatformWebViewCreationParams.shouldInterceptAjaxRequest event.getter/setter pair - isDirectionalLockEnabled ↔ bool?
-
A Boolean value that determines whether scrolling is disabled in a particular direction.
If this property is
false, scrolling is permitted in both horizontal and vertical directions. If this property istrueand the user begins dragging in one general direction (horizontally or vertically), the scroll view disables scrolling in the other direction. If the drag direction is diagonal, then scrolling will not be locked and the user can drag in any direction until the drag completes. The default value isfalse.getter/setter pair - isElementFullscreenEnabled ↔ bool?
-
Sets whether fullscreen API is enabled or not.
getter/setter pair
- isFindInteractionEnabled ↔ bool?
-
Sets whether the web view's built-in find interaction native UI is enabled or not.
getter/setter pair
- isFraudulentWebsiteWarningEnabled ↔ bool?
-
A Boolean value indicating whether warnings should be shown for suspected fraudulent content such as phishing or malware.
According to the official documentation, this feature is currently available in the following region: China.
The default value is
true.getter/setter pair - isInspectable ↔ bool?
-
Controls whether this WebView is inspectable in Web Inspector.
getter/setter pair
- isPagingEnabled ↔ bool?
-
A Boolean value that determines whether paging is enabled for the scroll view.
If the value of this property is true, the scroll view stops on multiples of the scroll view’s bounds when the user scrolls.
The default value is
false.getter/setter pair - isSiteSpecificQuirksModeEnabled ↔ bool?
-
A Boolean value indicating whether WebKit will apply built-in workarounds (quirks)
to improve compatibility with certain known websites. You can disable site-specific quirks
to help test your website without these workarounds. The default value is
true.getter/setter pair - isTextInteractionEnabled ↔ bool?
-
A Boolean value indicating whether text interaction is enabled or not.
The default value is
true.getter/setter pair - isUserInteractionEnabled ↔ bool?
-
A Boolean value that determines whether user events are ignored and removed from the event queue.
getter/setter pair
- itpEnabled ↔ bool?
-
Sets whether Intelligent Tracking Prevention (ITP) is enabled.
getter/setter pair
- javaScriptBridgeEnabled ↔ bool?
-
Set to
falseto disable the JavaScript Bridge completely. This will affect also all the internal plugin UserScripts that are using the JavaScript Bridge to work.getter/setter pair - javaScriptBridgeForMainFrameOnly ↔ bool?
-
Set to
trueto allow the JavaScript Bridge only on the main frame. If pluginScriptsForMainFrameOnly is present, then this value will override it only for the JavaScript Bridge internal plugin.getter/setter pair -
javaScriptBridgeOriginAllowList
↔ Set<
String> ? -
A Set of patterns that will be used to match the allowed origins where
the JavaScript Bridge could be used.
If pluginScriptsOriginAllowList is present, then this value will override
it only for the JavaScript Bridge internal plugin.
Adding
'*'as an allowed origin or setting this tonull, it means it will allow every origin. Instead, an empty Set will block every origin and, in this case, it will force the behaviour of the javaScriptBridgeEnabled parameter, as it was set tofalse.getter/setter pair - javaScriptCanAccessClipboard ↔ bool?
-
Sets whether JavaScript can access the clipboard.
When enabled, JavaScript can read from and write to the system clipboard.
getter/setter pair
- javaScriptCanOpenWindowsAutomatically ↔ bool?
-
Set to
trueto allow JavaScript open windows without user interaction. The default value isfalse.getter/setter pair - javaScriptEnabled ↔ bool?
-
Set to
trueto enable JavaScript. The default value istrue.getter/setter pair - javaScriptHandlersForMainFrameOnly ↔ bool?
-
Set to
trueto allow to execute the JavaScript Handlers only on the main frame. This will affect also the internal JavaScript Handlers used by the plugin itself. The default value isfalse.getter/setter pair -
javaScriptHandlersOriginAllowList
↔ Set<
String> ? -
A Set of Regular Expression Patterns that will be used on native side to match the allowed origins
that are able to execute the JavaScript Handlers defined for the current WebView.
This will affect also the internal JavaScript Handlers used by the plugin itself.
getter/setter pair
- keyRepeatDelay ↔ int?
-
Sets the key repeat delay in milliseconds.
This is the time a key must be held before it starts repeating.
getter/setter pair
- keyRepeatInterval ↔ int?
-
Sets the key repeat interval in milliseconds.
This is the time between repeated key events when a key is held down.
getter/setter pair
- layoutAlgorithm ↔ LayoutAlgorithm?
-
Sets the underlying layout algorithm. This will cause a re-layout of the WebView.
getter/setter pair
-
A Boolean value that indicates whether the web view limits navigation to pages within the app’s domain.
Check App-Bound Domains for more details.
The default value is
false.getter/setter pair - loadsImagesAutomatically ↔ bool?
-
Sets whether the WebView should load image resources. Note that this method controls loading of all images, including those embedded using the data URI scheme.
Note that if the value of this setting is changed from false to true, all images resources referenced by content currently displayed by the WebView are loaded automatically.
The default value is
true.getter/setter pair - loadWithOverviewMode ↔ bool?
-
Sets whether the WebView loads pages in overview mode, that is, zooms out the content to fit on screen by width.
This setting is taken into account when the content width is greater than the width of the WebView control, for example, when useWideViewPort is enabled.
The default value is
false.getter/setter pair - maximumViewportInset ↔ EdgeInsets?
-
Set maximum viewport inset to the largest inset a webpage may experience in your app's maximally expanded UI configuration.
Values must be either zero or positive. It must be larger than minimumViewportInset.
getter/setter pair
- maximumZoomScale ↔ double?
-
A floating-point value that specifies the maximum scale factor that can be applied to the scroll view's content.
This value determines how large the content can be scaled.
It must be greater than the minimum zoom scale for zooming to be enabled.
The default value is
1.0.getter/setter pair - mediaContentTypesRequiringHardwareSupport ↔ String?
-
Sets the media content types that require hardware support.
This is a comma-separated list of media content types.
getter/setter pair
- mediaPlaybackRequiresUserGesture ↔ bool?
-
Set to
trueto prevent HTML5 audio or video from autoplaying. The default value istrue.getter/setter pair - mediaType ↔ String?
-
The media type for the contents of the web view.
When the value of this property is
null, the web view derives the current media type from the CSS media property of its content. If you assign a value other thannullto this property, the web view uses the value you provide instead. The default value of this property isnull.getter/setter pair - minimumFontSize ↔ int?
-
Sets the minimum font size. The default value is
8for Android,0for iOS.getter/setter pair - minimumLogicalFontSize ↔ int?
-
Sets the minimum logical font size. The default is
8.getter/setter pair - minimumViewportInset ↔ EdgeInsets?
-
Set minimum viewport inset to the smallest inset a webpage may experience in your app's maximally collapsed UI configuration.
Values must be either zero or positive. It must be smaller than maximumViewportInset.
getter/setter pair
- minimumZoomScale ↔ double?
-
A floating-point value that specifies the minimum scale factor that can be applied to the scroll view's content.
This value determines how small the content can be scaled.
The default value is
1.0.getter/setter pair - mixedContentMode ↔ MixedContentMode?
-
Configures the WebView's behavior when a secure origin attempts to load a resource from an insecure origin.
getter/setter pair
- needInitialFocus ↔ bool?
-
Tells the WebView whether it needs to set a node. The default value is
true.getter/setter pair - networkAvailable ↔ bool?
-
Informs WebView of the network state.
This is used to set the JavaScript property
window.navigator.isOnlineand generates the online/offline event as specified in HTML5, sec. 5.7.7.getter/setter pair - nonClientRegionSupportEnabled ↔ bool?
-
Enables web pages to use the
app-regionCSS style.getter/setter pair - offscreenPreRaster ↔ bool?
-
Sets whether this WebView should raster tiles when it is offscreen but attached to a window.
Turning this on can avoid rendering artifacts when animating an offscreen WebView on-screen.
Offscreen WebViews in this mode use more memory. The default value is
false.getter/setter pair - overScrollMode ↔ OverScrollMode?
-
Sets the WebView's over-scroll mode.
Setting the over-scroll mode of a WebView will have an effect only if the WebView is capable of scrolling.
The default value is OverScrollMode.IF_CONTENT_SCROLLS.
getter/setter pair
- pageZoom ↔ double?
-
The scale factor by which the web view scales content relative to its bounds.
The default value of this property is
1.0, which displays the content without any scaling. Changing the value of this property is equivalent to setting the CSSzoomproperty on all page content.getter/setter pair - passwordAutosaveEnabled ↔ bool?
-
Specifies whether autosave for password information is enabled.
getter/setter pair
- paymentRequestEnabled ↔ bool?
-
Enables the Android Payment Request API for this WebView.
getter/setter pair
- pictographFontFamily ↔ String?
-
Sets the pictograph font family name.
The pictograph font family is used for rendering pictograph characters (emoji).
getter/setter pair
- pinchZoomEnabled ↔ bool?
-
Pinch-zoom, referred to as "Page Scale" zoom, is performed as a post-rendering step,
it changes the page scale factor property and scales the surface the web page
is rendered onto when user performs a pinch zooming action.
getter/setter pair
- pluginScriptsForMainFrameOnly ↔ bool?
-
Set to
trueto allow internal plugin UserScripts only on the main frame.getter/setter pair -
pluginScriptsOriginAllowList
↔ Set<
String> ? -
A Set of patterns that will be used to match the allowed origins
that are able to load all the internal plugin UserScripts used by the plugin itself.
Adding
'*'as an allowed origin or setting this tonull, it means it will allow every origin. Instead, an empty Set will block every origin.getter/setter pair - preferredContentMode ↔ UserPreferredContentMode?
-
Sets the content mode that the WebView needs to use when loading and rendering a webpage. The default value is UserPreferredContentMode.RECOMMENDED.
getter/setter pair
- proxySettings ↔ ProxySettings?
-
Sets proxy settings for this WebView's data store or network session.
getter/setter pair
- regexToAllowSyncUrlLoading ↔ String?
-
Regular expression used on native side by the PlatformWebViewCreationParams.shouldOverrideUrlLoading
event to allow navigation requests synchronously.
If the url request match the regular expression, then the request is allowed automatically,
and the PlatformWebViewCreationParams.shouldOverrideUrlLoading event will not be fired.
getter/setter pair
- regexToCancelSubFramesLoading ↔ String?
-
Regular expression used on native side by the PlatformWebViewCreationParams.shouldOverrideUrlLoading
event to cancel navigation requests for frames that are not the main frame.
If the url request of a sub-frame matches the regular expression, then the request of that sub-frame is canceled.
getter/setter pair
- rendererPriorityPolicy ↔ RendererPriorityPolicy?
-
Sets the renderer priority policy for this WebView.
getter/setter pair
- reputationCheckingRequired ↔ bool?
-
reputationCheckingRequired is used to control whether SmartScreen enabled or not.
getter/setter pair
-
requestedWithHeaderOriginAllowList
↔ Set<
String> ? -
Set an allow-list of origins to receive the X-Requested-With HTTP header from the WebView owning the passed InAppWebViewSettings.
getter/setter pair
-
resourceCustomSchemes
↔ List<
String> ? -
List of custom schemes that the WebView must handle. Use the PlatformWebViewCreationParams.onLoadResourceWithCustomScheme event to intercept resource requests with custom scheme.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- safeBrowsingEnabled ↔ bool?
-
Sets whether Safe Browsing is enabled. Safe Browsing allows WebView to protect against malware and phishing attacks by verifying the links.
Safe Browsing is enabled by default for devices which support it.
getter/setter pair
- sansSerifFontFamily ↔ String?
-
Sets the sans-serif font family name. The default value is
"sans-serif".getter/setter pair - saveFormData ↔ bool?
-
Sets whether the WebView should save form data. In Android O, the platform has implemented a fully functional Autofill feature to store form data.
Therefore, the Webview form data save feature is disabled. Note that the feature will continue to be supported on older versions of Android as before.
The default value is
true.getter/setter pair - scrollBarDefaultDelayBeforeFade ↔ int?
-
Defines the delay in milliseconds that a scrollbar waits before fade out.
getter/setter pair
- scrollBarFadeDuration ↔ int?
-
Defines the scrollbar fade duration in milliseconds.
getter/setter pair
- scrollbarFadingEnabled ↔ bool?
-
Defines whether scrollbars will fade when the view is not scrolling.
The default value is
true.getter/setter pair - scrollBarStyle ↔ ScrollBarStyle?
-
Specifies the style of the scrollbars. The scrollbars can be overlaid or inset.
When inset, they add to the padding of the view. And the scrollbars can be drawn inside the padding area or on the edge of the view.
For example, if a view has a background drawable and you want to draw the scrollbars inside the padding specified by the drawable,
you can use SCROLLBARS_INSIDE_OVERLAY or SCROLLBARS_INSIDE_INSET. If you want them to appear at the edge of the view, ignoring the padding,
then you can use SCROLLBARS_OUTSIDE_OVERLAY or SCROLLBARS_OUTSIDE_INSET.
The default value is ScrollBarStyle.SCROLLBARS_INSIDE_OVERLAY.
getter/setter pair
- scrollMultiplier ↔ int?
-
The multiplier applied to the scroll amount for the WebView.
getter/setter pair
- scrollsToTop ↔ bool?
-
A Boolean value that controls whether the scroll-to-top gesture is enabled.
The scroll-to-top gesture is a tap on the status bar. When a user makes this gesture,
the system asks the scroll view closest to the status bar to scroll to the top.
The default value is
true.getter/setter pair - selectionGranularity ↔ SelectionGranularity?
-
The level of granularity with which the user can interactively select content in the web view.
The default value is SelectionGranularity.DYNAMIC.
getter/setter pair
- serifFontFamily ↔ String?
-
Sets the serif font family name. The default value is
"sans-serif".getter/setter pair -
Set
trueif shared cookies fromHTTPCookieStorage.sharedshould used for every load request in the WebView. The default value isfalse.getter/setter pair - shouldPrintBackgrounds ↔ bool?
-
A Boolean value that indicates whether to include any background color or graphics when printing content.
getter/setter pair
- standardFontFamily ↔ String?
-
Sets the standard font family name. The default value is
"sans-serif".getter/setter pair - statusBarEnabled ↔ bool?
-
Specifies whether the status bar is displayed.
getter/setter pair
- supportMultipleWindows ↔ bool?
-
Sets whether the WebView supports multiple windows.
If set to
true, PlatformWebViewCreationParams.onCreateWindow event must be implemented by the host application. The default value isfalse.getter/setter pair - supportZoom ↔ bool?
-
Set to
falseif the WebView should not support zooming using its on-screen zoom controls and gestures. The default value istrue.getter/setter pair - suppressesIncrementalRendering ↔ bool?
-
Set to
trueif you want the WebView suppresses content rendering until it is fully loaded into memory. The default value isfalse.getter/setter pair - textZoom ↔ int?
-
Sets the text zoom of the page in percent. The default value is
100.getter/setter pair - thirdPartyCookiesEnabled ↔ bool?
-
Boolean value to enable third party cookies in the WebView.
Used on Android Lollipop and above only as third party cookies are enabled by default on Android Kitkat and below and on iOS.
The default value is
true.getter/setter pair - transparentBackground ↔ bool?
-
Set to
trueto make the background of the WebView transparent. If your app has a dark theme, this can prevent a white flash on initialization. The default value isfalse.getter/setter pair - underPageBackgroundColor ↔ Color?
-
The color the web view displays behind the active page, visible when the user scrolls beyond the bounds of the page.
getter/setter pair
- upgradeKnownHostsToHTTPS ↔ bool?
-
A Boolean value indicating whether HTTP requests to servers known to support HTTPS should be automatically upgraded to HTTPS requests.
The default value is
true.getter/setter pair - useHybridComposition ↔ bool?
-
Set to
falseto disable Flutter Hybrid Composition. The default value istrue. Hybrid Composition is supported starting with Flutter v1.20+.getter/setter pair - useNativeFullscreenContainer ↔ bool?
-
Sets whether Forge should keep the same
WKWebViewin a native fullscreen container on iOS 26 and later after a media seek or time change.getter/setter pair - useOnAjaxProgress ↔ bool?
-
Set to
trueto be able to listen at the PlatformWebViewCreationParams.onAjaxProgress event. Also, useShouldInterceptAjaxRequest must be set totrueto take effect.getter/setter pair - useOnAjaxReadyStateChange ↔ bool?
-
Set to
trueto be able to listen at the PlatformWebViewCreationParams.onAjaxReadyStateChange event. Also, useShouldInterceptAjaxRequest must be set totrueto take effect.getter/setter pair - useOnDownloadStart ↔ bool?
-
Set to
trueto be able to listen at the PlatformWebViewCreationParams.onDownloadStartRequest event.getter/setter pair - useOnLoadResource ↔ bool?
-
Set to
trueto be able to listen at the PlatformWebViewCreationParams.onLoadResource event.getter/setter pair -
Set to
trueto be able to listen to the PlatformWebViewCreationParams.onNavigationResponse event.getter/setter pair - useOnRenderProcessGone ↔ bool?
-
Set to
trueto be able to listen at the PlatformWebViewCreationParams.onRenderProcessGone event.getter/setter pair - useOnShowFileChooser ↔ bool?
-
Set to
trueto be able to listen at the PlatformWebViewCreationParams.onShowFileChooser event.getter/setter pair - userAgent ↔ String?
-
Sets the user-agent for the WebView.
getter/setter pair
-
userAgentMetadata
↔ Map<
String, dynamic> ? -
Customizes the Android User-Agent Client Hints metadata generated by the
WebView.
getter/setter pair
- useShouldInterceptAjaxRequest ↔ bool?
-
Set to
trueto be able to listen at the PlatformWebViewCreationParams.shouldInterceptAjaxRequest event.getter/setter pair - useShouldInterceptFetchRequest ↔ bool?
-
Set to
trueto be able to listen at the PlatformWebViewCreationParams.shouldInterceptFetchRequest event.getter/setter pair - useShouldInterceptRequest ↔ bool?
-
Set to
trueto be able to listen at the PlatformWebViewCreationParams.shouldInterceptRequest event.getter/setter pair - useShouldOverrideUrlLoading ↔ bool?
-
Set to
trueto be able to listen at the PlatformWebViewCreationParams.shouldOverrideUrlLoading event.getter/setter pair - useWideViewPort ↔ bool?
-
Set to
trueif the WebView should enable support for the "viewport" HTML meta tag or should use a wide viewport. When the value of the setting is false, the layout width is always set to the width of the WebView control in device-independent (CSS) pixels. When the value is true and the page contains the viewport meta tag, the value of the width specified in the tag is used. If the page does not contain the tag or does not provide a width, then a wide viewport will be used. The default value istrue.getter/setter pair - verticalScrollBarEnabled ↔ bool?
-
Define whether the vertical scrollbar should be drawn or not. The default value is
true.getter/setter pair - verticalScrollbarPosition ↔ VerticalScrollbarPosition?
-
Sets the position of the vertical scroll bar.
The default value is VerticalScrollbarPosition.SCROLLBAR_POSITION_DEFAULT.
getter/setter pair
- verticalScrollbarThumbColor ↔ Color?
-
Sets the vertical scrollbar thumb color.
getter/setter pair
- verticalScrollbarTrackColor ↔ Color?
-
Sets the vertical scrollbar track color.
getter/setter pair
- webAuthenticationSupport ↔ WebAuthenticationSupport?
-
Sets the WebAuthn support level for the Android WebView.
getter/setter pair
- webRTCUdpPortsRange ↔ String?
-
Sets the range of UDP ports for WebRTC connections.
getter/setter pair
- webViewAssetLoader ↔ WebViewAssetLoader?
-
Use a WebViewAssetLoader instance to load local files including application's static assets and resources using http(s):// URLs.
Loading local files using web-like URLs instead of
file://is desirable as it is compatible with the Same-Origin policy.getter/setter pair - writingToolsBehavior ↔ IOSWritingToolsBehavior?
-
Sets the preferred Apple Writing Tools experience for text in the WebView.
getter/setter pair
Methods
-
copy(
) → InAppWebViewSettings - Returns a copy of InAppWebViewSettings.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts instance to a map.
-
toMap(
{EnumMethod? enumMethod}) → Map< String, dynamic> - Converts instance to a map.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromMap(
Map< String, dynamic> ? map, {EnumMethod? enumMethod}) → InAppWebViewSettings? - Gets a possible InAppWebViewSettings instance from a Map value.
-
isPropertySupported(
InAppWebViewSettingsProperty property, {TargetPlatform? platform}) → bool -
Check if the given
propertyis supported by the defaultTargetPlatform or a specificplatform.