Skip to main content
Version: 6.x.x

InAppWebViewSettings

The InAppWebViewSettings class represents all the WebView settings available.

accessibilityIgnoresInvertColors

bool? accessibilityIgnoresInvertColors

A Boolean value indicating whether the WebView ignores an accessibility request to invert its colors. The default value is false.

Officially Supported Platforms/Implementations:

algorithmicDarkeningAllowed

bool? algorithmicDarkeningAllowed

Control whether algorithmic darkening is allowed.

WebView always sets the media query prefers-color-scheme according to the app's theme attribute isLightTheme, i.e. prefers-color-scheme is light if isLightTheme is true or not specified, otherwise it is dark. This means that the web content's light or dark style will be applied automatically to match the app's theme if the content supports it.

Algorithmic darkening is disallowed by default.

If the app's theme is dark and it allows algorithmic darkening, WebView will attempt to darken web content using an algorithm, if the content doesn't define its own dark styles and doesn't explicitly disable darkening.

NOTE for Android native WebView: available on Android only if WebViewFeature.ALGORITHMIC_DARKENING feature is supported.

Officially Supported Platforms/Implementations:

allowBackgroundAudioPlaying

bool? allowBackgroundAudioPlaying

Set to true to 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 is false.

IMPORTANT NOTE: if you use this setting, your app could be rejected by the Google Play Store. For example, if you allow background playing of YouTube videos, which is a violation of the YouTube API Terms of Service.

Officially Supported Platforms/Implementations:

  • Android native WebView

allowContentAccess

bool? allowContentAccess

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.

Officially Supported Platforms/Implementations:

allowFileAccess

bool? allowFileAccess

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_asset and file:///android_res. The default value is true.

Officially Supported Platforms/Implementations:

allowFileAccessFromFileURLs

bool? allowFileAccessFromFileURLs

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.

Don't enable this setting if you open files that may be created or altered by external sources. Enabling this setting allows malicious scripts loaded in a file:// context to access arbitrary local files including WebView cookies and app private data.

Note that the value of this setting is ignored if the value of allowUniversalAccessFromFileURLs is true.

The default value is false.

Officially Supported Platforms/Implementations:

allwUniversalAccessFromFileURLs;

bool? all

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.

Don't enable this setting if you open files that may be created or altered by external sources. Enabling this setting allows malicious scripts loaded in a file:// context to launch cross-site scripting attacks, either accessing arbitrary local files including WebView cookies, app private data or even credentials used on arbitrary web sites.

The default value is false.

Officially Supported Platforms/Implementations:

alowingReadAccessTo;

WebUri? a

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 the file:// 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.

Officially Supported Platforms/Implementations:

  • iOS
  • MacOS

allwsAirPlayForMediaPlayback;

bool? all

Set to true to allow AirPlay. The default value is true.

Officially Supported Platforms/Implementations:

allowsBackForwardNavigationGestures

bool? allowsBackForwardNavigationGestures

Set to true to allow the horizontal swipe gestures trigger back-forward list navigations. The default value is true.

Officially Supported Platforms/Implementations:

allowsInlineMediaPlayback

bool? allowsInlineMediaPlayback

Set to true to allow HTML5 media playback to appear inline within the screen layout, using browser-supplied controls rather than native controls. For this to work, add the webkit-playsinline attribute to any <video> elements. The default value is false.

Officially Supported Platforms/Implementations:

allowsLinkPreview

bool? allowsLinkPreview

Set to true to allow that pressing on a link displays a preview of the destination for the link. The default value is true.

Officially Supported Platforms/Implementations:

allowsPictureInPictureMediaPlayback

bool? allowsPictureInPictureMediaPlayback

Set to true to allow HTML5 videos play picture-in-picture. The default value is true.

Officially Supported Platforms/Implementations:

alwaysBounceHorizontal

bool? alwaysBounceHorizontal

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 true and InAppWebViewSettings.disallowOverScroll is false, horizontal dragging is allowed even if the content is smaller than the bounds of the scroll view. The default value is false.

Officially Supported Platforms/Implementations:

alwaysBounceVertical

bool? alwaysBounceVertical

