fromMap static method

InAppWebViewSettings? fromMap(
  1. Map<String, dynamic>? map
)

Gets a possible InAppWebViewSettings instance from a Map value.

Implementation

static InAppWebViewSettings? fromMap(Map<String, dynamic>? map) {
  if (map == null) {
    return null;
  }
  final instance = InAppWebViewSettings(
    allowingReadAccessTo: map['allowingReadAccessTo'] != null
        ? WebUri(map['allowingReadAccessTo'])
        : null,
    appCachePath: map['appCachePath'],
    defaultVideoPoster: map['defaultVideoPoster'],
    disabledActionModeMenuItems: ActionModeMenuItem.fromNativeValue(
        map['disabledActionModeMenuItems']),
    horizontalScrollbarThumbColor:
        map['horizontalScrollbarThumbColor'] != null
            ? UtilColor.fromStringRepresentation(
                map['horizontalScrollbarThumbColor'])
            : null,
    horizontalScrollbarTrackColor:
        map['horizontalScrollbarTrackColor'] != null
            ? UtilColor.fromStringRepresentation(
                map['horizontalScrollbarTrackColor'])
            : null,
    iframeAllow: map['iframeAllow'],
    iframeAllowFullscreen: map['iframeAllowFullscreen'],
    iframeCsp: map['iframeCsp'],
    iframeName: map['iframeName'],
    iframeReferrerPolicy:
        ReferrerPolicy.fromNativeValue(map['iframeReferrerPolicy']),
    iframeSandbox: map['iframeSandbox'] != null
        ? Set<Sandbox>.from(
            map['iframeSandbox'].map((e) => Sandbox.fromNativeValue(e)!))
        : null,
    layoutAlgorithm: LayoutAlgorithm.fromNativeValue(map['layoutAlgorithm']),
    maximumViewportInset: MapEdgeInsets.fromMap(
        map['maximumViewportInset']?.cast<String, dynamic>()),
    mediaType: map['mediaType'],
    minimumFontSize: map['minimumFontSize'],
    minimumViewportInset: MapEdgeInsets.fromMap(
        map['minimumViewportInset']?.cast<String, dynamic>()),
    mixedContentMode:
        MixedContentMode.fromNativeValue(map['mixedContentMode']),
    networkAvailable: map['networkAvailable'],
    regexToCancelSubFramesLoading: map['regexToCancelSubFramesLoading'],
    rendererPriorityPolicy: RendererPriorityPolicy.fromMap(
        map['rendererPriorityPolicy']?.cast<String, dynamic>()),
    requestedWithHeaderOriginAllowList:
        map['requestedWithHeaderOriginAllowList'] != null
            ? Set<String>.from(
                map['requestedWithHeaderOriginAllowList']!.cast<String>())
            : null,
    scrollBarDefaultDelayBeforeFade: map['scrollBarDefaultDelayBeforeFade'],
    scrollBarFadeDuration: map['scrollBarFadeDuration'],
    underPageBackgroundColor: map['underPageBackgroundColor'] != null
        ? UtilColor.fromStringRepresentation(map['underPageBackgroundColor'])
        : null,
    useOnDownloadStart: map['useOnDownloadStart'],
    useOnLoadResource: map['useOnLoadResource'],
    useOnNavigationResponse: map['useOnNavigationResponse'],
    useOnRenderProcessGone: map['useOnRenderProcessGone'],
    useShouldInterceptAjaxRequest: map['useShouldInterceptAjaxRequest'],
    useShouldInterceptFetchRequest: map['useShouldInterceptFetchRequest'],
    useShouldInterceptRequest: map['useShouldInterceptRequest'],
    useShouldOverrideUrlLoading: map['useShouldOverrideUrlLoading'],
    verticalScrollbarThumbColor: map['verticalScrollbarThumbColor'] != null
        ? UtilColor.fromStringRepresentation(
            map['verticalScrollbarThumbColor'])
        : null,
    verticalScrollbarTrackColor: map['verticalScrollbarTrackColor'] != null
        ? UtilColor.fromStringRepresentation(
            map['verticalScrollbarTrackColor'])
        : null,
    webViewAssetLoader: WebViewAssetLoader.fromMap(
        map['webViewAssetLoader']?.cast<String, dynamic>()),
  );
  instance.accessibilityIgnoresInvertColors =
      map['accessibilityIgnoresInvertColors'];
  instance.algorithmicDarkeningAllowed = map['algorithmicDarkeningAllowed'];
  instance.allowBackgroundAudioPlaying = map['allowBackgroundAudioPlaying'];
  instance.allowContentAccess = map['allowContentAccess'];
  instance.allowFileAccess = map['allowFileAccess'];
  instance.allowFileAccessFromFileURLs = map['allowFileAccessFromFileURLs'];
  instance.allowUniversalAccessFromFileURLs =
      map['allowUniversalAccessFromFileURLs'];
  instance.allowsAirPlayForMediaPlayback =
      map['allowsAirPlayForMediaPlayback'];
  instance.allowsBackForwardNavigationGestures =
      map['allowsBackForwardNavigationGestures'];
  instance.allowsInlineMediaPlayback = map['allowsInlineMediaPlayback'];
  instance.allowsLinkPreview = map['allowsLinkPreview'];
  instance.allowsPictureInPictureMediaPlayback =
      map['allowsPictureInPictureMediaPlayback'];
  instance.alwaysBounceHorizontal = map['alwaysBounceHorizontal'];
  instance.alwaysBounceVertical = map['alwaysBounceVertical'];
  instance.applePayAPIEnabled = map['applePayAPIEnabled'];
  instance.applicationNameForUserAgent = map['applicationNameForUserAgent'];
  instance.automaticallyAdjustsScrollIndicatorInsets =
      map['automaticallyAdjustsScrollIndicatorInsets'];
  instance.blockNetworkImage = map['blockNetworkImage'];
  instance.blockNetworkLoads = map['blockNetworkLoads'];
  instance.builtInZoomControls = map['builtInZoomControls'];
  instance.cacheEnabled = map['cacheEnabled'];
  instance.cacheMode = CacheMode.fromNativeValue(map['cacheMode']);
  instance.clearCache = map['InAppWebViewController.clearAllCache'];
  instance.clearSessionCache = map['CookieManager.removeSessionCookies'];
  instance.contentBlockers =
      _deserializeContentBlockers(map['contentBlockers']);
  instance.contentInsetAdjustmentBehavior =
      ScrollViewContentInsetAdjustmentBehavior.fromNativeValue(
          map['contentInsetAdjustmentBehavior']);
  instance.cursiveFontFamily = map['cursiveFontFamily'];
  instance.dataDetectorTypes = map['dataDetectorTypes'] != null
      ? List<DataDetectorTypes>.from(map['dataDetectorTypes']
          .map((e) => DataDetectorTypes.fromNativeValue(e)!))
      : null;
  instance.databaseEnabled = map['databaseEnabled'];
  instance.decelerationRate =
      ScrollViewDecelerationRate.fromNativeValue(map['decelerationRate']);
  instance.defaultFixedFontSize = map['defaultFixedFontSize'];
  instance.defaultFontSize = map['defaultFontSize'];
  instance.defaultTextEncodingName = map['defaultTextEncodingName'];
  instance.disableContextMenu = map['disableContextMenu'];
  instance.disableDefaultErrorPage = map['disableDefaultErrorPage'];
  instance.disableHorizontalScroll = map['disableHorizontalScroll'];
  instance.disableInputAccessoryView = map['disableInputAccessoryView'];
  instance.disableLongPressContextMenuOnLinks =
      map['disableLongPressContextMenuOnLinks'];
  instance.disableVerticalScroll = map['disableVerticalScroll'];
  instance.disallowOverScroll = map['disallowOverScroll'];
  instance.displayZoomControls = map['displayZoomControls'];
  instance.domStorageEnabled = map['domStorageEnabled'];
  instance.enableViewportScale = map['enableViewportScale'];
  instance.enterpriseAuthenticationAppLinkPolicyEnabled =
      map['enterpriseAuthenticationAppLinkPolicyEnabled'];
  instance.fantasyFontFamily = map['fantasyFontFamily'];
  instance.fixedFontFamily = map['fixedFontFamily'];
  instance.forceDark = ForceDark.fromNativeValue(map['forceDark']);
  instance.forceDarkStrategy =
      ForceDarkStrategy.fromNativeValue(map['forceDarkStrategy']);
  instance.geolocationEnabled = map['geolocationEnabled'];
  instance.hardwareAcceleration = map['hardwareAcceleration'];
  instance.horizontalScrollBarEnabled = map['horizontalScrollBarEnabled'];
  instance.ignoresViewportScaleLimits = map['ignoresViewportScaleLimits'];
  instance.incognito = map['incognito'];
  instance.initialScale = map['initialScale'];
  instance.interceptOnlyAsyncAjaxRequests =
      map['interceptOnlyAsyncAjaxRequests'];
  instance.isDirectionalLockEnabled = map['isDirectionalLockEnabled'];
  instance.isElementFullscreenEnabled = map['isElementFullscreenEnabled'];
  instance.isFindInteractionEnabled = map['isFindInteractionEnabled'];
  instance.isFraudulentWebsiteWarningEnabled =
      map['isFraudulentWebsiteWarningEnabled'];
  instance.isInspectable = map['isInspectable'];
  instance.isPagingEnabled = map['isPagingEnabled'];
  instance.isSiteSpecificQuirksModeEnabled =
      map['isSiteSpecificQuirksModeEnabled'];
  instance.isTextInteractionEnabled = map['isTextInteractionEnabled'];
  instance.javaScriptCanOpenWindowsAutomatically =
      map['javaScriptCanOpenWindowsAutomatically'];
  instance.javaScriptEnabled = map['javaScriptEnabled'];
  instance.limitsNavigationsToAppBoundDomains =
      map['limitsNavigationsToAppBoundDomains'];
  instance.loadWithOverviewMode = map['loadWithOverviewMode'];
  instance.loadsImagesAutomatically = map['loadsImagesAutomatically'];
  instance.maximumZoomScale = map['maximumZoomScale'];
  instance.mediaPlaybackRequiresUserGesture =
      map['mediaPlaybackRequiresUserGesture'];
  instance.minimumLogicalFontSize = map['minimumLogicalFontSize'];
  instance.minimumZoomScale = map['minimumZoomScale'];
  instance.needInitialFocus = map['needInitialFocus'];
  instance.offscreenPreRaster = map['offscreenPreRaster'];
  instance.overScrollMode =
      OverScrollMode.fromNativeValue(map['overScrollMode']);
  instance.pageZoom = map['pageZoom'];
  instance.preferredContentMode =
      UserPreferredContentMode.fromNativeValue(map['preferredContentMode']);
  instance.resourceCustomSchemes = map['resourceCustomSchemes'] != null
      ? List<String>.from(map['resourceCustomSchemes']!.cast<String>())
      : null;
  instance.safeBrowsingEnabled = map['safeBrowsingEnabled'];
  instance.sansSerifFontFamily = map['sansSerifFontFamily'];
  instance.saveFormData = map['saveFormData'];
  instance.scrollBarStyle =
      ScrollBarStyle.fromNativeValue(map['scrollBarStyle']);
  instance.scrollbarFadingEnabled = map['scrollbarFadingEnabled'];
  instance.scrollsToTop = map['scrollsToTop'];
  instance.selectionGranularity =
      SelectionGranularity.fromNativeValue(map['selectionGranularity']);
  instance.serifFontFamily = map['serifFontFamily'];
  instance.sharedCookiesEnabled = map['sharedCookiesEnabled'];
  instance.shouldPrintBackgrounds = map['shouldPrintBackgrounds'];
  instance.standardFontFamily = map['standardFontFamily'];
  instance.supportMultipleWindows = map['supportMultipleWindows'];
  instance.supportZoom = map['supportZoom'];
  instance.suppressesIncrementalRendering =
      map['suppressesIncrementalRendering'];
  instance.textZoom = map['textZoom'];
  instance.thirdPartyCookiesEnabled = map['thirdPartyCookiesEnabled'];
  instance.transparentBackground = map['transparentBackground'];
  instance.upgradeKnownHostsToHTTPS = map['upgradeKnownHostsToHTTPS'];
  instance.useHybridComposition = map['useHybridComposition'];
  instance.useWideViewPort = map['useWideViewPort'];
  instance.userAgent = map['userAgent'];
  instance.verticalScrollBarEnabled = map['verticalScrollBarEnabled'];
  instance.verticalScrollbarPosition =
      VerticalScrollbarPosition.fromNativeValue(
          map['verticalScrollbarPosition']);
  return instance;
}