AndroidInAppWebViewOptions class Null safety

This class represents all the Android-only WebView options available.

Implemented types

Constructors

AndroidInAppWebViewOptions({int textZoom = 100, bool clearSessionCache = false, bool builtInZoomControls = true, bool displayZoomControls = false, bool databaseEnabled = true, bool domStorageEnabled = true, bool useWideViewPort = true, bool safeBrowsingEnabled = true, AndroidMixedContentMode? mixedContentMode, bool allowContentAccess = true, bool allowFileAccess = true, String? appCachePath, bool blockNetworkImage = false, bool blockNetworkLoads = false, AndroidCacheMode? cacheMode = AndroidCacheMode.LOAD_DEFAULT, String cursiveFontFamily = "cursive", int defaultFixedFontSize = 16, int defaultFontSize = 16, String defaultTextEncodingName = "UTF-8", AndroidActionModeMenuItem? disabledActionModeMenuItems, String fantasyFontFamily = "fantasy", String fixedFontFamily = "monospace", AndroidForceDark? forceDark = AndroidForceDark.FORCE_DARK_OFF, bool geolocationEnabled = true, AndroidLayoutAlgorithm? 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", bool saveFormData = true, bool thirdPartyCookiesEnabled = true, bool hardwareAcceleration = true, int initialScale = 0, bool supportMultipleWindows = false, String? regexToCancelSubFramesLoading, bool useHybridComposition = false, bool useShouldInterceptRequest = false, bool useOnRenderProcessGone = false, AndroidOverScrollMode? overScrollMode = AndroidOverScrollMode.OVER_SCROLL_IF_CONTENT_SCROLLS, bool? networkAvailable, AndroidScrollBarStyle? scrollBarStyle = AndroidScrollBarStyle.SCROLLBARS_INSIDE_OVERLAY, AndroidVerticalScrollbarPosition? verticalScrollbarPosition = AndroidVerticalScrollbarPosition.SCROLLBAR_POSITION_DEFAULT, int? scrollBarDefaultDelayBeforeFade, bool scrollbarFadingEnabled = true, int? scrollBarFadeDuration, RendererPriorityPolicy? rendererPriorityPolicy, bool disableDefaultErrorPage = false, Color? verticalScrollbarThumbColor, Color? verticalScrollbarTrackColor, Color? horizontalScrollbarThumbColor, Color? horizontalScrollbarTrackColor})

Properties

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.
read / write
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_asset and file:///android_res. The default value is true.
read / write
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.
read / write
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.
read / write
blockNetworkLoads bool
Sets whether the WebView should not load resources from the network. The default value is false.
read / write
builtInZoomControls bool
Set to true if the WebView should use its built-in zoom mechanisms. The default value is true.
read / write
cacheMode AndroidCacheMode?
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 AndroidCacheMode.LOAD_DEFAULT.
read / write
clearSessionCache bool
Set to true to have the session cookie cache cleared before the new window is opened.
read / write
cursiveFontFamily String
Sets the cursive font family name. The default value is "cursive".
read / write
databaseEnabled bool
Set to true if you want the database storage API is enabled. The default value is true.
read / write
defaultFixedFontSize int
Sets the default fixed font size. The default value is 16.
read / write
defaultFontSize int
Sets the default font size. The default value is 16.
read / write
defaultTextEncodingName String
Sets the default text encoding name to use when decoding html pages. The default value is "UTF-8".
read / write
disabledActionModeMenuItems AndroidActionModeMenuItem?
Disables the action mode menu items according to menuItems flag. [...]
read / write
disableDefaultErrorPage bool
Sets whether the default Android error page should be disabled. The default value is false.
read / write
displayZoomControls bool
Set to true if the WebView should display on-screen zoom controls when using the built-in zoom mechanisms. The default value is false.
read / write
domStorageEnabled bool
Set to true if you want the DOM storage API is enabled. The default value is true.
read / write
fantasyFontFamily String
Sets the fantasy font family name. The default value is "fantasy".
read / write
fixedFontFamily String
Sets the fixed font family name. The default value is "monospace".
read / write
forceDark AndroidForceDark?
Set the force dark mode for this WebView. The default value is AndroidForceDark.FORCE_DARK_OFF. [...]
read / write
geolocationEnabled bool
Sets whether Geolocation API is enabled. The default value is true.
read / write
hardwareAcceleration bool
Boolean value to enable Hardware Acceleration in the WebView. The default value is true.
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
horizontalScrollbarThumbColor Color?
Sets the horizontal scrollbar thumb color. [...]
read / write
horizontalScrollbarTrackColor Color?
Sets the horizontal scrollbar track color. [...]
read / write
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.
read / write
layoutAlgorithm AndroidLayoutAlgorithm?
Sets the underlying layout algorithm. This will cause a re-layout of the WebView.
read / write
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.
read / write
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.
read / write
minimumLogicalFontSize int
Sets the minimum logical font size. The default is 8.
read / write
mixedContentMode AndroidMixedContentMode?
Configures the WebView's behavior when a secure origin attempts to load a resource from an insecure origin. [...]
read / write
needInitialFocus bool
Tells the WebView whether it needs to set a node. The default value is true.
read / write
networkAvailable bool?
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.
read / write
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. [...]
read / write
overScrollMode AndroidOverScrollMode?
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 AndroidOverScrollMode.OVER_SCROLL_IF_CONTENT_SCROLLS.
read / write
regexToCancelSubFramesLoading String?
Regular expression used by WebView.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.
read / write
rendererPriorityPolicy RendererPriorityPolicy?
Sets the renderer priority policy for this WebView.
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
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. [...]
read / write
sansSerifFontFamily String
Sets the sans-serif font family name. The default value is "sans-serif".
read / write
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.
read / write
scrollBarDefaultDelayBeforeFade int?
Defines the delay in milliseconds that a scrollbar waits before fade out.
read / write
scrollBarFadeDuration int?
Defines the scrollbar fade duration in milliseconds.
read / write
scrollbarFadingEnabled bool
Defines whether scrollbars will fade when the view is not scrolling. The default value is true.
read / write
scrollBarStyle AndroidScrollBarStyle?
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 AndroidScrollBarStyle.SCROLLBARS_INSIDE_OVERLAY.
read / write
serifFontFamily String
Sets the serif font family name. The default value is "sans-serif".
read / write
standardFontFamily String
Sets the standard font family name. The default value is "sans-serif".
read / write
supportMultipleWindows bool
Sets whether the WebView supports multiple windows. If set to true, WebView.onCreateWindow event must be implemented by the host application. The default value is false.
read / write
textZoom int
Sets the text zoom of the page in percent. The default value is 100.
read / write
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. [...]
read / write
useHybridComposition bool
Set to true to enable Flutter's new Hybrid Composition. The default value is false. Hybrid Composition is supported starting with Flutter v1.20+. [...]
read / write
useOnRenderProcessGone bool
Set to true to be able to listen at the WebView.androidOnRenderProcessGone event. The default value is false.
read / write
useShouldInterceptRequest bool
Set to true to be able to listen at the WebView.androidShouldInterceptRequest event. The default value is false.
read / write
useWideViewPort bool
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.
read / write
verticalScrollbarPosition AndroidVerticalScrollbarPosition?
Sets the position of the vertical scroll bar. The default value is AndroidVerticalScrollbarPosition.SCROLLBAR_POSITION_DEFAULT.
read / write
verticalScrollbarThumbColor Color?
Sets the vertical scrollbar thumb color. [...]
read / write
verticalScrollbarTrackColor Color?
Sets the vertical scrollbar track color. [...]
read / write

Methods

copy() AndroidInAppWebViewOptions
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) AndroidInAppWebViewOptions
override