A Boolean value that determines whether bouncing always occurs when vertical scrolling reaches the end of the content. If this property is set to true and InAppWebViewSettings.disallowOverScroll is false, vertical dragging is allowed even if the content is smaller than the bounds of the scroll view. The default value is false.

Officially Supported Platforms/Implementations:

appCachePath

String? appCachePath

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.

Officially Supported Platforms/Implementations:

  • Android native WebView (Official API - WebSettings.setAppCachePath)

applePayAPIEnabled

bool? applePayAPIEnabled

Set to true to enable Apple Pay API for the WebView at its first page load or on the next page load (using PlatformInAppWebViewController.setOptions). The default value is false.

IMPORTANT NOTE: As written in the official Safari 13 Release Notes, it won't work if any script injection APIs are used (such as PlatformInAppWebViewController.evaluateJavascript or UserScript). So, when this attribute is true, all the methods, options, and events implemented using JavaScript won't be called or won't do anything and the result will always be null.

Methods affected:

  • PlatformInAppWebViewController.addUserScript
  • PlatformInAppWebViewController.addUserScripts
  • PlatformInAppWebViewController.removeUserScript
  • PlatformInAppWebViewController.removeUserScripts
  • PlatformInAppWebViewController.removeAllUserScripts
  • PlatformInAppWebViewController.evaluateJavascript
  • PlatformInAppWebViewController.callAsyncJavaScript
  • PlatformInAppWebViewController.injectJavascriptFileFromUrl
  • PlatformInAppWebViewController.injectJavascriptFileFromAsset
  • PlatformInAppWebViewController.injectCSSCode
  • PlatformInAppWebViewController.injectCSSFileFromUrl
  • PlatformInAppWebViewController.injectCSSFileFromAsset
  • PlatformInAppWebViewController.findAllAsync
  • PlatformInAppWebViewController.findNext
  • PlatformInAppWebViewController.clearMatches
  • PlatformInAppWebViewController.pauseTimers
  • PlatformInAppWebViewController.getSelectedText
  • PlatformInAppWebViewController.getHitTestResult
  • PlatformInAppWebViewController.requestFocusNodeHref
  • PlatformInAppWebViewController.requestImageRef
  • PlatformInAppWebViewController.postWebMessage
  • PlatformInAppWebViewController.createWebMessageChannel
  • PlatformInAppWebViewController.addWebMessageListener

Also, on MacOS:

  • PlatformInAppWebViewController.getScrollX
  • PlatformInAppWebViewController.getScrollY
  • PlatformInAppWebViewController.scrollTo
  • PlatformInAppWebViewController.scrollBy
  • PlatformInAppWebViewController.getContentHeight
  • PlatformInAppWebViewController.getContentWidth
  • PlatformInAppWebViewController.canScrollVertically
  • PlatformInAppWebViewController.canScrollHorizontally

Settings affected:

  • PlatformWebViewCreationParams.initialUserScripts
  • InAppWebViewSettings.supportZoom
  • InAppWebViewSettings.useOnLoadResource
  • InAppWebViewSettings.useShouldInterceptAjaxRequest
  • InAppWebViewSettings.useShouldInterceptFetchRequest
  • InAppWebViewSettings.enableViewportScale

Events affected:

  • the hitTestResult argument of PlatformWebViewCreationParams.onLongPressHitTestResult will be empty
  • the hitTestResult argument of ContextMenu.onCreateContextMenu will be empty
  • PlatformWebViewCreationParams.onLoadResource
  • PlatformWebViewCreationParams.shouldInterceptAjaxRequest
  • PlatformWebViewCreationParams.onAjaxReadyStateChange
  • PlatformWebViewCreationParams.onAjaxProgress
  • PlatformWebViewCreationParams.shouldInterceptFetchRequest
  • PlatformWebViewCreationParams.onConsoleMessage
  • PlatformWebViewCreationParams.onPrintRequest
  • PlatformWebViewCreationParams.onWindowFocus
  • PlatformWebViewCreationParams.onWindowBlur
  • PlatformWebViewCreationParams.onFindResultReceived
  • FindInteractionController.onFindResultReceived

Also, on MacOS:

  • PlatformWebViewCreationParams.onScrollChanged

