InAppWebViewSettings constructor

InAppWebViewSettings({
  1. bool? useShouldOverrideUrlLoading,
  2. bool? useOnLoadResource,
  3. bool? useOnDownloadStart,
  4. bool? clearCache = false,
  5. String? userAgent = "",
  6. String? applicationNameForUserAgent = "",
  7. bool? javaScriptEnabled = true,
  8. bool? javaScriptCanOpenWindowsAutomatically = false,
  9. bool? mediaPlaybackRequiresUserGesture = true,
  10. int? minimumFontSize,
  11. bool? verticalScrollBarEnabled = true,
  12. bool? horizontalScrollBarEnabled = true,
  13. List<String>? resourceCustomSchemes = const [],
  14. List<ContentBlocker>? contentBlockers = const [],
  15. UserPreferredContentMode? preferredContentMode = UserPreferredContentMode.RECOMMENDED,
  16. bool? useShouldInterceptAjaxRequest,
  17. bool? interceptOnlyAsyncAjaxRequests = true,
  18. bool? useShouldInterceptFetchRequest,
  19. bool? incognito = false,
  20. bool? cacheEnabled = true,
  21. bool? transparentBackground = false,
  22. bool? disableVerticalScroll = false,
  23. bool? disableHorizontalScroll = false,
  24. bool? disableContextMenu = false,
  25. bool? supportZoom = true,
  26. bool? allowFileAccessFromFileURLs = false,
  27. bool? allowUniversalAccessFromFileURLs = false,
  28. int? textZoom = 100,
  29. bool? clearSessionCache = false,
  30. bool? builtInZoomControls = true,
  31. bool? displayZoomControls = false,
  32. bool? databaseEnabled = true,
  33. bool? domStorageEnabled = true,
  34. bool? useWideViewPort = true,
  35. bool? safeBrowsingEnabled = true,
  36. MixedContentMode? mixedContentMode,
  37. bool? allowContentAccess = true,
  38. bool? allowFileAccess = true,
  39. String? appCachePath,
  40. bool? blockNetworkImage = false,
  41. bool? blockNetworkLoads = false,
  42. CacheMode? cacheMode = CacheMode.LOAD_DEFAULT,
  43. String? cursiveFontFamily = "cursive",
  44. int? defaultFixedFontSize = 16,
  45. int? defaultFontSize = 16,
  46. String? defaultTextEncodingName = "UTF-8",
  47. ActionModeMenuItem? disabledActionModeMenuItems,
  48. String? fantasyFontFamily = "fantasy",
  49. String? fixedFontFamily = "monospace",
  50. ForceDark? forceDark = ForceDark.OFF,
  51. ForceDarkStrategy? forceDarkStrategy = ForceDarkStrategy.PREFER_WEB_THEME_OVER_USER_AGENT_DARKENING,
  52. bool? geolocationEnabled = true,
  53. LayoutAlgorithm? layoutAlgorithm,
  54. bool? loadWithOverviewMode = true,
  55. bool? loadsImagesAutomatically = true,
  56. int? minimumLogicalFontSize = 8,
  57. bool? needInitialFocus = true,
  58. bool? offscreenPreRaster = false,
  59. String? sansSerifFontFamily = "sans-serif",
  60. String? serifFontFamily = "sans-serif",
  61. String? standardFontFamily = "sans-serif",
  62. bool? saveFormData = true,
  63. bool? thirdPartyCookiesEnabled = true,
  64. bool? hardwareAcceleration = true,
  65. int? initialScale = 0,
  66. bool? supportMultipleWindows = false,
  67. String? regexToCancelSubFramesLoading,
  68. bool? useHybridComposition = true,
  69. bool? useShouldInterceptRequest,
  70. bool? useOnRenderProcessGone,
  71. OverScrollMode? overScrollMode = OverScrollMode.IF_CONTENT_SCROLLS,
  72. bool? networkAvailable,
  73. ScrollBarStyle? scrollBarStyle = ScrollBarStyle.SCROLLBARS_INSIDE_OVERLAY,
  74. VerticalScrollbarPosition? verticalScrollbarPosition = VerticalScrollbarPosition.SCROLLBAR_POSITION_DEFAULT,
  75. int? scrollBarDefaultDelayBeforeFade,
  76. bool? scrollbarFadingEnabled = true,
  77. int? scrollBarFadeDuration,
  78. RendererPriorityPolicy? rendererPriorityPolicy,
  79. bool? disableDefaultErrorPage = false,
  80. Color? verticalScrollbarThumbColor,
  81. Color? verticalScrollbarTrackColor,
  82. Color? horizontalScrollbarThumbColor,
  83. Color? horizontalScrollbarTrackColor,
  84. bool? algorithmicDarkeningAllowed = false,
  85. bool? enterpriseAuthenticationAppLinkPolicyEnabled = true,
  86. Uint8List? defaultVideoPoster,
  87. Set<String>? requestedWithHeaderOriginAllowList,
  88. bool? disallowOverScroll = false,
  89. bool? enableViewportScale = false,
  90. bool? suppressesIncrementalRendering = false,
  91. bool? allowsAirPlayForMediaPlayback = true,
  92. bool? allowsBackForwardNavigationGestures = true,
  93. bool? allowsLinkPreview = true,
  94. bool? ignoresViewportScaleLimits = false,
  95. bool? allowsInlineMediaPlayback = false,
  96. bool? allowsPictureInPictureMediaPlayback = true,
  97. bool? isFraudulentWebsiteWarningEnabled = true,
  98. SelectionGranularity? selectionGranularity = SelectionGranularity.DYNAMIC,
  99. List<DataDetectorTypes>? dataDetectorTypes = const [DataDetectorTypes.NONE],
  100. bool? sharedCookiesEnabled = false,
  101. bool? automaticallyAdjustsScrollIndicatorInsets = false,
  102. bool? accessibilityIgnoresInvertColors = false,
  103. ScrollViewDecelerationRate? decelerationRate = ScrollViewDecelerationRate.NORMAL,
  104. bool? alwaysBounceVertical = false,
  105. bool? alwaysBounceHorizontal = false,
  106. bool? scrollsToTop = true,
  107. bool? isPagingEnabled = false,
  108. double? maximumZoomScale = 1.0,
  109. double? minimumZoomScale = 1.0,
  110. ScrollViewContentInsetAdjustmentBehavior? contentInsetAdjustmentBehavior = ScrollViewContentInsetAdjustmentBehavior.NEVER,
  111. bool? isDirectionalLockEnabled = false,
  112. String? mediaType,
  113. double? pageZoom = 1.0,
  114. bool? limitsNavigationsToAppBoundDomains = false,
  115. bool? useOnNavigationResponse,
  116. bool? applePayAPIEnabled = false,
  117. WebUri? allowingReadAccessTo,
  118. bool? disableLongPressContextMenuOnLinks = false,
  119. bool? disableInputAccessoryView = false,
  120. Color? underPageBackgroundColor,
  121. bool? isTextInteractionEnabled = true,
  122. bool? isSiteSpecificQuirksModeEnabled = true,
  123. bool? upgradeKnownHostsToHTTPS = true,
  124. bool? isElementFullscreenEnabled = true,
  125. bool? isFindInteractionEnabled = false,
  126. EdgeInsets? minimumViewportInset,
  127. EdgeInsets? maximumViewportInset,
  128. bool? isInspectable = false,
  129. bool? shouldPrintBackgrounds = false,
  130. bool? allowBackgroundAudioPlaying = false,
  131. WebViewAssetLoader? webViewAssetLoader,
  132. String? iframeAllow,
  133. bool? iframeAllowFullscreen,
  134. Set<Sandbox>? iframeSandbox,
  135. ReferrerPolicy? iframeReferrerPolicy,
  136. String? iframeName,
  137. 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");
}