InAppWebViewSettings constructor
InAppWebViewSettings({
- bool? useShouldOverrideUrlLoading,
- bool? useOnLoadResource,
- bool? useOnDownloadStart,
- 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? 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 = 100,
- 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",
- ForceDark? forceDark = ForceDark.OFF,
- ForceDarkStrategy? forceDarkStrategy = ForceDarkStrategy.PREFER_WEB_THEME_OVER_USER_AGENT_DARKENING,
- 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",
- bool? saveFormData = true,
- bool? thirdPartyCookiesEnabled = true,
- bool? hardwareAcceleration = true,
- int? initialScale = 0,
- bool? supportMultipleWindows = false,
- String? regexToCancelSubFramesLoading,
- 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,
- 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,
- Color? underPageBackgroundColor,
- bool? isTextInteractionEnabled = true,
- bool? isSiteSpecificQuirksModeEnabled = true,
- bool? upgradeKnownHostsToHTTPS = true,
- bool? isElementFullscreenEnabled = true,
- bool? isFindInteractionEnabled = false,
- EdgeInsets? minimumViewportInset,
- EdgeInsets? maximumViewportInset,
- bool? isInspectable = false,
- bool? shouldPrintBackgrounds = false,
- bool? allowBackgroundAudioPlaying = false,
- WebViewAssetLoader? webViewAssetLoader,
- String? iframeAllow,
- bool? iframeAllowFullscreen,
- Set<
Sandbox> ? iframeSandbox, - ReferrerPolicy? iframeReferrerPolicy,
- String? iframeName,
- String? iframeCsp,
Implementation
InAppWebViewSettings(
{this.useShouldOverrideUrlLoading,
this.useOnLoadResource,
this.useOnDownloadStart,
this.clearCache = false,
this.userAgent = "",
this.applicationNameForUserAgent = "",
this.javaScriptEnabled = true,
this.javaScriptCanOpenWindowsAutomatically = false,
this.mediaPlaybackRequiresUserGesture = true,
this.minimumFontSize,
this.verticalScrollBarEnabled = true,
this.horizontalScrollBarEnabled = true,
this.resourceCustomSchemes = const [],
this.contentBlockers = const [],
this.preferredContentMode = UserPreferredContentMode.RECOMMENDED,
this.useShouldInterceptAjaxRequest,
this.interceptOnlyAsyncAjaxRequests = true,
this.useShouldInterceptFetchRequest,
this.incognito = false,
this.cacheEnabled = true,
this.transparentBackground = false,
this.disableVerticalScroll = false,
this.disableHorizontalScroll = false,
this.disableContextMenu = false,
this.supportZoom = true,
this.allowFileAccessFromFileURLs = false,
this.allowUniversalAccessFromFileURLs = false,
this.textZoom = 100,
this.clearSessionCache = false,
this.builtInZoomControls = true,
this.displayZoomControls = false,
this.databaseEnabled = true,
this.domStorageEnabled = true,
this.useWideViewPort = true,
this.safeBrowsingEnabled = true,
this.mixedContentMode,
this.allowContentAccess = true,
this.allowFileAccess = true,
this.appCachePath,
this.blockNetworkImage = false,
this.blockNetworkLoads = false,
this.cacheMode = CacheMode.LOAD_DEFAULT,
this.cursiveFontFamily = "cursive",
this.defaultFixedFontSize = 16,
this.defaultFontSize = 16,
this.defaultTextEncodingName = "UTF-8",
this.disabledActionModeMenuItems,
this.fantasyFontFamily = "fantasy",
this.fixedFontFamily = "monospace",
this.forceDark = ForceDark.OFF,
this.forceDarkStrategy =
ForceDarkStrategy.PREFER_WEB_THEME_OVER_USER_AGENT_DARKENING,
this.geolocationEnabled = true,
this.layoutAlgorithm,
this.loadWithOverviewMode = true,
this.loadsImagesAutomatically = true,
this.minimumLogicalFontSize = 8,
this.needInitialFocus = true,
this.offscreenPreRaster = false,
this.sansSerifFontFamily = "sans-serif",
this.serifFontFamily = "sans-serif",
this.standardFontFamily = "sans-serif",
this.saveFormData = true,
this.thirdPartyCookiesEnabled = true,
this.hardwareAcceleration = true,
this.initialScale = 0,
this.supportMultipleWindows = false,
this.regexToCancelSubFramesLoading,
this.useHybridComposition = true,
this.useShouldInterceptRequest,
this.useOnRenderProcessGone,
this.overScrollMode = OverScrollMode.IF_CONTENT_SCROLLS,
this.networkAvailable,
this.scrollBarStyle = ScrollBarStyle.SCROLLBARS_INSIDE_OVERLAY,
this.verticalScrollbarPosition =
VerticalScrollbarPosition.SCROLLBAR_POSITION_DEFAULT,
this.scrollBarDefaultDelayBeforeFade,
this.scrollbarFadingEnabled = true,
this.scrollBarFadeDuration,
this.rendererPriorityPolicy,
this.disableDefaultErrorPage = false,
this.verticalScrollbarThumbColor,
this.verticalScrollbarTrackColor,
this.horizontalScrollbarThumbColor,
this.horizontalScrollbarTrackColor,
this.algorithmicDarkeningAllowed = false,
this.enterpriseAuthenticationAppLinkPolicyEnabled = true,
this.defaultVideoPoster,
this.requestedWithHeaderOriginAllowList,
this.disallowOverScroll = false,
this.enableViewportScale = false,
this.suppressesIncrementalRendering = false,
this.allowsAirPlayForMediaPlayback = true,
this.allowsBackForwardNavigationGestures = true,
this.allowsLinkPreview = true,
this.ignoresViewportScaleLimits = false,
this.allowsInlineMediaPlayback = false,
this.allowsPictureInPictureMediaPlayback = true,
this.isFraudulentWebsiteWarningEnabled = true,
this.selectionGranularity = SelectionGranularity.DYNAMIC,
this.dataDetectorTypes = const [DataDetectorTypes.NONE],
this.sharedCookiesEnabled = false,
this.automaticallyAdjustsScrollIndicatorInsets = false,
this.accessibilityIgnoresInvertColors = false,
this.decelerationRate = ScrollViewDecelerationRate.NORMAL,
this.alwaysBounceVertical = false,
this.alwaysBounceHorizontal = false,
this.scrollsToTop = true,
this.isPagingEnabled = false,
this.maximumZoomScale = 1.0,
this.minimumZoomScale = 1.0,
this.contentInsetAdjustmentBehavior =
ScrollViewContentInsetAdjustmentBehavior.NEVER,
this.isDirectionalLockEnabled = false,
this.mediaType,
this.pageZoom = 1.0,
this.limitsNavigationsToAppBoundDomains = false,
this.useOnNavigationResponse,
this.applePayAPIEnabled = false,
this.allowingReadAccessTo,
this.disableLongPressContextMenuOnLinks = false,
this.disableInputAccessoryView = false,
this.underPageBackgroundColor,
this.isTextInteractionEnabled = true,
this.isSiteSpecificQuirksModeEnabled = true,
this.upgradeKnownHostsToHTTPS = true,
this.isElementFullscreenEnabled = true,
this.isFindInteractionEnabled = false,
this.minimumViewportInset,
this.maximumViewportInset,
this.isInspectable = false,
this.shouldPrintBackgrounds = false,
this.allowBackgroundAudioPlaying = false,
this.webViewAssetLoader,
this.iframeAllow,
this.iframeAllowFullscreen,
this.iframeSandbox,
this.iframeReferrerPolicy,
this.iframeName,
this.iframeCsp}) {
if (this.minimumFontSize == null)
this.minimumFontSize = Util.isAndroid ? 8 : 0;
assert(this.resourceCustomSchemes == null ||
(this.resourceCustomSchemes != null &&
!this.resourceCustomSchemes!.contains("http") &&
!this.resourceCustomSchemes!.contains("https")));
assert(
allowingReadAccessTo == null || allowingReadAccessTo!.isScheme("file"));
assert(
(minimumViewportInset == null && maximumViewportInset == null) ||
minimumViewportInset != null &&
maximumViewportInset != null &&
minimumViewportInset!.isNonNegative &&
maximumViewportInset!.isNonNegative &&
minimumViewportInset!.vertical <=
maximumViewportInset!.vertical &&
minimumViewportInset!.horizontal <=
maximumViewportInset!.horizontal,
"minimumViewportInset cannot be larger than maximumViewportInset");
}