Officially Supported Platforms/Implementations:

  • iOS 13.0+
  • MacOS 10.15+

applicatonNameForUserAgent;

String? applicat

Append to the existing user-agent. Setting userAgent will override this.

Officially Supported Platforms/Implementations:

automaticallyAdjustsScrollIndicatorInsets

bool? automaticallyAdjustsScrollIndicatorInsets

Configures whether the scroll indicator insets are automatically adjusted by the system. The default value is false.

Officially Supported Platforms/Implementations:

blockNetworkImage

bool? blockNetworkImage

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.

Officially Supported Platforms/Implementations:

blockNetworkLoads

bool? blockNetworkLoads

Sets whether the WebView should not load resources from the network. The default value is false.

Officially Supported Platforms/Implementations:

builtInZoomControls

bool? builtInZoomControls

Set to true if the WebView should use its built-in zoom mechanisms. The default value is true.

Officially Supported Platforms/Implementations:

cacheEnabled

bool? cacheEnabled

Sets whether WebView should use browser caching. The default value is true.

Officially Supported Platforms/Implementations:

  • Android native WebView
  • iOS
  • MacOS

CacheMode 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.

Officially Supported Platforms/Implementations:

clearCache

bool? clearCache

Set to true to have all the browser's cache cleared before the new WebView is opened. The default value is false.

Officially Supported Platforms/Implementations:

  • Android native WebView
  • iOS
  • MacOS

clerSessionCache;

bool? cle

Set to true to have the session cookie cache cleared before the new window is opened.

Officially Supported Platforms/Implementations:

  • Android native WebView

contntBlockers;

List<ContentBlocker>? cont

List of ContentBlocker that are a set of rules used to block content in the browser window.

Officially Supported Platforms/Implementations:

  • Android native WebView
  • iOS 11.0+
  • MacOS 10.13+

ScrollViewContenInsetAdjustmentBehavior? contentInsetAdjustmentBehavior;

ScrollViewConten

Configures how safe area insets are added to the adjusted content inset. The default value is ScrollViewContentInsetAdjustmentBehavior.NEVER.

Officially Supported Platforms/Implementations:

cursiveFontFamily

String? cursiveFontFamily

Sets the cursive font family name. The default value is "cursive".

Officially Supported Platforms/Implementations:

dataDetectorTypes

List<DataDetectorTypes>? 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.

Officially Supported Platforms/Implementations:

databaseEnabled

bool? databaseEnabled

Set to true if you want the database storage API is enabled. The default value is true.

Officially Supported Platforms/Implementations:

decelerationRate

ScrollViewDecelerationRate? decelerationRate

A ScrollViewDecelerationRate value that determines the rate of deceleration after the user lifts their finger. The default value is ScrollViewDecelerationRate.NORMAL.

Officially Supported Platforms/Implementations:

defaultFixedFontSize

int? defaultFixedFontSize

Sets the default fixed font size. The default value is 16.

Officially Supported Platforms/Implementations:

defaultFontSize

int? defaultFontSize

Sets the default font size. The default value is 16.

Officially Supported Platforms/Implementations:

defaultTextEncodingName

String? defaultTextEncodingName

Sets the default text encoding name to use when decoding html pages. The default value is "UTF-8".

Officially Supported Platforms/Implementations:

defaultVideoPoster

Uint8List? defaultVideoPoster

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.

Officially Supported Platforms/Implementations:

  • Android native WebView

disableContextMenu

bool? disableContextMenu

Set to true to disable context menu. The default value is false.

Officially Supported Platforms/Implementations:

  • Android native WebView
  • iOS
  • Web but iframe requires same origin

disableDefaultErrorPage

bool? disableDefaultErrorPage

Sets whether the default Android WebView’s internal error page should be suppressed or displayed for bad navigations. true means suppressed (not shown), false means it will be displayed. The default value is false.

Officially Supported Platforms/Implementations:

  • Android native WebView

disableHorizontalScrll;

bool? disableHorizontalScr

Set to true to disable horizontal scroll. The default value is false.

Officially Supported Platforms/Implementations:

  • Android native WebView
  • iOS
  • Web but iframe requires same origin

disableInputAccessoryView

bool? disableInputAccessoryView

