From 6fef6906a97126b438ac099006b5ffb653052f44 Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Wed, 20 Apr 2022 03:59:39 +0200 Subject: [PATCH] fixed settings fromMap methods --- example/ios/Flutter/Flutter.podspec | 18 -- .../ios/Flutter/flutter_export_environment.sh | 7 +- .../chrome_safari_browser_settings.dart | 65 ++-- .../in_app_browser_settings.dart | 61 ++-- .../in_app_webview_settings.dart | 285 +++++++++--------- 5 files changed, 222 insertions(+), 214 deletions(-) delete mode 100644 example/ios/Flutter/Flutter.podspec diff --git a/example/ios/Flutter/Flutter.podspec b/example/ios/Flutter/Flutter.podspec deleted file mode 100644 index 663d5b29..00000000 --- a/example/ios/Flutter/Flutter.podspec +++ /dev/null @@ -1,18 +0,0 @@ -# -# NOTE: This podspec is NOT to be published. It is only used as a local source! -# This is a generated file; do not edit or check into version control. -# - -Pod::Spec.new do |s| - s.name = 'Flutter' - s.version = '1.0.0' - s.summary = 'High-performance, high-fidelity mobile apps.' - s.homepage = 'https://flutter.io' - s.license = { :type => 'MIT' } - s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } - s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s } - s.ios.deployment_target = '9.0' - # Framework linking is handled by Flutter tooling, not CocoaPods. - # Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs. - s.vendored_frameworks = 'path/to/nothing' -end diff --git a/example/ios/Flutter/flutter_export_environment.sh b/example/ios/Flutter/flutter_export_environment.sh index 9e98dd5e..dad54015 100755 --- a/example/ios/Flutter/flutter_export_environment.sh +++ b/example/ios/Flutter/flutter_export_environment.sh @@ -3,12 +3,11 @@ export "FLUTTER_ROOT=/Users/lorenzopichilli/fvm/versions/2.10.4" export "FLUTTER_APPLICATION_PATH=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example" export "COCOAPODS_PARALLEL_CODE_SIGN=true" -export "FLUTTER_TARGET=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example/lib/main.dart" +export "FLUTTER_TARGET=lib/main.dart" export "FLUTTER_BUILD_DIR=build" export "FLUTTER_BUILD_NAME=1.0.0" export "FLUTTER_BUILD_NUMBER=1" -export "DART_DEFINES=Zmx1dHRlci5pbnNwZWN0b3Iuc3RydWN0dXJlZEVycm9ycz10cnVl,RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ==" export "DART_OBFUSCATION=false" -export "TRACK_WIDGET_CREATION=true" +export "TRACK_WIDGET_CREATION=false" export "TREE_SHAKE_ICONS=false" -export "PACKAGE_CONFIG=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example/.dart_tool/package_config.json" +export "PACKAGE_CONFIG=.packages" diff --git a/lib/src/chrome_safari_browser/chrome_safari_browser_settings.dart b/lib/src/chrome_safari_browser/chrome_safari_browser_settings.dart index c540eb3c..9ccc8cbb 100755 --- a/lib/src/chrome_safari_browser/chrome_safari_browser_settings.dart +++ b/lib/src/chrome_safari_browser/chrome_safari_browser_settings.dart @@ -1,3 +1,4 @@ +import 'dart:io'; import 'dart:ui'; import 'package:flutter/foundation.dart'; @@ -225,31 +226,47 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions { } static ChromeSafariBrowserSettings fromMap(Map map) { - ChromeSafariBrowserSettings options = new ChromeSafariBrowserSettings(); - options.shareState = map["shareState"]; - options.showTitle = map["showTitle"]; - options.toolbarBackgroundColor = - UtilColor.fromHex(map["toolbarBackgroundColor"]); - options.enableUrlBarHiding = map["enableUrlBarHiding"]; - options.instantAppsEnabled = map["instantAppsEnabled"]; - options.packageName = map["packageName"]; - options.keepAliveEnabled = map["keepAliveEnabled"]; - options.isSingleInstance = map["isSingleInstance"]; - options.noHistory = map["noHistory"]; - options.isTrustedWebActivity = map["isTrustedWebActivity"]; - options.additionalTrustedOrigins = map["additionalTrustedOrigins"]; - switch (map["displayMode"]["type"]) { - case "IMMERSIVE_MODE": - options.displayMode = - TrustedWebActivityImmersiveDisplayMode.fromMap(map["displayMode"]); - break; - case "DEFAULT_MODE": - default: - options.displayMode = TrustedWebActivityDefaultDisplayMode(); - break; + ChromeSafariBrowserSettings settings = new ChromeSafariBrowserSettings(); + if (Platform.isAndroid) { + settings.shareState = map["shareState"]; + settings.showTitle = map["showTitle"]; + settings.toolbarBackgroundColor = + UtilColor.fromHex(map["toolbarBackgroundColor"]); + settings.enableUrlBarHiding = map["enableUrlBarHiding"]; + settings.instantAppsEnabled = map["instantAppsEnabled"]; + settings.packageName = map["packageName"]; + settings.keepAliveEnabled = map["keepAliveEnabled"]; + settings.isSingleInstance = map["isSingleInstance"]; + settings.noHistory = map["noHistory"]; + settings.isTrustedWebActivity = map["isTrustedWebActivity"]; + settings.additionalTrustedOrigins = map["additionalTrustedOrigins"]; + switch (map["displayMode"]["type"]) { + case "IMMERSIVE_MODE": + settings.displayMode = + TrustedWebActivityImmersiveDisplayMode.fromMap(map["displayMode"]); + break; + case "DEFAULT_MODE": + default: + settings.displayMode = TrustedWebActivityDefaultDisplayMode(); + break; + } + settings.screenOrientation = map["screenOrientation"]; } - options.screenOrientation = map["screenOrientation"]; - return options; + if (Platform.isIOS || Platform.isMacOS) { + settings.entersReaderIfAvailable = map["entersReaderIfAvailable"]; + settings.barCollapsingEnabled = map["barCollapsingEnabled"]; + settings.dismissButtonStyle = + DismissButtonStyle.fromValue(map["dismissButtonStyle"])!; + settings.preferredBarTintColor = + UtilColor.fromHex(map["preferredBarTintColor"]); + settings.preferredControlTintColor = + UtilColor.fromHex(map["preferredControlTintColor"]); + settings.presentationStyle = + ModalPresentationStyle.fromValue(map["presentationStyle"])!; + settings.transitionStyle = + ModalTransitionStyle.fromValue(map["transitionStyle"])!; + } + return settings; } @override diff --git a/lib/src/in_app_browser/in_app_browser_settings.dart b/lib/src/in_app_browser/in_app_browser_settings.dart index 4c05512e..3009d192 100755 --- a/lib/src/in_app_browser/in_app_browser_settings.dart +++ b/lib/src/in_app_browser/in_app_browser_settings.dart @@ -1,3 +1,4 @@ +import 'dart:io'; import 'dart:ui'; import 'package:flutter/foundation.dart'; @@ -273,35 +274,39 @@ class InAppBrowserSettings } static InAppBrowserSettings fromMap(Map map) { - var instance = InAppBrowserSettings(); - instance.hidden = map["hidden"]; - instance.hideToolbarTop = map["hideToolbarTop"]; - instance.toolbarTopBackgroundColor = + var settings = InAppBrowserSettings(); + settings.hidden = map["hidden"]; + settings.hideToolbarTop = map["hideToolbarTop"]; + settings.toolbarTopBackgroundColor = UtilColor.fromHex(map["toolbarTopBackgroundColor"]); - instance.hideUrlBar = map["hideUrlBar"]; - instance.hideProgressBar = map["hideProgressBar"]; - instance.hideTitleBar = map["hideTitleBar"]; - instance.toolbarTopFixedTitle = map["toolbarTopFixedTitle"]; - instance.closeOnCannotGoBack = map["closeOnCannotGoBack"]; - instance.allowGoBackWithBackButton = map["allowGoBackWithBackButton"]; - instance.shouldCloseOnBackButtonPressed = - map["shouldCloseOnBackButtonPressed"]; - instance.toolbarTopTranslucent = map["toolbarTopTranslucent"]; - instance.toolbarTopTintColor = - UtilColor.fromHex(map["toolbarTopTintColor"]); - instance.hideToolbarBottom = map["hideToolbarBottom"]; - instance.toolbarBottomBackgroundColor = - UtilColor.fromHex(map["toolbarBottomBackgroundColor"]); - instance.toolbarBottomTintColor = - UtilColor.fromHex(map["toolbarBottomTintColor"]); - instance.toolbarBottomTranslucent = map["toolbarBottomTranslucent"]; - instance.closeButtonCaption = map["closeButtonCaption"]; - instance.closeButtonColor = UtilColor.fromHex(map["closeButtonColor"]); - instance.presentationStyle = - ModalPresentationStyle.fromValue(map["presentationStyle"])!; - instance.transitionStyle = - ModalTransitionStyle.fromValue(map["transitionStyle"])!; - return instance; + settings.hideUrlBar = map["hideUrlBar"]; + settings.hideProgressBar = map["hideProgressBar"]; + if (Platform.isAndroid) { + settings.hideTitleBar = map["hideTitleBar"]; + settings.toolbarTopFixedTitle = map["toolbarTopFixedTitle"]; + settings.closeOnCannotGoBack = map["closeOnCannotGoBack"]; + settings.allowGoBackWithBackButton = map["allowGoBackWithBackButton"]; + settings.shouldCloseOnBackButtonPressed = + map["shouldCloseOnBackButtonPressed"]; + } + if (Platform.isIOS || Platform.isMacOS) { + settings.toolbarTopTranslucent = map["toolbarTopTranslucent"]; + settings.toolbarTopTintColor = + UtilColor.fromHex(map["toolbarTopTintColor"]); + settings.hideToolbarBottom = map["hideToolbarBottom"]; + settings.toolbarBottomBackgroundColor = + UtilColor.fromHex(map["toolbarBottomBackgroundColor"]); + settings.toolbarBottomTintColor = + UtilColor.fromHex(map["toolbarBottomTintColor"]); + settings.toolbarBottomTranslucent = map["toolbarBottomTranslucent"]; + settings.closeButtonCaption = map["closeButtonCaption"]; + settings.closeButtonColor = UtilColor.fromHex(map["closeButtonColor"]); + settings.presentationStyle = + ModalPresentationStyle.fromValue(map["presentationStyle"])!; + settings.transitionStyle = + ModalTransitionStyle.fromValue(map["transitionStyle"])!; + } + return settings; } @override diff --git a/lib/src/in_app_webview/in_app_webview_settings.dart b/lib/src/in_app_webview/in_app_webview_settings.dart index 5a4c09aa..75ca27fb 100755 --- a/lib/src/in_app_webview/in_app_webview_settings.dart +++ b/lib/src/in_app_webview/in_app_webview_settings.dart @@ -1,3 +1,4 @@ +import 'dart:io'; import 'dart:ui'; import 'package:flutter/foundation.dart'; @@ -1232,153 +1233,157 @@ class InAppWebViewSettings } }); - var instance = InAppWebViewSettings(); - instance.useShouldOverrideUrlLoading = map["useShouldOverrideUrlLoading"]; - instance.useOnLoadResource = map["useOnLoadResource"]; - instance.useOnDownloadStart = map["useOnDownloadStart"]; - instance.clearCache = map["clearCache"]; - instance.userAgent = map["userAgent"]; - instance.applicationNameForUserAgent = map["applicationNameForUserAgent"]; - instance.javaScriptEnabled = map["javaScriptEnabled"]; - instance.javaScriptCanOpenWindowsAutomatically = + var settings = InAppWebViewSettings(); + settings.useShouldOverrideUrlLoading = map["useShouldOverrideUrlLoading"]; + settings.useOnLoadResource = map["useOnLoadResource"]; + settings.useOnDownloadStart = map["useOnDownloadStart"]; + settings.clearCache = map["clearCache"]; + settings.userAgent = map["userAgent"]; + settings.applicationNameForUserAgent = map["applicationNameForUserAgent"]; + settings.javaScriptEnabled = map["javaScriptEnabled"]; + settings.javaScriptCanOpenWindowsAutomatically = map["javaScriptCanOpenWindowsAutomatically"]; - instance.mediaPlaybackRequiresUserGesture = + settings.mediaPlaybackRequiresUserGesture = map["mediaPlaybackRequiresUserGesture"]; - instance.verticalScrollBarEnabled = map["verticalScrollBarEnabled"]; - instance.horizontalScrollBarEnabled = map["horizontalScrollBarEnabled"]; - instance.resourceCustomSchemes = + settings.verticalScrollBarEnabled = map["verticalScrollBarEnabled"]; + settings.horizontalScrollBarEnabled = map["horizontalScrollBarEnabled"]; + settings.resourceCustomSchemes = List.from(map["resourceCustomSchemes"] ?? []); - instance.contentBlockers = contentBlockers; - instance.preferredContentMode = + settings.contentBlockers = contentBlockers; + settings.preferredContentMode = UserPreferredContentMode.fromValue(map["preferredContentMode"]); - instance.useShouldInterceptAjaxRequest = + settings.useShouldInterceptAjaxRequest = map["useShouldInterceptAjaxRequest"]; - instance.useShouldInterceptFetchRequest = + settings.useShouldInterceptFetchRequest = map["useShouldInterceptFetchRequest"]; - instance.incognito = map["incognito"]; - instance.cacheEnabled = map["cacheEnabled"]; - instance.transparentBackground = map["transparentBackground"]; - instance.disableVerticalScroll = map["disableVerticalScroll"]; - instance.disableHorizontalScroll = map["disableHorizontalScroll"]; - instance.disableContextMenu = map["disableContextMenu"]; - instance.supportZoom = map["supportZoom"]; - instance.allowFileAccessFromFileURLs = map["allowFileAccessFromFileURLs"]; - instance.allowUniversalAccessFromFileURLs = + settings.incognito = map["incognito"]; + settings.cacheEnabled = map["cacheEnabled"]; + settings.transparentBackground = map["transparentBackground"]; + settings.disableVerticalScroll = map["disableVerticalScroll"]; + settings.disableHorizontalScroll = map["disableHorizontalScroll"]; + settings.disableContextMenu = map["disableContextMenu"]; + settings.supportZoom = map["supportZoom"]; + settings.allowFileAccessFromFileURLs = map["allowFileAccessFromFileURLs"]; + settings.allowUniversalAccessFromFileURLs = map["allowUniversalAccessFromFileURLs"]; - instance.textZoom = map["textZoom"]; - instance.clearSessionCache = map["clearSessionCache"]; - instance.builtInZoomControls = map["builtInZoomControls"]; - instance.displayZoomControls = map["displayZoomControls"]; - instance.databaseEnabled = map["databaseEnabled"]; - instance.domStorageEnabled = map["domStorageEnabled"]; - instance.useWideViewPort = map["useWideViewPort"]; - instance.safeBrowsingEnabled = map["safeBrowsingEnabled"]; - instance.mixedContentMode = - MixedContentMode.fromValue(map["mixedContentMode"]); - instance.allowContentAccess = map["allowContentAccess"]; - instance.allowFileAccess = map["allowFileAccess"]; - instance.appCachePath = map["appCachePath"]; - instance.blockNetworkImage = map["blockNetworkImage"]; - instance.blockNetworkLoads = map["blockNetworkLoads"]; - instance.cacheMode = CacheMode.fromValue(map["cacheMode"]); - instance.cursiveFontFamily = map["cursiveFontFamily"]; - instance.defaultFixedFontSize = map["defaultFixedFontSize"]; - instance.defaultFontSize = map["defaultFontSize"]; - instance.defaultTextEncodingName = map["defaultTextEncodingName"]; - instance.disabledActionModeMenuItems = - ActionModeMenuItem.fromValue(map["disabledActionModeMenuItems"]); - instance.fantasyFontFamily = map["fantasyFontFamily"]; - instance.fixedFontFamily = map["fixedFontFamily"]; - instance.forceDark = ForceDark.fromValue(map["forceDark"]); - instance.geolocationEnabled = map["geolocationEnabled"]; - instance.layoutAlgorithm = - LayoutAlgorithm.fromValue(map["layoutAlgorithm"]); - instance.loadWithOverviewMode = map["loadWithOverviewMode"]; - instance.loadsImagesAutomatically = map["loadsImagesAutomatically"]; - instance.minimumLogicalFontSize = map["minimumLogicalFontSize"]; - instance.initialScale = map["initialScale"]; - instance.needInitialFocus = map["needInitialFocus"]; - instance.offscreenPreRaster = map["offscreenPreRaster"]; - instance.sansSerifFontFamily = map["sansSerifFontFamily"]; - instance.serifFontFamily = map["serifFontFamily"]; - instance.standardFontFamily = map["standardFontFamily"]; - instance.saveFormData = map["saveFormData"]; - instance.thirdPartyCookiesEnabled = map["thirdPartyCookiesEnabled"]; - instance.hardwareAcceleration = map["hardwareAcceleration"]; - instance.supportMultipleWindows = map["supportMultipleWindows"]; - instance.regexToCancelSubFramesLoading = - map["regexToCancelSubFramesLoading"]; - instance.useHybridComposition = map["useHybridComposition"]; - instance.useShouldInterceptRequest = map["useShouldInterceptRequest"]; - instance.useOnRenderProcessGone = map["useOnRenderProcessGone"]; - instance.overScrollMode = OverScrollMode.fromValue(map["overScrollMode"]); - instance.networkAvailable = map["networkAvailable"]; - instance.scrollBarStyle = ScrollBarStyle.fromValue(map["scrollBarStyle"]); - instance.verticalScrollbarPosition = - VerticalScrollbarPosition.fromValue(map["verticalScrollbarPosition"]); - instance.scrollBarDefaultDelayBeforeFade = - map["scrollBarDefaultDelayBeforeFade"]; - instance.scrollbarFadingEnabled = map["scrollbarFadingEnabled"]; - instance.scrollBarFadeDuration = map["scrollBarFadeDuration"]; - instance.rendererPriorityPolicy = RendererPriorityPolicy.fromMap( - map["rendererPriorityPolicy"]?.cast()); - instance.disableDefaultErrorPage = map["disableDefaultErrorPage"]; - instance.verticalScrollbarThumbColor = - UtilColor.fromHex(map["verticalScrollbarThumbColor"]); - instance.verticalScrollbarTrackColor = - UtilColor.fromHex(map["verticalScrollbarTrackColor"]); - instance.horizontalScrollbarThumbColor = - UtilColor.fromHex(map["horizontalScrollbarThumbColor"]); - instance.horizontalScrollbarTrackColor = - UtilColor.fromHex(map["horizontalScrollbarTrackColor"]); - instance.disallowOverScroll = map["disallowOverScroll"]; - instance.enableViewportScale = map["enableViewportScale"]; - instance.suppressesIncrementalRendering = - map["suppressesIncrementalRendering"]; - instance.allowsAirPlayForMediaPlayback = - map["allowsAirPlayForMediaPlayback"]; - instance.allowsBackForwardNavigationGestures = - map["allowsBackForwardNavigationGestures"]; - instance.allowsLinkPreview = map["allowsLinkPreview"]; - instance.ignoresViewportScaleLimits = map["ignoresViewportScaleLimits"]; - instance.allowsInlineMediaPlayback = map["allowsInlineMediaPlayback"]; - instance.allowsPictureInPictureMediaPlayback = - map["allowsPictureInPictureMediaPlayback"]; - instance.isFraudulentWebsiteWarningEnabled = - map["isFraudulentWebsiteWarningEnabled"]; - instance.selectionGranularity = - SelectionGranularity.fromValue(map["selectionGranularity"])!; - instance.dataDetectorTypes = dataDetectorTypes; - instance.sharedCookiesEnabled = map["sharedCookiesEnabled"]; - instance.automaticallyAdjustsScrollIndicatorInsets = - map["automaticallyAdjustsScrollIndicatorInsets"]; - instance.accessibilityIgnoresInvertColors = - map["accessibilityIgnoresInvertColors"]; - instance.decelerationRate = - ScrollViewDecelerationRate.fromValue(map["decelerationRate"])!; - instance.alwaysBounceVertical = map["alwaysBounceVertical"]; - instance.alwaysBounceHorizontal = map["alwaysBounceHorizontal"]; - instance.scrollsToTop = map["scrollsToTop"]; - instance.isPagingEnabled = map["isPagingEnabled"]; - instance.maximumZoomScale = map["maximumZoomScale"]; - instance.minimumZoomScale = map["minimumZoomScale"]; - instance.contentInsetAdjustmentBehavior = - ScrollViewContentInsetAdjustmentBehavior.fromValue( - map["contentInsetAdjustmentBehavior"])!; - instance.isDirectionalLockEnabled = map["isDirectionalLockEnabled"]; - instance.mediaType = map["mediaType"]; - instance.pageZoom = map["pageZoom"]; - instance.limitsNavigationsToAppBoundDomains = - map["limitsNavigationsToAppBoundDomains"]; - instance.useOnNavigationResponse = map["useOnNavigationResponse"]; - instance.applePayAPIEnabled = map["applePayAPIEnabled"]; - instance.allowingReadAccessTo = map["allowingReadAccessTo"] != null - ? Uri.parse(map["allowingReadAccessTo"]) - : null; - instance.disableLongPressContextMenuOnLinks = - map["disableLongPressContextMenuOnLinks"]; - instance.disableInputAccessoryView = map["disableInputAccessoryView"]; - return instance; + if (Platform.isAndroid) { + settings.textZoom = map["textZoom"]; + settings.clearSessionCache = map["clearSessionCache"]; + settings.builtInZoomControls = map["builtInZoomControls"]; + settings.displayZoomControls = map["displayZoomControls"]; + settings.databaseEnabled = map["databaseEnabled"]; + settings.domStorageEnabled = map["domStorageEnabled"]; + settings.useWideViewPort = map["useWideViewPort"]; + settings.safeBrowsingEnabled = map["safeBrowsingEnabled"]; + settings.mixedContentMode = + MixedContentMode.fromValue(map["mixedContentMode"]); + settings.allowContentAccess = map["allowContentAccess"]; + settings.allowFileAccess = map["allowFileAccess"]; + settings.appCachePath = map["appCachePath"]; + settings.blockNetworkImage = map["blockNetworkImage"]; + settings.blockNetworkLoads = map["blockNetworkLoads"]; + settings.cacheMode = CacheMode.fromValue(map["cacheMode"]); + settings.cursiveFontFamily = map["cursiveFontFamily"]; + settings.defaultFixedFontSize = map["defaultFixedFontSize"]; + settings.defaultFontSize = map["defaultFontSize"]; + settings.defaultTextEncodingName = map["defaultTextEncodingName"]; + settings.disabledActionModeMenuItems = + ActionModeMenuItem.fromValue(map["disabledActionModeMenuItems"]); + settings.fantasyFontFamily = map["fantasyFontFamily"]; + settings.fixedFontFamily = map["fixedFontFamily"]; + settings.forceDark = ForceDark.fromValue(map["forceDark"]); + settings.geolocationEnabled = map["geolocationEnabled"]; + settings.layoutAlgorithm = + LayoutAlgorithm.fromValue(map["layoutAlgorithm"]); + settings.loadWithOverviewMode = map["loadWithOverviewMode"]; + settings.loadsImagesAutomatically = map["loadsImagesAutomatically"]; + settings.minimumLogicalFontSize = map["minimumLogicalFontSize"]; + settings.initialScale = map["initialScale"]; + settings.needInitialFocus = map["needInitialFocus"]; + settings.offscreenPreRaster = map["offscreenPreRaster"]; + settings.sansSerifFontFamily = map["sansSerifFontFamily"]; + settings.serifFontFamily = map["serifFontFamily"]; + settings.standardFontFamily = map["standardFontFamily"]; + settings.saveFormData = map["saveFormData"]; + settings.thirdPartyCookiesEnabled = map["thirdPartyCookiesEnabled"]; + settings.hardwareAcceleration = map["hardwareAcceleration"]; + settings.supportMultipleWindows = map["supportMultipleWindows"]; + settings.regexToCancelSubFramesLoading = + map["regexToCancelSubFramesLoading"]; + settings.useHybridComposition = map["useHybridComposition"]; + settings.useShouldInterceptRequest = map["useShouldInterceptRequest"]; + settings.useOnRenderProcessGone = map["useOnRenderProcessGone"]; + settings.overScrollMode = OverScrollMode.fromValue(map["overScrollMode"]); + settings.networkAvailable = map["networkAvailable"]; + settings.scrollBarStyle = ScrollBarStyle.fromValue(map["scrollBarStyle"]); + settings.verticalScrollbarPosition = + VerticalScrollbarPosition.fromValue(map["verticalScrollbarPosition"]); + settings.scrollBarDefaultDelayBeforeFade = + map["scrollBarDefaultDelayBeforeFade"]; + settings.scrollbarFadingEnabled = map["scrollbarFadingEnabled"]; + settings.scrollBarFadeDuration = map["scrollBarFadeDuration"]; + settings.rendererPriorityPolicy = RendererPriorityPolicy.fromMap( + map["rendererPriorityPolicy"]?.cast()); + settings.disableDefaultErrorPage = map["disableDefaultErrorPage"]; + settings.verticalScrollbarThumbColor = + UtilColor.fromHex(map["verticalScrollbarThumbColor"]); + settings.verticalScrollbarTrackColor = + UtilColor.fromHex(map["verticalScrollbarTrackColor"]); + settings.horizontalScrollbarThumbColor = + UtilColor.fromHex(map["horizontalScrollbarThumbColor"]); + settings.horizontalScrollbarTrackColor = + UtilColor.fromHex(map["horizontalScrollbarTrackColor"]); + } + if (Platform.isIOS || Platform.isMacOS) { + settings.disallowOverScroll = map["disallowOverScroll"]; + settings.enableViewportScale = map["enableViewportScale"]; + settings.suppressesIncrementalRendering = + map["suppressesIncrementalRendering"]; + settings.allowsAirPlayForMediaPlayback = + map["allowsAirPlayForMediaPlayback"]; + settings.allowsBackForwardNavigationGestures = + map["allowsBackForwardNavigationGestures"]; + settings.allowsLinkPreview = map["allowsLinkPreview"]; + settings.ignoresViewportScaleLimits = map["ignoresViewportScaleLimits"]; + settings.allowsInlineMediaPlayback = map["allowsInlineMediaPlayback"]; + settings.allowsPictureInPictureMediaPlayback = + map["allowsPictureInPictureMediaPlayback"]; + settings.isFraudulentWebsiteWarningEnabled = + map["isFraudulentWebsiteWarningEnabled"]; + settings.selectionGranularity = + SelectionGranularity.fromValue(map["selectionGranularity"])!; + settings.dataDetectorTypes = dataDetectorTypes; + settings.sharedCookiesEnabled = map["sharedCookiesEnabled"]; + settings.automaticallyAdjustsScrollIndicatorInsets = + map["automaticallyAdjustsScrollIndicatorInsets"]; + settings.accessibilityIgnoresInvertColors = + map["accessibilityIgnoresInvertColors"]; + settings.decelerationRate = + ScrollViewDecelerationRate.fromValue(map["decelerationRate"])!; + settings.alwaysBounceVertical = map["alwaysBounceVertical"]; + settings.alwaysBounceHorizontal = map["alwaysBounceHorizontal"]; + settings.scrollsToTop = map["scrollsToTop"]; + settings.isPagingEnabled = map["isPagingEnabled"]; + settings.maximumZoomScale = map["maximumZoomScale"]; + settings.minimumZoomScale = map["minimumZoomScale"]; + settings.contentInsetAdjustmentBehavior = + ScrollViewContentInsetAdjustmentBehavior.fromValue( + map["contentInsetAdjustmentBehavior"])!; + settings.isDirectionalLockEnabled = map["isDirectionalLockEnabled"]; + settings.mediaType = map["mediaType"]; + settings.pageZoom = map["pageZoom"]; + settings.limitsNavigationsToAppBoundDomains = + map["limitsNavigationsToAppBoundDomains"]; + settings.useOnNavigationResponse = map["useOnNavigationResponse"]; + settings.applePayAPIEnabled = map["applePayAPIEnabled"]; + settings.allowingReadAccessTo = map["allowingReadAccessTo"] != null + ? Uri.parse(map["allowingReadAccessTo"]) + : null; + settings.disableLongPressContextMenuOnLinks = + map["disableLongPressContextMenuOnLinks"]; + settings.disableInputAccessoryView = map["disableInputAccessoryView"]; + } + return settings; } @override