InAppWebViewOptions class Null safety

This class represents all the cross-platform WebView options available.

Implemented types

Constructors

InAppWebViewOptions({bool useShouldOverrideUrlLoading = false, bool useOnLoadResource = false, bool useOnDownloadStart = false, 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 = false, bool useShouldInterceptFetchRequest = false, 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})

Properties

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. [...]
read / write
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. [...]
read / write
applicationNameForUserAgent String
Append to the existing user-agent. Setting userAgent will override this. [...]
read / write
cacheEnabled bool
Sets whether WebView should use browser caching. The default value is true. [...]
read / write
clearCache bool
Set to true to have all the browser's cache cleared before the new WebView is opened. The default value is false.
read / write
contentBlockers List<ContentBlocker>
List of ContentBlocker that are a set of rules used to block content in the browser window. [...]
read / write
disableContextMenu bool
Set to true to disable context menu. The default value is false.
read / write
disableHorizontalScroll bool
Set to true to disable horizontal scroll. The default value is false.
read / write
disableVerticalScroll bool
Set to true to disable vertical scroll. The default value is false.
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
horizontalScrollBarEnabled bool
Define whether the horizontal scrollbar should be drawn or not. The default value is true.
read / write
incognito bool
Set to true to open a browser window with incognito mode. The default value is false. [...]
read / write
javaScriptCanOpenWindowsAutomatically bool
Set to true to allow JavaScript open windows without user interaction. The default value is false.
read / write
javaScriptEnabled bool
Set to true to enable JavaScript. The default value is true.
read / write
mediaPlaybackRequiresUserGesture bool
Set to true to prevent HTML5 audio or video from autoplaying. The default value is true. [...]
read / write
minimumFontSize int?
Sets the minimum font size. The default value is 8 for Android, 0 for iOS.
read / write
preferredContentMode UserPreferredContentMode?
Sets the content mode that the WebView needs to use when loading and rendering a webpage. The default value is UserPreferredContentMode.RECOMMENDED. [...]
read / write
resourceCustomSchemes List<String>
List of custom schemes that the WebView must handle. Use the WebView.onLoadResourceCustomScheme event to intercept resource requests with custom scheme. [...]
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
supportZoom bool
Set to false if the WebView should not support zooming using its on-screen zoom controls and gestures. The default value is true.
read / write
transparentBackground bool
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.
read / write
useOnDownloadStart bool
Set to true to be able to listen at the WebView.onDownloadStart event. The default value is false.
read / write
useOnLoadResource bool
Set to true to be able to listen at the WebView.onLoadResource event. The default value is false.
read / write
userAgent String
Sets the user-agent for the WebView. [...]
read / write
useShouldInterceptAjaxRequest bool
Set to true to be able to listen at the WebView.shouldInterceptAjaxRequest event. The default value is false.
read / write
useShouldInterceptFetchRequest bool
Set to true to be able to listen at the WebView.shouldInterceptFetchRequest event. The default value is false.
read / write
useShouldOverrideUrlLoading bool
Set to true to be able to listen at the WebView.shouldOverrideUrlLoading event. The default value is false.
read / write
verticalScrollBarEnabled bool
Define whether the vertical scrollbar should be drawn or not. The default value is true.
read / write

Methods

copy() InAppWebViewOptions
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toJson() Map<String, dynamic>
override
toMap() Map<String, dynamic>
override
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) InAppWebViewOptions
override