Set to true to disable the inputAccessoryView(https://developer.apple.com/documentation/uikit/uiresponder/1621119-inputaccessoryview) above system keyboard. The default value is false.

Officially Supported Platforms/Implementations:

  • iOS

bool? d

Set to true to 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 is false.

Officially Supported Platforms/Implementations:

  • iOS

dsableVerticalScroll;

bool? d

Set to true to disable vertical scroll. The default value is false.

Officially Supported Platforms/Implementations:

  • Android native WebView
  • iOS
  • Web but iframe requires same origin

disabledActionModeMnuItems;

ActionModeMenuItem? disabledActionModeM

Disables the action mode menu items according to menuItems flag.

Officially Supported Platforms/Implementations:

disallowOverScroll

bool? disallowOverScroll

Set to true to disable the bouncing of the WebView when the scrolling has reached an edge of the content. The default value is false.

Officially Supported Platforms/Implementations:

  • iOS

dsplayZoomControls;

bool? d

Set to true if the WebView should display on-screen zoom controls when using the built-in zoom mechanisms. The default value is false.

Officially Supported Platforms/Implementations:

domStorageEnabled

bool? domStorageEnabled

Set to true if you want the DOM storage API is enabled. The default value is true.

Officially Supported Platforms/Implementations:

enableViewportScale

bool? enableViewportScale

Set to true to allow a viewport meta tag to either disable or restrict the range of user scaling. The default value is false.

Officially Supported Platforms/Implementations:

  • iOS
  • MacOS

entrpriseAuthenticationAppLinkPolicyEnabled;

bool? ent

Sets whether EnterpriseAuthenticationAppLinkPolicy if set by admin is allowed to have any effect on WebView.

EnterpriseAuthenticationAppLinkPolicy in WebView allows admins to specify authentication urls. When WebView is redirected to authentication url, and an app on the device has registered as the default handler for the url, that app is launched.

The default value is true.

NOTE for Android native WebView: available on Android only if WebViewFeature.ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY feature is supported.

Officially Supported Platforms/Implementations:

  • Android native WebView

fantasyFontFamily

String? fantasyFontFamily

Sets the fantasy font family name. The default value is "fantasy".

Officially Supported Platforms/Implementations:

fixedFontFamily

String? fixedFontFamily

Sets the fixed font family name. The default value is "monospace".

Officially Supported Platforms/Implementations:

forceDark

ForceDark? forceDark

Set the force dark mode for this WebView. The default value is ForceDark.OFF.

Officially Supported Platforms/Implementations:

forceDarkStrategy

ForceDarkStrategy? forceDarkStrategy

Sets whether Geolocation API is enabled. The default value is true. Set how WebView content should be darkened. The default value is ForceDarkStrategy.PREFER_WEB_THEME_OVER_USER_AGENT_DARKENING.

NOTE for Android native WebView: it will take effect only if WebViewFeature.isFeatureSupported returns true for WebViewFeature.FORCE_DARK_STRATEGY.

Officially Supported Platforms/Implementations:

geolocationEnabled

bool? geolocationEnabled

Sets whether Geolocation is enabled. The default is true.

NOTE for Android native WebView: Please note that in order for the Geolocation API to be usable by a page in the WebView, the following requirements must be met:

Officially Supported Platforms/Implementations:

hardwareAcceleration

bool? hardwareAcceleration

Boolean value to enable Hardware Acceleration in the WebView. The default value is true.

Officially Supported Platforms/Implementations:

horizontalScrollBarEnabled

bool? horizontalScrollBarEnabled

Define whether the horizontal scrollbar should be drawn or not. The default value is true.

NOTE for Web: It must have the same value of verticalScrollBarEnabled to take effect.

Officially Supported Platforms/Implementations:

horizontalScrollbarThumbColor

Color? horizontalScrollbarThumbColor

Sets the horizontal scrollbar thumb color.

Officially Supported Platforms/Implementations:

horizontalScrollbarTrackColor

Color? horizontalScrollbarTrackColor

Sets the horizontal scrollbar track color.

Officially Supported Platforms/Implementations:

iframeAllow

String? iframeAllow

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.).

Officially Supported Platforms/Implementations:

iframeAllowFullscreen

