toInAppWebViewSettings method

InAppWebViewSettings toInAppWebViewSettings()

Converts this configuration to InAppWebView settings

Implementation

InAppWebViewSettings toInAppWebViewSettings() {
  return InAppWebViewSettings(
    userAgent: userAgent,
    javaScriptEnabled: javaScriptEnabled,
    cacheEnabled: cacheEnabled,
    // preferredContentMode is no longer available in the new API
    useShouldOverrideUrlLoading: true,
    mediaPlaybackRequiresUserGesture: false,
    verticalScrollBarEnabled: false,
    horizontalScrollBarEnabled: false,
    transparentBackground: true,
    supportZoom: false,
    disableHorizontalScroll: true,
    disableVerticalScroll: true,
    disableContextMenu: true,
    useHybridComposition: true,
    domStorageEnabled: domStorageEnabled,
    mixedContentMode:
        mixedContentMode
            ? MixedContentMode.MIXED_CONTENT_ALWAYS_ALLOW
            : MixedContentMode.MIXED_CONTENT_NEVER_ALLOW,
    blockNetworkImage: blockImages,
    safeBrowsingEnabled: false,
    disableDefaultErrorPage: true,
    allowsInlineMediaPlayback: true,
    allowsBackForwardNavigationGestures: false,
    allowsLinkPreview: false,
    isFraudulentWebsiteWarningEnabled: false,
    disableLongPressContextMenuOnLinks: true,
    suppressesIncrementalRendering: false,
  );
}