bool? iframeAllowFullscreen

Set to true if the <iframe> can activate fullscreen mode by calling the requestFullscreen() method.

Officially Supported Platforms/Implementations:

iframeCsp

String? iframeCsp

A Content Security Policy enforced for the embedded resource.

Officially Supported Platforms/Implementations:

iframeName

String? iframeName

A string that reflects the name HTML attribute, containing a name by which to refer to the frame.

Officially Supported Platforms/Implementations:

iframeReferrerPolicy

ReferrerPolicy? iframeReferrerPolicy

A string that reflects the referrerpolicy HTML attribute indicating which referrer to use when fetching the linked resource.

Officially Supported Platforms/Implementations:

iframeSandbox

Set<Sandbox>? iframeSandbox

Applies extra restrictions to the content in the frame.

Officially Supported Platforms/Implementations:

ignoresViewportScaleLimits

bool? ignoresViewportScaleLimits

Set to true if you want that the WebView should always allow scaling of the webpage, regardless of the author's intent. The ignoresViewportScaleLimits property overrides the user-scalable HTML property in a webpage. The default value is false.

Officially Supported Platforms/Implementations:

incognito

bool? incognito

Set to true to open a browser window with incognito mode. The default value is false.

NOTE for Android native WebView: setting this to true, it will clear all the cookies of all WebView instances, because there isn't any way to make the website data store non-persistent for the specific WebView instance such as on iOS.

Officially Supported Platforms/Implementations:

  • Android native WebView
  • iOS
  • MacOS

initalScale;

int? init

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.

Officially Supported Platforms/Implementations:

isDirectionalLockEnabled

bool? isDirectionalLockEnabled

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 is true and 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 is false.

Officially Supported Platforms/Implementations:

isElementFullscreenEnabled

bool? isElementFullscreenEnabled

Sets whether fullscreen API is enabled or not.

The default value is true.

Officially Supported Platforms/Implementations:

isFindInteractionEnabled

bool? isFindInteractionEnabled

Sets whether the web view's built-in find interaction native UI is enabled or not.

The default value is false.

Officially Supported Platforms/Implementations:

isFraudulentWebsiteWarningEnabled

bool? isFraudulentWebsiteWarningEnabled

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.

Officially Supported Platforms/Implementations:

isInspectable

bool? isInspectable

Controls whether this WebView is inspectable in Web Inspector.

The default value is false.

Officially Supported Platforms/Implementations:

isPagingEnabled

bool? isPagingEnabled

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.

Officially Supported Platforms/Implementations:

isSiteSpecificQuirksModeEnabled

bool? isSiteSpecificQuirksModeEnabled

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.

Officially Supported Platforms/Implementations:

isTextInteractionEnabled

bool? isTextInteractionEnabled

A Boolean value indicating whether text interaction is enabled or not. The default value is true.

Officially Supported Platforms/Implementations:

javaScriptCanOpenWindowsAutomatically

bool? javaScriptCanOpenWindowsAutomatically

Set to true to allow JavaScript open windows without user interaction. The default value is false.

Officially Supported Platforms/Implementations:

javaScriptEnabled

bool? javaScriptEnabled

Set to true to enable JavaScript. The default value is true.

Officially Supported Platforms/Implementations:

LayoutAgorithm? layoutAlgorithm;

LayoutA

Sets the underlying layout algorithm. This will cause a re-layout of the WebView.

Officially Supported Platforms/Implementations:

limitsNavigationsToAppBoundDomains

bool? limitsNavigationsToAppBoundDomains

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.

Officially Supported Platforms/Implementations:

loadWithOverviewMode

bool? loadWithOverviewMode

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.

Officially Supported Platforms/Implementations:

loadsImagesAutomatically

bool? loadsImagesAutomatically

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.

Officially Supported Platforms/Implementations:

maximumViewportInset

EdgeInsets? maximumViewportInset

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.

Officially Supported Platforms/Implementations:

maximumZoomScale

double? maximumZoomScale

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.

Officially Supported Platforms/Implementations:

mediaPlaybackRequiresUserGesture

bool? mediaPlaybackRequiresUserGesture

Set to true to prevent HTML5 audio or video from autoplaying. The default value is true.

Officially Supported Platforms/Implementations:

mediaType

String? mediaType

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 than null to this property, the web view uses the value you provide instead. The default value of this property is null.

Officially Supported Platforms/Implementations:

minimumFontSize

int? minimumFontSize

Sets the minimum font size. The default value is 8 for Android, 0 for iOS.

Officially Supported Platforms/Implementations:

minimumLogicalFontSize

int? minimumLogicalFontSize

Sets the minimum logical font size. The default is 8.

Officially Supported Platforms/Implementations:

minimumViewportInset

EdgeInsets? minimumViewportInset

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.

Officially Supported Platforms/Implementations:

minimumZoomScale

double? minimumZoomScale

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.

Officially Supported Platforms/Implementations:

mixedContentMode

MixedContentMode? mixedContentMode

Configures the WebView's behavior when a secure origin attempts to load a resource from an insecure origin.

Officially Supported Platforms/Implementations:

needInitialFocus

bool? needInitialFocus

Tells the WebView whether it needs to set a node. The default value is true.

Officially Supported Platforms/Implementations:

networkAvailable

bool? networkAvailable

Informs WebView of the network state. This is used to set the JavaScript property window.navigator.isOnline and generates the online/offline event as specified in HTML5, sec. 5.7.7.

Officially Supported Platforms/Implementations:

offscreenPreRaster

bool? offscreenPreRaster

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.

Officially Supported Platforms/Implementations:

overScrollMode

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.

Officially Supported Platforms/Implementations:

pageZoom

double? pageZoom

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 CSS zoom property on all page content.

Officially Supported Platforms/Implementations:

preferredContentMode

UserPreferredContentMode? preferredContentMode

Sets the content mode that the WebView needs to use when loading and rendering a webpage. The default value is UserPreferredContentMode.RECOMMENDED.

Officially Supported Platforms/Implementations:

regexToCancelSubFramesLoading

String? regexToCancelSubFramesLoading

Regular expression used by PlatformWebViewCreationParams.shouldOverrideUrlLoading event to cancel navigation requests for frames that are not the main frame. If the url request of a subframe matches the regular expression, then the request of that subframe is canceled.

Officially Supported Platforms/Implementations:

  • Android native WebView

redererPriorityPolicy;

RendererPriorityPolicy? re

Sets the renderer priority policy for this WebView.

Officially Supported Platforms/Implementations:

requestedWithHeaderOriginAllowList

Set<String>? requestedWithHeaderOriginAllowList

Set an allow-list of origins to receive the X-Requested-With HTTP header from the WebView owning the passed InAppWebViewSettings.

Historically, this header was sent on all requests from WebView, containing the app package name of the embedding app. Depending on the version of installed WebView, this may no longer be the case, as the header was deprecated in late 2022, and its use discontinued.

Apps can use this method to restore the legacy behavior for servers that still rely on the deprecated header, but it should not be used to identify the webview to first-party servers under the control of the app developer.

The format of the strings in the allow-list follows the origin rules of PlatformInAppWebViewController.addWebMessageListener.

NOTE for Android native WebView: available on Android only if WebViewFeature.REQUESTED_WITH_HEADER_ALLOW_LIST feature is supported.

Officially Supported Platforms/Implementations:

resourceCustomSchemes

List<String>? resourceCustomSchemes

List of custom schemes that the WebView must handle. Use the PlatformWebViewCreationParams.onLoadResourceWithCustomScheme event to intercept resource requests with custom scheme.

Officially Supported Platforms/Implementations:

  • Android native WebView
  • iOS 11.0+
  • MacOS 10.13+

safeBrowsigEnabled;

bool? safeBrowsi

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.

Officially Supported Platforms/Implementations:

sansSerifFontFamily

String? sansSerifFontFamily

Sets the sans-serif font family name. The default value is "sans-serif".

Officially Supported Platforms/Implementations:

saveFormData

bool? saveFormData

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.

Officially Supported Platforms/Implementations:

scrollBarDefaultDelayBeforeFade

int? scrollBarDefaultDelayBeforeFade

Defines the delay in milliseconds that a scrollbar waits before fade out.

Officially Supported Platforms/Implementations:

scrollBarFadeDuration

int? scrollBarFadeDuration

Defines the scrollbar fade duration in milliseconds.

Officially Supported Platforms/Implementations:

scrollBarStyle

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.

Officially Supported Platforms/Implementations:

scrollbarFadingEnabled

bool? scrollbarFadingEnabled

Defines whether scrollbars will fade when the view is not scrolling. The default value is true.

Officially Supported Platforms/Implementations:

scrollsToTop

bool? scrollsToTop

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.

Officially Supported Platforms/Implementations:

selectionGranularity

SelectionGranularity? selectionGranularity

The level of granularity with which the user can interactively select content in the web view. The default value is SelectionGranularity.DYNAMIC.

Officially Supported Platforms/Implementations:

serifFontFamily

String? serifFontFamily

Sets the serif font family name. The default value is "sans-serif".

Officially Supported Platforms/Implementations:

sharedCookiesEnabled

bool? sharedCookiesEnabled

Set true if shared cookies from HTTPCookieStorage.shared should used for every load request in the WebView. The default value is false.

Officially Supported Platforms/Implementations:

  • iOS 11.0+
  • MacOS 10.13+

shouldPrinBackgrounds;

bool? shouldPrin

A Boolean value that indicates whether to include any background color or graphics when printing content.

The default value is false.

Officially Supported Platforms/Implementations:

standardFontFamily

String? standardFontFamily

Sets the standard font family name. The default value is "sans-serif".

Officially Supported Platforms/Implementations:

supportMultipleWindows

bool? supportMultipleWindows

Sets whether the WebView supports multiple windows. If set to true, PlatformWebViewCreationParams.onCreateWindow event must be implemented by the host application. The default value is false.

Officially Supported Platforms/Implementations:

supportZoom

bool? supportZoom

Set to false if the WebView should not support zooming using its on-screen zoom controls and gestures. The default value is true.

Officially Supported Platforms/Implementations:

supressesIncrementalRendering;

bool? sup

Set to true if you want the WebView suppresses content rendering until it is fully loaded into memory. The default value is false.

Officially Supported Platforms/Implementations:

textZoom

int? textZoom

Sets the text zoom of the page in percent. The default value is 100.

Officially Supported Platforms/Implementations:

thirdPartyCookiesEnabled

bool? thirdPartyCookiesEnabled

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.

Officially Supported Platforms/Implementations:

transparentBackground

bool? transparentBackground

Set to true to 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 is false.

Officially Supported Platforms/Implementations:

  • Android native WebView
  • iOS
  • MacOS 12.0+

underPagBackgroundColor;

Color? underPag

The color the web view displays behind the active page, visible when the user scrolls beyond the bounds of the page.

The web view derives the default value of this property from the content of the page, using the background colors of the <html> and <body> elements with the background color of the web view. To override the default color, set this property to a new color.

Officially Supported Platforms/Implementations:

upgradeKnownHostsToHTTPS

bool? upgradeKnownHostsToHTTPS

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.

Officially Supported Platforms/Implementations:

useHybridComposition

bool? useHybridComposition

Set to false to disable Flutter Hybrid Composition. The default value is true. Hybrid Composition is supported starting with Flutter v1.20+.

NOTE for Android native WebView: It is recommended to use Hybrid Composition only on Android 10+ for a release app, as it can cause framerate drops on animations in Android 9 and lower (see Hybrid-Composition#performance).

Officially Supported Platforms/Implementations:

  • Android native WebView

useOnDownloadStart

bool? useOnDownloadStart

Set to true to be able to listen at the PlatformWebViewCreationParams.onDownloadStartRequest event.

If the PlatformWebViewCreationParams.onDownloadStartRequest event is implemented and this value is null, it will be automatically inferred as true, otherwise, the default value is false. This logic will not be applied for PlatformInAppBrowser, where you must set the value manually.

Officially Supported Platforms/Implementations:

  • Android native WebView
  • iOS
  • MacOS

usenLoadResource;

bool? use

Set to true to be able to listen at the PlatformWebViewCreationParams.onLoadResource event.

If the PlatformWebViewCreationParams.onLoadResource event is implemented and this value is null, it will be automatically inferred as true, otherwise, the default value is false. This logic will not be applied for PlatformInAppBrowser, where you must set the value manually.

Officially Supported Platforms/Implementations:

  • Android native WebView
  • iOS
  • MacOS

usenNavigationResponse;

bool? use

Set to true to be able to listen to the PlatformWebViewCreationParams.onNavigationResponse event.

If the PlatformWebViewCreationParams.onNavigationResponse event is implemented and this value is null, it will be automatically inferred as true, otherwise, the default value is false. This logic will not be applied for PlatformInAppBrowser, where you must set the value manually.

Officially Supported Platforms/Implementations:

  • iOS
  • MacOS

usenRenderProcessGone;

bool? use

Set to true to be able to listen at the PlatformWebViewCreationParams.onRenderProcessGone event.

If the PlatformWebViewCreationParams.onRenderProcessGone event is implemented and this value is null, it will be automatically inferred as true, otherwise, the default value is false. This logic will not be applied for PlatformInAppBrowser, where you must set the value manually.

Officially Supported Platforms/Implementations:

  • Android native WebView

useShouldInterceptAjxRequest;

bool? useShouldInterceptAj

Set to true to be able to listen at the PlatformWebViewCreationParams.shouldInterceptAjaxRequest event.

If the PlatformWebViewCreationParams.shouldInterceptAjaxRequest event is implemented and this value is null, it will be automatically inferred as true, otherwise, the default value is false. This logic will not be applied for PlatformInAppBrowser, where you must set the value manually.

Officially Supported Platforms/Implementations:

  • Android native WebView
  • iOS
  • MacOS

usehouldInterceptFetchRequest;

bool? use

Set to true to be able to listen at the PlatformWebViewCreationParams.shouldInterceptFetchRequest event.

If the PlatformWebViewCreationParams.shouldInterceptFetchRequest event is implemented and this value is null, it will be automatically inferred as true, otherwise, the default value is false. This logic will not be applied for PlatformInAppBrowser, where you must set the value manually.

Officially Supported Platforms/Implementations:

  • Android native WebView
  • iOS
  • MacOS

usehouldInterceptRequest;

bool? use

Set to true to be able to listen at the PlatformWebViewCreationParams.shouldInterceptRequest event.

If the PlatformWebViewCreationParams.shouldInterceptRequest event is implemented and this value is null, it will be automatically inferred as true, otherwise, the default value is false. This logic will not be applied for PlatformInAppBrowser, where you must set the value manually.

Officially Supported Platforms/Implementations:

  • Android native WebView

useShouldOverrideUrloading;

bool? useShouldOverrideUrl

Set to true to be able to listen at the PlatformWebViewCreationParams.shouldOverrideUrlLoading event.

If the PlatformWebViewCreationParams.shouldOverrideUrlLoading event is implemented and this value is null, it will be automatically inferred as true, otherwise, the default value is false. This logic will not be applied for PlatformInAppBrowser, where you must set the value manually.

Officially Supported Platforms/Implementations:

  • Android native WebView
  • iOS
  • MacOS

useideViewPort;

bool? use

Set to true if 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 is true.

Officially Supported Platforms/Implementations:

userAgent

String? userAgent

Sets the user-agent for the WebView.

Officially Supported Platforms/Implementations:

verticalScrollBarEnabled

bool? verticalScrollBarEnabled

Define whether the vertical scrollbar should be drawn or not. The default value is true.

NOTE for Web: It must have the same value of horizontalScrollBarEnabled to take effect.

Officially Supported Platforms/Implementations:

verticalScrolbarPosition;

VerticalScrollbarPosition? verticalScro

Sets the position of the vertical scroll bar. The default value is VerticalScrollbarPosition.SCROLLBAR_POSITION_DEFAULT.

Officially Supported Platforms/Implementations:

verticalScrollbarThumbColor

Color? verticalScrollbarThumbColor

Sets the vertical scrollbar thumb color.

Officially Supported Platforms/Implementations:

verticalScrollbarTrackColor

Color? verticalScrollbarTrackColor

Sets the vertical scrollbar track color.

Officially Supported Platforms/Implementations:

webViewAssetLoader

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.

Officially Supported Platforms/Implementations:

  • Android native WebView