diff --git a/lib/src/android/service_worker_controller.dart b/lib/src/android/service_worker_controller.dart index 701f987f..21cad6df 100644 --- a/lib/src/android/service_worker_controller.dart +++ b/lib/src/android/service_worker_controller.dart @@ -107,7 +107,7 @@ class ServiceWorkerController { ///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#getCacheMode() static Future getCacheMode() async { Map args = {}; - return CacheMode.fromValue( + return CacheMode.fromNativeValue( await _channel.invokeMethod('getCacheMode', args)); } @@ -155,7 +155,7 @@ class ServiceWorkerController { ///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#setCacheMode(int) static Future setCacheMode(CacheMode mode) async { Map args = {}; - args.putIfAbsent("mode", () => mode.toValue()); + args.putIfAbsent("mode", () => mode.toNativeValue()); await _channel.invokeMethod('setCacheMode', args); } } @@ -293,7 +293,7 @@ class AndroidServiceWorkerController { ///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#getCacheMode() static Future getCacheMode() async { Map args = {}; - return AndroidCacheMode.fromValue( + return AndroidCacheMode.fromNativeValue( await _channel.invokeMethod('getCacheMode', args)); } @@ -341,7 +341,7 @@ class AndroidServiceWorkerController { ///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#setCacheMode(int) static Future setCacheMode(AndroidCacheMode mode) async { Map args = {}; - args.putIfAbsent("mode", () => mode.toValue()); + args.putIfAbsent("mode", () => mode.toNativeValue()); await _channel.invokeMethod('setCacheMode', args); } } diff --git a/lib/src/android/webview_feature.dart b/lib/src/android/webview_feature.dart index ea8a2e46..c41cf788 100644 --- a/lib/src/android/webview_feature.dart +++ b/lib/src/android/webview_feature.dart @@ -21,7 +21,7 @@ class WebViewFeature_ { const WebViewFeature_._internal(this._value); @ExchangeableObjectMethod(ignore: true) - String toValue() => _value; + String toNativeValue() => _value; ///This feature covers [InAppWebViewController.createWebMessageChannel]. static const CREATE_WEB_MESSAGE_CHANNEL = @@ -194,7 +194,7 @@ class WebViewFeature_ { ///**Official Android API**: https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String) static Future isFeatureSupported(WebViewFeature_ feature) async { Map args = {}; - args.putIfAbsent("feature", () => feature.toValue()); + args.putIfAbsent("feature", () => feature.toNativeValue()); return await _channel.invokeMethod('isFeatureSupported', args); } } @@ -213,7 +213,7 @@ class AndroidWebViewFeature_ { const AndroidWebViewFeature_._internal(this._value); @ExchangeableObjectMethod(ignore: true) - String toValue() => _value; + String toNativeValue() => _value; /// static const CREATE_WEB_MESSAGE_CHANNEL = @@ -393,7 +393,7 @@ class AndroidWebViewFeature_ { ///**Official Android API**: https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String) static Future isFeatureSupported(AndroidWebViewFeature_ feature) async { Map args = {}; - args.putIfAbsent("feature", () => feature.toValue()); + args.putIfAbsent("feature", () => feature.toNativeValue()); return await _channel.invokeMethod('isFeatureSupported', args); } } diff --git a/lib/src/android/webview_feature.g.dart b/lib/src/android/webview_feature.g.dart index 6ef3baa9..6562f26d 100644 --- a/lib/src/android/webview_feature.g.dart +++ b/lib/src/android/webview_feature.g.dart @@ -265,9 +265,9 @@ class WebViewFeature { ///and the WebView APK on the device. If running on a device with a lower API level, this will always return `false`. /// ///**Official Android API**: https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String) - static Future isFeatureSupported(WebViewFeature_ feature) async { + static Future isFeatureSupported(WebViewFeature feature) async { Map args = {}; - args.putIfAbsent("feature", () => feature.toValue()); + args.putIfAbsent("feature", () => feature.toNativeValue()); return await _channel.invokeMethod('isFeatureSupported', args); } @@ -555,9 +555,9 @@ class AndroidWebViewFeature { ///and the WebView APK on the device. If running on a device with a lower API level, this will always return `false`. /// ///**Official Android API**: https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String) - static Future isFeatureSupported(AndroidWebViewFeature_ feature) async { + static Future isFeatureSupported(AndroidWebViewFeature feature) async { Map args = {}; - args.putIfAbsent("feature", () => feature.toValue()); + args.putIfAbsent("feature", () => feature.toNativeValue()); return await _channel.invokeMethod('isFeatureSupported', args); } diff --git a/lib/src/chrome_safari_browser/android/chrome_custom_tabs_options.dart b/lib/src/chrome_safari_browser/android/chrome_custom_tabs_options.dart index bea02314..7b43dab9 100755 --- a/lib/src/chrome_safari_browser/android/chrome_custom_tabs_options.dart +++ b/lib/src/chrome_safari_browser/android/chrome_custom_tabs_options.dart @@ -95,7 +95,7 @@ class AndroidChromeCustomTabsOptions return { // ignore: deprecated_member_use_from_same_package "addDefaultShareMenuItem": addDefaultShareMenuItem, - "shareState": shareState.toValue(), + "shareState": shareState.toNativeValue(), "showTitle": showTitle, "toolbarBackgroundColor": toolbarBackgroundColor?.toHex(), "enableUrlBarHiding": enableUrlBarHiding, @@ -107,7 +107,7 @@ class AndroidChromeCustomTabsOptions "isTrustedWebActivity": isTrustedWebActivity, "additionalTrustedOrigins": additionalTrustedOrigins, "displayMode": displayMode?.toMap(), - "screenOrientation": screenOrientation.toValue() + "screenOrientation": screenOrientation.toNativeValue() }; } diff --git a/lib/src/chrome_safari_browser/apple/safari_options.dart b/lib/src/chrome_safari_browser/apple/safari_options.dart index 01b8a785..9559ac6d 100755 --- a/lib/src/chrome_safari_browser/apple/safari_options.dart +++ b/lib/src/chrome_safari_browser/apple/safari_options.dart @@ -53,11 +53,11 @@ class IOSSafariOptions implements ChromeSafariBrowserOptions, IosOptions { return { "entersReaderIfAvailable": entersReaderIfAvailable, "barCollapsingEnabled": barCollapsingEnabled, - "dismissButtonStyle": dismissButtonStyle.toValue(), + "dismissButtonStyle": dismissButtonStyle.toNativeValue(), "preferredBarTintColor": preferredBarTintColor?.toHex(), "preferredControlTintColor": preferredControlTintColor?.toHex(), - "presentationStyle": presentationStyle.toValue(), - "transitionStyle": transitionStyle.toValue() + "presentationStyle": presentationStyle.toNativeValue(), + "transitionStyle": transitionStyle.toNativeValue() }; } @@ -66,15 +66,15 @@ class IOSSafariOptions implements ChromeSafariBrowserOptions, IosOptions { options.entersReaderIfAvailable = map["entersReaderIfAvailable"]; options.barCollapsingEnabled = map["barCollapsingEnabled"]; options.dismissButtonStyle = - IOSSafariDismissButtonStyle.fromValue(map["dismissButtonStyle"])!; + IOSSafariDismissButtonStyle.fromNativeValue(map["dismissButtonStyle"])!; options.preferredBarTintColor = UtilColor.fromHex(map["preferredBarTintColor"]); options.preferredControlTintColor = UtilColor.fromHex(map["preferredControlTintColor"]); options.presentationStyle = - IOSUIModalPresentationStyle.fromValue(map["presentationStyle"])!; + IOSUIModalPresentationStyle.fromNativeValue(map["presentationStyle"])!; options.transitionStyle = - IOSUIModalTransitionStyle.fromValue(map["transitionStyle"])!; + IOSUIModalTransitionStyle.fromNativeValue(map["transitionStyle"])!; return options; } 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 be31ed39..4a35cdc6 100755 --- a/lib/src/chrome_safari_browser/chrome_safari_browser_settings.dart +++ b/lib/src/chrome_safari_browser/chrome_safari_browser_settings.dart @@ -201,7 +201,7 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions { @override Map toMap() { return { - "shareState": shareState.toValue(), + "shareState": shareState.toNativeValue(), "showTitle": showTitle, "toolbarBackgroundColor": toolbarBackgroundColor?.toHex(), "enableUrlBarHiding": enableUrlBarHiding, @@ -213,14 +213,14 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions { "isTrustedWebActivity": isTrustedWebActivity, "additionalTrustedOrigins": additionalTrustedOrigins, "displayMode": displayMode?.toMap(), - "screenOrientation": screenOrientation.toValue(), + "screenOrientation": screenOrientation.toNativeValue(), "entersReaderIfAvailable": entersReaderIfAvailable, "barCollapsingEnabled": barCollapsingEnabled, - "dismissButtonStyle": dismissButtonStyle.toValue(), + "dismissButtonStyle": dismissButtonStyle.toNativeValue(), "preferredBarTintColor": preferredBarTintColor?.toHex(), "preferredControlTintColor": preferredControlTintColor?.toHex(), - "presentationStyle": presentationStyle.toValue(), - "transitionStyle": transitionStyle.toValue() + "presentationStyle": presentationStyle.toNativeValue(), + "transitionStyle": transitionStyle.toNativeValue() }; } @@ -256,15 +256,15 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions { settings.entersReaderIfAvailable = map["entersReaderIfAvailable"]; settings.barCollapsingEnabled = map["barCollapsingEnabled"]; settings.dismissButtonStyle = - DismissButtonStyle.fromValue(map["dismissButtonStyle"])!; + DismissButtonStyle.fromNativeValue(map["dismissButtonStyle"])!; settings.preferredBarTintColor = UtilColor.fromHex(map["preferredBarTintColor"]); settings.preferredControlTintColor = UtilColor.fromHex(map["preferredControlTintColor"]); settings.presentationStyle = - ModalPresentationStyle.fromValue(map["presentationStyle"])!; + ModalPresentationStyle.fromNativeValue(map["presentationStyle"])!; settings.transitionStyle = - ModalTransitionStyle.fromValue(map["transitionStyle"])!; + ModalTransitionStyle.fromNativeValue(map["transitionStyle"])!; } return settings; } diff --git a/lib/src/content_blocker.dart b/lib/src/content_blocker.dart index 4f18e5f6..cdc5c5ba 100755 --- a/lib/src/content_blocker.dart +++ b/lib/src/content_blocker.dart @@ -88,11 +88,11 @@ class ContentBlockerTrigger { Map toMap() { List resourceTypeStringList = []; resourceType.forEach((type) { - resourceTypeStringList.add(type.toValue()); + resourceTypeStringList.add(type.toNativeValue()); }); List loadTypeStringList = []; loadType.forEach((type) { - loadTypeStringList.add(type.toValue()); + loadTypeStringList.add(type.toNativeValue()); }); Map map = { @@ -123,7 +123,7 @@ class ContentBlockerTrigger { List resourceTypeStringList = List.from(map["resource-type"] ?? []); resourceTypeStringList.forEach((typeValue) { - var type = ContentBlockerTriggerResourceType.fromValue(typeValue); + var type = ContentBlockerTriggerResourceType.fromNativeValue(typeValue); if (type != null) { resourceType.add(type); } @@ -131,7 +131,7 @@ class ContentBlockerTrigger { List loadTypeStringList = List.from(map["load-type"] ?? []); loadTypeStringList.forEach((typeValue) { - var type = ContentBlockerTriggerLoadType.fromValue(typeValue); + var type = ContentBlockerTriggerLoadType.fromNativeValue(typeValue); if (type != null) { loadType.add(type); } @@ -172,7 +172,7 @@ class ContentBlockerAction { } Map toMap() { - Map map = {"type": type.toValue(), "selector": selector}; + Map map = {"type": type.toNativeValue(), "selector": selector}; map.keys .where((key) => @@ -186,7 +186,7 @@ class ContentBlockerAction { static ContentBlockerAction fromMap(Map map) { return ContentBlockerAction( - type: ContentBlockerActionType.fromValue(map["type"])!, + type: ContentBlockerActionType.fromNativeValue(map["type"])!, selector: map["selector"]); } } diff --git a/lib/src/cookie_manager.dart b/lib/src/cookie_manager.dart index a5cd20c3..9faf1784 100755 --- a/lib/src/cookie_manager.dart +++ b/lib/src/cookie_manager.dart @@ -128,7 +128,7 @@ class CookieManager { args.putIfAbsent('maxAge', () => maxAge); args.putIfAbsent('isSecure', () => isSecure); args.putIfAbsent('isHttpOnly', () => isHttpOnly); - args.putIfAbsent('sameSite', () => sameSite?.toValue()); + args.putIfAbsent('sameSite', () => sameSite?.toNativeValue()); await _channel.invokeMethod('setCookie', args); } @@ -154,7 +154,7 @@ class CookieManager { if (isSecure != null && isSecure) cookieValue += "; Secure"; - if (sameSite != null) cookieValue += "; SameSite=" + sameSite.toValue(); + if (sameSite != null) cookieValue += "; SameSite=" + sameSite.toNativeValue(); cookieValue += ";"; @@ -236,7 +236,7 @@ class CookieManager { expiresDate: cookieMap["expiresDate"], isSessionOnly: cookieMap["isSessionOnly"], domain: cookieMap["domain"], - sameSite: HTTPCookieSameSitePolicy.fromValue(cookieMap["sameSite"]), + sameSite: HTTPCookieSameSitePolicy.fromNativeValue(cookieMap["sameSite"]), isSecure: cookieMap["isSecure"], isHttpOnly: cookieMap["isHttpOnly"], path: cookieMap["path"])); @@ -358,7 +358,7 @@ class CookieManager { isSessionOnly: cookies[i]["isSessionOnly"], domain: cookies[i]["domain"], sameSite: - HTTPCookieSameSitePolicy.fromValue(cookies[i]["sameSite"]), + HTTPCookieSameSitePolicy.fromNativeValue(cookies[i]["sameSite"]), isSecure: cookies[i]["isSecure"], isHttpOnly: cookies[i]["isHttpOnly"], path: cookies[i]["path"]); @@ -526,7 +526,7 @@ class CookieManager { expiresDate: cookieMap["expiresDate"], isSessionOnly: cookieMap["isSessionOnly"], domain: cookieMap["domain"], - sameSite: HTTPCookieSameSitePolicy.fromValue(cookieMap["sameSite"]), + sameSite: HTTPCookieSameSitePolicy.fromNativeValue(cookieMap["sameSite"]), isSecure: cookieMap["isSecure"], isHttpOnly: cookieMap["isHttpOnly"], path: cookieMap["path"])); @@ -588,7 +588,7 @@ class IOSCookieManager { expiresDate: cookieMap["expiresDate"], isSessionOnly: cookieMap["isSessionOnly"], domain: cookieMap["domain"], - sameSite: HTTPCookieSameSitePolicy.fromValue(cookieMap["sameSite"]), + sameSite: HTTPCookieSameSitePolicy.fromNativeValue(cookieMap["sameSite"]), isSecure: cookieMap["isSecure"], isHttpOnly: cookieMap["isHttpOnly"], path: cookieMap["path"])); diff --git a/lib/src/in_app_browser/apple/in_app_browser_options.dart b/lib/src/in_app_browser/apple/in_app_browser_options.dart index 87f5a9d7..e34c1127 100755 --- a/lib/src/in_app_browser/apple/in_app_browser_options.dart +++ b/lib/src/in_app_browser/apple/in_app_browser_options.dart @@ -68,8 +68,8 @@ class IOSInAppBrowserOptions implements BrowserOptions, IosOptions { "toolbarBottomTranslucent": toolbarBottomTranslucent, "closeButtonCaption": closeButtonCaption, "closeButtonColor": closeButtonColor?.toHex(), - "presentationStyle": presentationStyle.toValue(), - "transitionStyle": transitionStyle.toValue(), + "presentationStyle": presentationStyle.toNativeValue(), + "transitionStyle": transitionStyle.toNativeValue(), }; } @@ -87,9 +87,9 @@ class IOSInAppBrowserOptions implements BrowserOptions, IosOptions { instance.closeButtonCaption = map["closeButtonCaption"]; instance.closeButtonColor = UtilColor.fromHex(map["closeButtonColor"]); instance.presentationStyle = - IOSUIModalPresentationStyle.fromValue(map["presentationStyle"])!; + IOSUIModalPresentationStyle.fromNativeValue(map["presentationStyle"])!; instance.transitionStyle = - IOSUIModalTransitionStyle.fromValue(map["transitionStyle"])!; + IOSUIModalTransitionStyle.fromNativeValue(map["transitionStyle"])!; return instance; } diff --git a/lib/src/in_app_browser/in_app_browser.dart b/lib/src/in_app_browser/in_app_browser.dart index 3f1f8371..b0cb5b57 100755 --- a/lib/src/in_app_browser/in_app_browser.dart +++ b/lib/src/in_app_browser/in_app_browser.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'dart:collection'; import 'dart:typed_data'; +import 'dart:developer' as developer; import 'package:flutter/services.dart'; @@ -14,6 +15,7 @@ import '../in_app_webview/in_app_webview_settings.dart'; import '../util.dart'; import '../print_job/main.dart'; import 'in_app_browser_settings.dart'; +import '../debug_logging_settings.dart'; class InAppBrowserAlreadyOpenedException implements Exception { final dynamic message; @@ -46,6 +48,9 @@ class InAppBrowserNotOpenedException implements Exception { ///- Android native WebView ///- iOS class InAppBrowser { + ///Debug settings. + static DebugLoggingSettings debugLoggingSettings = DebugLoggingSettings(); + ///View ID used internally. late final String id; @@ -86,14 +91,37 @@ class InAppBrowser { this._channel, this, this.initialUserScripts); } + _debugLog(String method, dynamic args) { + if (InAppBrowser.debugLoggingSettings.enabled) { + for (var regExp + in InAppBrowser.debugLoggingSettings.excludeFilter) { + if (regExp.hasMatch(method)) return; + } + var maxLogMessageLength = + InAppBrowser.debugLoggingSettings.maxLogMessageLength; + String message = "InAppBrowser ID " + + id + + " calling \"" + + method.toString() + + "\" using " + + args.toString(); + if (maxLogMessageLength >= 0 && message.length > maxLogMessageLength) { + message = message.substring(0, maxLogMessageLength) + "..."; + } + developer.log(message, name: this.runtimeType.toString()); + } + } + Future _handleMethod(MethodCall call) async { switch (call.method) { case "onBrowserCreated": + _debugLog(call.method, call.arguments); this._isOpened = true; this.pullToRefreshController?.initMethodChannel(id); onBrowserCreated(); break; case "onExit": + _debugLog(call.method, call.arguments); this._isOpened = false; onExit(); break; @@ -133,7 +161,7 @@ class InAppBrowser { args.putIfAbsent('settings', () => initialSettings); args.putIfAbsent('contextMenu', () => contextMenu?.toMap() ?? {}); args.putIfAbsent('windowId', () => windowId); - args.putIfAbsent('implementation', () => implementation.toValue()); + args.putIfAbsent('implementation', () => implementation.toNativeValue()); args.putIfAbsent('initialUserScripts', () => initialUserScripts?.map((e) => e.toMap()).toList() ?? []); args.putIfAbsent('pullToRefreshSettings', () => pullToRefreshSettings); @@ -201,7 +229,7 @@ class InAppBrowser { args.putIfAbsent('settings', () => initialSettings); args.putIfAbsent('contextMenu', () => contextMenu?.toMap() ?? {}); args.putIfAbsent('windowId', () => windowId); - args.putIfAbsent('implementation', () => implementation.toValue()); + args.putIfAbsent('implementation', () => implementation.toNativeValue()); args.putIfAbsent('initialUserScripts', () => initialUserScripts?.map((e) => e.toMap()).toList() ?? []); args.putIfAbsent('pullToRefreshSettings', () => pullToRefreshSettings); @@ -252,7 +280,7 @@ class InAppBrowser { () => (historyUrl ?? androidHistoryUrl)?.toString() ?? "about:blank"); args.putIfAbsent('contextMenu', () => contextMenu?.toMap() ?? {}); args.putIfAbsent('windowId', () => windowId); - args.putIfAbsent('implementation', () => implementation.toValue()); + args.putIfAbsent('implementation', () => implementation.toNativeValue()); args.putIfAbsent('initialUserScripts', () => initialUserScripts?.map((e) => e.toMap()).toList() ?? []); args.putIfAbsent('pullToRefreshSettings', () => pullToRefreshSettings); 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 642bc316..cd4e66d4 100755 --- a/lib/src/in_app_browser/in_app_browser_settings.dart +++ b/lib/src/in_app_browser/in_app_browser_settings.dart @@ -261,8 +261,8 @@ class InAppBrowserSettings "toolbarBottomTranslucent": toolbarBottomTranslucent, "closeButtonCaption": closeButtonCaption, "closeButtonColor": closeButtonColor?.toHex(), - "presentationStyle": presentationStyle.toValue(), - "transitionStyle": transitionStyle.toValue(), + "presentationStyle": presentationStyle.toNativeValue(), + "transitionStyle": transitionStyle.toNativeValue(), }; } @@ -296,9 +296,9 @@ class InAppBrowserSettings settings.closeButtonCaption = map["closeButtonCaption"]; settings.closeButtonColor = UtilColor.fromHex(map["closeButtonColor"]); settings.presentationStyle = - ModalPresentationStyle.fromValue(map["presentationStyle"])!; + ModalPresentationStyle.fromNativeValue(map["presentationStyle"])!; settings.transitionStyle = - ModalTransitionStyle.fromValue(map["transitionStyle"])!; + ModalTransitionStyle.fromNativeValue(map["transitionStyle"])!; } return settings; } diff --git a/lib/src/in_app_webview/android/in_app_webview_options.dart b/lib/src/in_app_webview/android/in_app_webview_options.dart index 50df22b8..6a09c084 100755 --- a/lib/src/in_app_webview/android/in_app_webview_options.dart +++ b/lib/src/in_app_webview/android/in_app_webview_options.dart @@ -307,23 +307,23 @@ class AndroidInAppWebViewOptions "domStorageEnabled": domStorageEnabled, "useWideViewPort": useWideViewPort, "safeBrowsingEnabled": safeBrowsingEnabled, - "mixedContentMode": mixedContentMode?.toValue(), + "mixedContentMode": mixedContentMode?.toNativeValue(), "allowContentAccess": allowContentAccess, "allowFileAccess": allowFileAccess, "appCachePath": appCachePath, "blockNetworkImage": blockNetworkImage, "blockNetworkLoads": blockNetworkLoads, - "cacheMode": cacheMode?.toValue(), + "cacheMode": cacheMode?.toNativeValue(), "cursiveFontFamily": cursiveFontFamily, "defaultFixedFontSize": defaultFixedFontSize, "defaultFontSize": defaultFontSize, "defaultTextEncodingName": defaultTextEncodingName, - "disabledActionModeMenuItems": disabledActionModeMenuItems?.toValue(), + "disabledActionModeMenuItems": disabledActionModeMenuItems?.toNativeValue(), "fantasyFontFamily": fantasyFontFamily, "fixedFontFamily": fixedFontFamily, - "forceDark": forceDark?.toValue(), + "forceDark": forceDark?.toNativeValue(), "geolocationEnabled": geolocationEnabled, - "layoutAlgorithm": layoutAlgorithm?.toValue(), + "layoutAlgorithm": layoutAlgorithm?.toNativeValue(), "loadWithOverviewMode": loadWithOverviewMode, "loadsImagesAutomatically": loadsImagesAutomatically, "minimumLogicalFontSize": minimumLogicalFontSize, @@ -341,10 +341,10 @@ class AndroidInAppWebViewOptions "regexToCancelSubFramesLoading": regexToCancelSubFramesLoading, "useShouldInterceptRequest": useShouldInterceptRequest, "useOnRenderProcessGone": useOnRenderProcessGone, - "overScrollMode": overScrollMode?.toValue(), + "overScrollMode": overScrollMode?.toNativeValue(), "networkAvailable": networkAvailable, - "scrollBarStyle": scrollBarStyle?.toValue(), - "verticalScrollbarPosition": verticalScrollbarPosition?.toValue(), + "scrollBarStyle": scrollBarStyle?.toNativeValue(), + "verticalScrollbarPosition": verticalScrollbarPosition?.toNativeValue(), "scrollBarDefaultDelayBeforeFade": scrollBarDefaultDelayBeforeFade, "scrollbarFadingEnabled": scrollbarFadingEnabled, "scrollBarFadeDuration": scrollBarFadeDuration, @@ -368,25 +368,25 @@ class AndroidInAppWebViewOptions instance.useWideViewPort = map["useWideViewPort"]; instance.safeBrowsingEnabled = map["safeBrowsingEnabled"]; instance.mixedContentMode = - AndroidMixedContentMode.fromValue(map["mixedContentMode"]); + AndroidMixedContentMode.fromNativeValue(map["mixedContentMode"]); instance.allowContentAccess = map["allowContentAccess"]; instance.allowFileAccess = map["allowFileAccess"]; instance.appCachePath = map["appCachePath"]; instance.blockNetworkImage = map["blockNetworkImage"]; instance.blockNetworkLoads = map["blockNetworkLoads"]; - instance.cacheMode = AndroidCacheMode.fromValue(map["cacheMode"]); + instance.cacheMode = AndroidCacheMode.fromNativeValue(map["cacheMode"]); instance.cursiveFontFamily = map["cursiveFontFamily"]; instance.defaultFixedFontSize = map["defaultFixedFontSize"]; instance.defaultFontSize = map["defaultFontSize"]; instance.defaultTextEncodingName = map["defaultTextEncodingName"]; instance.disabledActionModeMenuItems = - AndroidActionModeMenuItem.fromValue(map["disabledActionModeMenuItems"]); + AndroidActionModeMenuItem.fromNativeValue(map["disabledActionModeMenuItems"]); instance.fantasyFontFamily = map["fantasyFontFamily"]; instance.fixedFontFamily = map["fixedFontFamily"]; - instance.forceDark = AndroidForceDark.fromValue(map["forceDark"]); + instance.forceDark = AndroidForceDark.fromNativeValue(map["forceDark"]); instance.geolocationEnabled = map["geolocationEnabled"]; instance.layoutAlgorithm = - AndroidLayoutAlgorithm.fromValue(map["layoutAlgorithm"]); + AndroidLayoutAlgorithm.fromNativeValue(map["layoutAlgorithm"]); instance.loadWithOverviewMode = map["loadWithOverviewMode"]; instance.loadsImagesAutomatically = map["loadsImagesAutomatically"]; instance.minimumLogicalFontSize = map["minimumLogicalFontSize"]; @@ -406,12 +406,12 @@ class AndroidInAppWebViewOptions instance.useShouldInterceptRequest = map["useShouldInterceptRequest"]; instance.useOnRenderProcessGone = map["useOnRenderProcessGone"]; instance.overScrollMode = - AndroidOverScrollMode.fromValue(map["overScrollMode"]); + AndroidOverScrollMode.fromNativeValue(map["overScrollMode"]); instance.networkAvailable = map["networkAvailable"]; instance.scrollBarStyle = - AndroidScrollBarStyle.fromValue(map["scrollBarStyle"]); + AndroidScrollBarStyle.fromNativeValue(map["scrollBarStyle"]); instance.verticalScrollbarPosition = - AndroidVerticalScrollbarPosition.fromValue( + AndroidVerticalScrollbarPosition.fromNativeValue( map["verticalScrollbarPosition"]); instance.scrollBarDefaultDelayBeforeFade = map["scrollBarDefaultDelayBeforeFade"]; diff --git a/lib/src/in_app_webview/apple/in_app_webview_options.dart b/lib/src/in_app_webview/apple/in_app_webview_options.dart index 2b98252b..5f334b00 100755 --- a/lib/src/in_app_webview/apple/in_app_webview_options.dart +++ b/lib/src/in_app_webview/apple/in_app_webview_options.dart @@ -270,7 +270,7 @@ class IOSInAppWebViewOptions Map toMap() { List dataDetectorTypesList = []; dataDetectorTypes.forEach((dataDetectorType) { - dataDetectorTypesList.add(dataDetectorType.toValue()); + dataDetectorTypesList.add(dataDetectorType.toNativeValue()); }); return { @@ -286,13 +286,13 @@ class IOSInAppWebViewOptions "allowsPictureInPictureMediaPlayback": allowsPictureInPictureMediaPlayback, "isFraudulentWebsiteWarningEnabled": isFraudulentWebsiteWarningEnabled, - "selectionGranularity": selectionGranularity.toValue(), + "selectionGranularity": selectionGranularity.toNativeValue(), "dataDetectorTypes": dataDetectorTypesList, "sharedCookiesEnabled": sharedCookiesEnabled, "automaticallyAdjustsScrollIndicatorInsets": automaticallyAdjustsScrollIndicatorInsets, "accessibilityIgnoresInvertColors": accessibilityIgnoresInvertColors, - "decelerationRate": decelerationRate.toValue(), + "decelerationRate": decelerationRate.toNativeValue(), "alwaysBounceVertical": alwaysBounceVertical, "alwaysBounceHorizontal": alwaysBounceHorizontal, "scrollsToTop": scrollsToTop, @@ -300,7 +300,7 @@ class IOSInAppWebViewOptions "maximumZoomScale": maximumZoomScale, "minimumZoomScale": minimumZoomScale, "contentInsetAdjustmentBehavior": - contentInsetAdjustmentBehavior.toValue(), + contentInsetAdjustmentBehavior.toNativeValue(), "isDirectionalLockEnabled": isDirectionalLockEnabled, "mediaType": mediaType, "pageZoom": pageZoom, @@ -319,7 +319,7 @@ class IOSInAppWebViewOptions List.from(map["dataDetectorTypes"] ?? []); dataDetectorTypesList.forEach((dataDetectorTypeValue) { var dataDetectorType = - IOSWKDataDetectorTypes.fromValue(dataDetectorTypeValue); + IOSWKDataDetectorTypes.fromNativeValue(dataDetectorTypeValue); if (dataDetectorType != null) { dataDetectorTypes.add(dataDetectorType); } @@ -342,7 +342,7 @@ class IOSInAppWebViewOptions instance.isFraudulentWebsiteWarningEnabled = map["isFraudulentWebsiteWarningEnabled"]; instance.selectionGranularity = - IOSWKSelectionGranularity.fromValue(map["selectionGranularity"])!; + IOSWKSelectionGranularity.fromNativeValue(map["selectionGranularity"])!; instance.dataDetectorTypes = dataDetectorTypes; instance.sharedCookiesEnabled = map["sharedCookiesEnabled"]; instance.automaticallyAdjustsScrollIndicatorInsets = @@ -350,7 +350,7 @@ class IOSInAppWebViewOptions instance.accessibilityIgnoresInvertColors = map["accessibilityIgnoresInvertColors"]; instance.decelerationRate = - IOSUIScrollViewDecelerationRate.fromValue(map["decelerationRate"])!; + IOSUIScrollViewDecelerationRate.fromNativeValue(map["decelerationRate"])!; instance.alwaysBounceVertical = map["alwaysBounceVertical"]; instance.alwaysBounceHorizontal = map["alwaysBounceHorizontal"]; instance.scrollsToTop = map["scrollsToTop"]; @@ -358,7 +358,7 @@ class IOSInAppWebViewOptions instance.maximumZoomScale = map["maximumZoomScale"]; instance.minimumZoomScale = map["minimumZoomScale"]; instance.contentInsetAdjustmentBehavior = - IOSUIScrollViewContentInsetAdjustmentBehavior.fromValue( + IOSUIScrollViewContentInsetAdjustmentBehavior.fromNativeValue( map["contentInsetAdjustmentBehavior"])!; instance.isDirectionalLockEnabled = map["isDirectionalLockEnabled"]; instance.mediaType = map["mediaType"]; diff --git a/lib/src/in_app_webview/headless_in_app_webview.dart b/lib/src/in_app_webview/headless_in_app_webview.dart index 53bfea68..ca42523b 100644 --- a/lib/src/in_app_webview/headless_in_app_webview.dart +++ b/lib/src/in_app_webview/headless_in_app_webview.dart @@ -212,7 +212,7 @@ class HeadlessInAppWebView implements WebView, Disposable { 'initialSettings': initialSettings, 'contextMenu': this.contextMenu?.toMap() ?? {}, 'windowId': this.windowId, - 'implementation': this.implementation.toValue(), + 'implementation': this.implementation.toNativeValue(), 'initialUserScripts': this.initialUserScripts?.map((e) => e.toMap()).toList() ?? [], 'pullToRefreshSettings': pullToRefreshSettings, diff --git a/lib/src/in_app_webview/in_app_webview.dart b/lib/src/in_app_webview/in_app_webview.dart index 971f8bbe..b304b29a 100755 --- a/lib/src/in_app_webview/in_app_webview.dart +++ b/lib/src/in_app_webview/in_app_webview.dart @@ -646,7 +646,7 @@ class _InAppWebViewState extends State { 'initialSettings': initialSettings, 'contextMenu': widget.contextMenu?.toMap() ?? {}, 'windowId': widget.windowId, - 'implementation': widget.implementation.toValue(), + 'implementation': widget.implementation.toNativeValue(), 'initialUserScripts': widget.initialUserScripts?.map((e) => e.toMap()).toList() ?? [], @@ -673,7 +673,7 @@ class _InAppWebViewState extends State { 'initialSettings': initialSettings, 'contextMenu': widget.contextMenu?.toMap() ?? {}, 'windowId': widget.windowId, - 'implementation': widget.implementation.toValue(), + 'implementation': widget.implementation.toNativeValue(), 'initialUserScripts': widget.initialUserScripts?.map((e) => e.toMap()).toList() ?? [], 'pullToRefreshSettings': pullToRefreshSettings @@ -693,7 +693,7 @@ class _InAppWebViewState extends State { 'initialSettings': initialSettings, 'contextMenu': widget.contextMenu?.toMap() ?? {}, 'windowId': widget.windowId, - 'implementation': widget.implementation.toValue(), + 'implementation': widget.implementation.toNativeValue(), 'initialUserScripts': widget.initialUserScripts?.map((e) => e.toMap()).toList() ?? [], 'pullToRefreshSettings': pullToRefreshSettings diff --git a/lib/src/in_app_webview/in_app_webview_controller.dart b/lib/src/in_app_webview/in_app_webview_controller.dart index c48dd30f..3f3d0d6b 100644 --- a/lib/src/in_app_webview/in_app_webview_controller.dart +++ b/lib/src/in_app_webview/in_app_webview_controller.dart @@ -692,7 +692,7 @@ class InAppWebViewController { _inAppBrowser != null) { String url = call.arguments["url"]; SafeBrowsingThreat? threatType = - SafeBrowsingThreat.fromValue(call.arguments["threatType"]); + SafeBrowsingThreat.fromNativeValue(call.arguments["threatType"]); Uri uri = Uri.parse(url); if (_webview != null) { @@ -1139,9 +1139,9 @@ class InAppWebViewController { _webview!.onCameraCaptureStateChanged != null) || _inAppBrowser != null) { var oldState = - MediaCaptureState.fromValue(call.arguments["oldState"]); + MediaCaptureState.fromNativeValue(call.arguments["oldState"]); var newState = - MediaCaptureState.fromValue(call.arguments["newState"]); + MediaCaptureState.fromNativeValue(call.arguments["newState"]); if (_webview != null && _webview!.onCameraCaptureStateChanged != null) _webview!.onCameraCaptureStateChanged!(this, oldState, newState); @@ -1154,9 +1154,9 @@ class InAppWebViewController { _webview!.onMicrophoneCaptureStateChanged != null) || _inAppBrowser != null) { var oldState = - MediaCaptureState.fromValue(call.arguments["oldState"]); + MediaCaptureState.fromNativeValue(call.arguments["oldState"]); var newState = - MediaCaptureState.fromValue(call.arguments["newState"]); + MediaCaptureState.fromNativeValue(call.arguments["newState"]); if (_webview != null && _webview!.onMicrophoneCaptureStateChanged != null) @@ -2418,7 +2418,7 @@ class InAppWebViewController { hitTestResultMap = hitTestResultMap.cast(); InAppWebViewHitTestResultType? type = - InAppWebViewHitTestResultType.fromValue( + InAppWebViewHitTestResultType.fromNativeValue( hitTestResultMap["type"]?.toInt()); String? extra = hitTestResultMap["extra"]; return InAppWebViewHitTestResult(type: type, extra: extra); @@ -3303,7 +3303,7 @@ class InAppWebViewController { ///- iOS ([Official API - WKWebView.requestMediaPlaybackState](https://developer.apple.com/documentation/webkit/wkwebview/3752241-requestmediaplaybackstate)). Future requestMediaPlaybackState() async { Map args = {}; - return MediaPlaybackState.fromValue( + return MediaPlaybackState.fromNativeValue( await _channel.invokeMethod('requestMediaPlaybackState', args)); } @@ -3325,7 +3325,7 @@ class InAppWebViewController { ///- iOS ([Official API - WKWebView.cameraCaptureState](https://developer.apple.com/documentation/webkit/wkwebview/3763093-cameracapturestate)). Future getCameraCaptureState() async { Map args = {}; - return MediaCaptureState.fromValue( + return MediaCaptureState.fromNativeValue( await _channel.invokeMethod('getCameraCaptureState', args)); } @@ -3349,7 +3349,7 @@ class InAppWebViewController { ///- iOS ([Official API - WKWebView.microphoneCaptureState](https://developer.apple.com/documentation/webkit/wkwebview/3763096-microphonecapturestate)). Future getMicrophoneCaptureState() async { Map args = {}; - return MediaCaptureState.fromValue( + return MediaCaptureState.fromNativeValue( await _channel.invokeMethod('getMicrophoneCaptureState', args)); } 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 f161820a..8ccb6ba5 100755 --- a/lib/src/in_app_webview/in_app_webview_settings.dart +++ b/lib/src/in_app_webview/in_app_webview_settings.dart @@ -1182,7 +1182,7 @@ class InAppWebViewSettings { }); List dataDetectorTypesList = []; dataDetectorTypes.forEach((dataDetectorType) { - dataDetectorTypesList.add(dataDetectorType.toValue()); + dataDetectorTypesList.add(dataDetectorType.toNativeValue()); }); return { @@ -1200,7 +1200,7 @@ class InAppWebViewSettings { "horizontalScrollBarEnabled": horizontalScrollBarEnabled, "resourceCustomSchemes": resourceCustomSchemes, "contentBlockers": contentBlockersMapList, - "preferredContentMode": preferredContentMode?.toValue(), + "preferredContentMode": preferredContentMode?.toNativeValue(), "useShouldInterceptAjaxRequest": useShouldInterceptAjaxRequest, "useShouldInterceptFetchRequest": useShouldInterceptFetchRequest, "incognito": incognito, @@ -1220,24 +1220,24 @@ class InAppWebViewSettings { "domStorageEnabled": domStorageEnabled, "useWideViewPort": useWideViewPort, "safeBrowsingEnabled": safeBrowsingEnabled, - "mixedContentMode": mixedContentMode?.toValue(), + "mixedContentMode": mixedContentMode?.toNativeValue(), "allowContentAccess": allowContentAccess, "allowFileAccess": allowFileAccess, "appCachePath": appCachePath, "blockNetworkImage": blockNetworkImage, "blockNetworkLoads": blockNetworkLoads, - "cacheMode": cacheMode?.toValue(), + "cacheMode": cacheMode?.toNativeValue(), "cursiveFontFamily": cursiveFontFamily, "defaultFixedFontSize": defaultFixedFontSize, "defaultFontSize": defaultFontSize, "defaultTextEncodingName": defaultTextEncodingName, - "disabledActionModeMenuItems": disabledActionModeMenuItems?.toValue(), + "disabledActionModeMenuItems": disabledActionModeMenuItems?.toNativeValue(), "fantasyFontFamily": fantasyFontFamily, "fixedFontFamily": fixedFontFamily, - "forceDark": forceDark?.toValue(), - "forceDarkStrategy": forceDarkStrategy?.toValue(), + "forceDark": forceDark?.toNativeValue(), + "forceDarkStrategy": forceDarkStrategy?.toNativeValue(), "geolocationEnabled": geolocationEnabled, - "layoutAlgorithm": layoutAlgorithm?.toValue(), + "layoutAlgorithm": layoutAlgorithm?.toNativeValue(), "loadWithOverviewMode": loadWithOverviewMode, "loadsImagesAutomatically": loadsImagesAutomatically, "minimumLogicalFontSize": minimumLogicalFontSize, @@ -1255,10 +1255,10 @@ class InAppWebViewSettings { "regexToCancelSubFramesLoading": regexToCancelSubFramesLoading, "useShouldInterceptRequest": useShouldInterceptRequest, "useOnRenderProcessGone": useOnRenderProcessGone, - "overScrollMode": overScrollMode?.toValue(), + "overScrollMode": overScrollMode?.toNativeValue(), "networkAvailable": networkAvailable, - "scrollBarStyle": scrollBarStyle?.toValue(), - "verticalScrollbarPosition": verticalScrollbarPosition?.toValue(), + "scrollBarStyle": scrollBarStyle?.toNativeValue(), + "verticalScrollbarPosition": verticalScrollbarPosition?.toNativeValue(), "scrollBarDefaultDelayBeforeFade": scrollBarDefaultDelayBeforeFade, "scrollbarFadingEnabled": scrollbarFadingEnabled, "scrollBarFadeDuration": scrollBarFadeDuration, @@ -1280,13 +1280,13 @@ class InAppWebViewSettings { "allowsPictureInPictureMediaPlayback": allowsPictureInPictureMediaPlayback, "isFraudulentWebsiteWarningEnabled": isFraudulentWebsiteWarningEnabled, - "selectionGranularity": selectionGranularity.toValue(), + "selectionGranularity": selectionGranularity.toNativeValue(), "dataDetectorTypes": dataDetectorTypesList, "sharedCookiesEnabled": sharedCookiesEnabled, "automaticallyAdjustsScrollIndicatorInsets": automaticallyAdjustsScrollIndicatorInsets, "accessibilityIgnoresInvertColors": accessibilityIgnoresInvertColors, - "decelerationRate": decelerationRate.toValue(), + "decelerationRate": decelerationRate.toNativeValue(), "alwaysBounceVertical": alwaysBounceVertical, "alwaysBounceHorizontal": alwaysBounceHorizontal, "scrollsToTop": scrollsToTop, @@ -1294,7 +1294,7 @@ class InAppWebViewSettings { "maximumZoomScale": maximumZoomScale, "minimumZoomScale": minimumZoomScale, "contentInsetAdjustmentBehavior": - contentInsetAdjustmentBehavior.toValue(), + contentInsetAdjustmentBehavior.toNativeValue(), "isDirectionalLockEnabled": isDirectionalLockEnabled, "mediaType": mediaType, "pageZoom": pageZoom, @@ -1310,7 +1310,7 @@ class InAppWebViewSettings { "upgradeKnownHostsToHTTPS": upgradeKnownHostsToHTTPS, "iframeAllow": iframeAllow, "iframeAllowFullscreen": iframeAllowFullscreen, - "iframeSandbox": iframeSandbox?.map((e) => e.toValue()).toList(), + "iframeSandbox": iframeSandbox?.map((e) => e.toNativeValue()).toList(), "iframeReferrerPolicy": iframeReferrerPolicy, "iframeName": iframeName, "iframeCsp": iframeCsp, @@ -1332,7 +1332,7 @@ class InAppWebViewSettings { List dataDetectorTypesList = List.from(map["dataDetectorTypes"] ?? []); dataDetectorTypesList.forEach((dataDetectorTypeValue) { - var dataDetectorType = DataDetectorTypes.fromValue(dataDetectorTypeValue); + var dataDetectorType = DataDetectorTypes.fromNativeValue(dataDetectorTypeValue); if (dataDetectorType != null) { dataDetectorTypes.add(dataDetectorType); } @@ -1356,7 +1356,7 @@ class InAppWebViewSettings { List.from(map["resourceCustomSchemes"] ?? []); settings.contentBlockers = contentBlockers; settings.preferredContentMode = - UserPreferredContentMode.fromValue(map["preferredContentMode"]); + UserPreferredContentMode.fromNativeValue(map["preferredContentMode"]); settings.useShouldInterceptAjaxRequest = map["useShouldInterceptAjaxRequest"]; settings.useShouldInterceptFetchRequest = @@ -1376,10 +1376,10 @@ class InAppWebViewSettings { settings.iframeAllowFullscreen = map["iframeAllowFullscreen"]; settings.iframeSandbox = map["iframeSandbox"] != null ? Set.from((map["iframeSandbox"].cast() as List) - .map((e) => Sandbox.fromValue(e))) + .map((e) => Sandbox.fromNativeValue(e))) : null; settings.iframeReferrerPolicy = - ReferrerPolicy.fromValue(map["iframeReferrerPolicy"]); + ReferrerPolicy.fromNativeValue(map["iframeReferrerPolicy"]); settings.iframeName = map["iframeName"]; settings.iframeCsp = map["iframeCsp"]; } else { @@ -1393,26 +1393,26 @@ class InAppWebViewSettings { settings.useWideViewPort = map["useWideViewPort"]; settings.safeBrowsingEnabled = map["safeBrowsingEnabled"]; settings.mixedContentMode = - MixedContentMode.fromValue(map["mixedContentMode"]); + MixedContentMode.fromNativeValue(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.cacheMode = CacheMode.fromNativeValue(map["cacheMode"]); settings.cursiveFontFamily = map["cursiveFontFamily"]; settings.defaultFixedFontSize = map["defaultFixedFontSize"]; settings.defaultFontSize = map["defaultFontSize"]; settings.defaultTextEncodingName = map["defaultTextEncodingName"]; settings.disabledActionModeMenuItems = - ActionModeMenuItem.fromValue(map["disabledActionModeMenuItems"]); + ActionModeMenuItem.fromNativeValue(map["disabledActionModeMenuItems"]); settings.fantasyFontFamily = map["fantasyFontFamily"]; settings.fixedFontFamily = map["fixedFontFamily"]; - settings.forceDark = ForceDark.fromValue(map["forceDark"]); - settings.forceDarkStrategy = ForceDarkStrategy.fromValue(map["forceDarkStrategy"]); + settings.forceDark = ForceDark.fromNativeValue(map["forceDark"]); + settings.forceDarkStrategy = ForceDarkStrategy.fromNativeValue(map["forceDarkStrategy"]); settings.geolocationEnabled = map["geolocationEnabled"]; settings.layoutAlgorithm = - LayoutAlgorithm.fromValue(map["layoutAlgorithm"]); + LayoutAlgorithm.fromNativeValue(map["layoutAlgorithm"]); settings.loadWithOverviewMode = map["loadWithOverviewMode"]; settings.loadsImagesAutomatically = map["loadsImagesAutomatically"]; settings.minimumLogicalFontSize = map["minimumLogicalFontSize"]; @@ -1431,11 +1431,11 @@ class InAppWebViewSettings { settings.useHybridComposition = map["useHybridComposition"]; settings.useShouldInterceptRequest = map["useShouldInterceptRequest"]; settings.useOnRenderProcessGone = map["useOnRenderProcessGone"]; - settings.overScrollMode = OverScrollMode.fromValue(map["overScrollMode"]); + settings.overScrollMode = OverScrollMode.fromNativeValue(map["overScrollMode"]); settings.networkAvailable = map["networkAvailable"]; - settings.scrollBarStyle = ScrollBarStyle.fromValue(map["scrollBarStyle"]); + settings.scrollBarStyle = ScrollBarStyle.fromNativeValue(map["scrollBarStyle"]); settings.verticalScrollbarPosition = - VerticalScrollbarPosition.fromValue(map["verticalScrollbarPosition"]); + VerticalScrollbarPosition.fromNativeValue(map["verticalScrollbarPosition"]); settings.scrollBarDefaultDelayBeforeFade = map["scrollBarDefaultDelayBeforeFade"]; settings.scrollbarFadingEnabled = map["scrollbarFadingEnabled"]; @@ -1470,7 +1470,7 @@ class InAppWebViewSettings { settings.isFraudulentWebsiteWarningEnabled = map["isFraudulentWebsiteWarningEnabled"]; settings.selectionGranularity = - SelectionGranularity.fromValue(map["selectionGranularity"])!; + SelectionGranularity.fromNativeValue(map["selectionGranularity"])!; settings.dataDetectorTypes = dataDetectorTypes; settings.sharedCookiesEnabled = map["sharedCookiesEnabled"]; settings.automaticallyAdjustsScrollIndicatorInsets = @@ -1478,7 +1478,7 @@ class InAppWebViewSettings { settings.accessibilityIgnoresInvertColors = map["accessibilityIgnoresInvertColors"]; settings.decelerationRate = - ScrollViewDecelerationRate.fromValue(map["decelerationRate"])!; + ScrollViewDecelerationRate.fromNativeValue(map["decelerationRate"])!; settings.alwaysBounceVertical = map["alwaysBounceVertical"]; settings.alwaysBounceHorizontal = map["alwaysBounceHorizontal"]; settings.scrollsToTop = map["scrollsToTop"]; @@ -1486,7 +1486,7 @@ class InAppWebViewSettings { settings.maximumZoomScale = map["maximumZoomScale"]; settings.minimumZoomScale = map["minimumZoomScale"]; settings.contentInsetAdjustmentBehavior = - ScrollViewContentInsetAdjustmentBehavior.fromValue( + ScrollViewContentInsetAdjustmentBehavior.fromNativeValue( map["contentInsetAdjustmentBehavior"])!; settings.isDirectionalLockEnabled = map["isDirectionalLockEnabled"]; settings.mediaType = map["mediaType"]; @@ -1782,7 +1782,7 @@ class InAppWebViewOptions "horizontalScrollBarEnabled": horizontalScrollBarEnabled, "resourceCustomSchemes": resourceCustomSchemes, "contentBlockers": contentBlockersMapList, - "preferredContentMode": preferredContentMode?.toValue(), + "preferredContentMode": preferredContentMode?.toNativeValue(), "useShouldInterceptAjaxRequest": useShouldInterceptAjaxRequest, "useShouldInterceptFetchRequest": useShouldInterceptFetchRequest, "incognito": incognito, @@ -1826,7 +1826,7 @@ class InAppWebViewOptions List.from(map["resourceCustomSchemes"] ?? []); instance.contentBlockers = contentBlockers; instance.preferredContentMode = - UserPreferredContentMode.fromValue(map["preferredContentMode"]); + UserPreferredContentMode.fromNativeValue(map["preferredContentMode"]); instance.useShouldInterceptAjaxRequest = map["useShouldInterceptAjaxRequest"]; instance.useShouldInterceptFetchRequest = diff --git a/lib/src/print_job/print_job_settings.dart b/lib/src/print_job/print_job_settings.dart index 2d9503cf..f24be180 100644 --- a/lib/src/print_job/print_job_settings.dart +++ b/lib/src/print_job/print_job_settings.dart @@ -183,17 +183,17 @@ class PrintJobSettings { handledByClient: map["handledByClient"], jobName: map["jobName"], animated: map["animated"], - orientation: PrintJobOrientation.fromValue(map["orientation"]), + orientation: PrintJobOrientation.fromNativeValue(map["orientation"]), numberOfPages: map["numberOfPages"], forceRenderingQuality: - PrintJobRenderingQuality.fromValue(map["forceRenderingQuality"]), + PrintJobRenderingQuality.fromNativeValue(map["forceRenderingQuality"]), margins: MapEdgeInsets.fromMap(map["margins"]?.cast()), mediaSize: PrintJobMediaSize.fromMap(map["mediaSize"]?.cast()), - colorMode: PrintJobColorMode.fromValue(map["colorMode"]), + colorMode: PrintJobColorMode.fromNativeValue(map["colorMode"]), duplexMode: PrintJobDuplexMode.fromNativeValue(map["duplexMode"]), - outputType: PrintJobOutputType.fromValue(map["outputType"]), + outputType: PrintJobOutputType.fromNativeValue(map["outputType"]), resolution: PrintJobResolution.fromMap(map["resolution"]?.cast()), showsNumberOfCopies: map["showsNumberOfCopies"], @@ -212,14 +212,14 @@ class PrintJobSettings { "handledByClient": handledByClient, "jobName": jobName, "animated": animated, - "orientation": orientation?.toValue(), + "orientation": orientation?.toNativeValue(), "numberOfPages": numberOfPages, - "forceRenderingQuality": forceRenderingQuality?.toValue(), + "forceRenderingQuality": forceRenderingQuality?.toNativeValue(), "margins": margins?.toMap(), "mediaSize": mediaSize?.toMap(), - "colorMode": colorMode?.toValue(), + "colorMode": colorMode?.toNativeValue(), "duplexMode": duplexMode?.toNativeValue(), - "outputType": outputType?.toValue(), + "outputType": outputType?.toNativeValue(), "resolution": resolution?.toMap(), "showsNumberOfCopies": showsNumberOfCopies, "showsPaperSelectionForLoadedPapers": showsPaperSelectionForLoadedPapers, diff --git a/lib/src/pull_to_refresh/pull_to_refresh_controller.dart b/lib/src/pull_to_refresh/pull_to_refresh_controller.dart index b8f9aeee..64476f32 100644 --- a/lib/src/pull_to_refresh/pull_to_refresh_controller.dart +++ b/lib/src/pull_to_refresh/pull_to_refresh_controller.dart @@ -133,7 +133,7 @@ class PullToRefreshController { @Deprecated("Use setIndicatorSize instead") Future setSize(AndroidPullToRefreshSize size) async { Map args = {}; - args.putIfAbsent('size', () => size.toValue()); + args.putIfAbsent('size', () => size.toNativeValue()); await _channel?.invokeMethod('setSize', args); } @@ -142,7 +142,7 @@ class PullToRefreshController { ///**NOTE**: Available only on Android. Future setIndicatorSize(PullToRefreshSize size) async { Map args = {}; - args.putIfAbsent('size', () => size.toValue()); + args.putIfAbsent('size', () => size.toNativeValue()); await _channel?.invokeMethod('setSize', args); } diff --git a/lib/src/pull_to_refresh/pull_to_refresh_settings.dart b/lib/src/pull_to_refresh/pull_to_refresh_settings.dart index fa7e85a6..2347cc3f 100644 --- a/lib/src/pull_to_refresh/pull_to_refresh_settings.dart +++ b/lib/src/pull_to_refresh/pull_to_refresh_settings.dart @@ -49,7 +49,7 @@ class PullToRefreshSettings { "backgroundColor": backgroundColor?.toHex(), "distanceToTriggerSync": distanceToTriggerSync, "slingshotDistance": slingshotDistance, - "size": size?.toValue(), + "size": size?.toNativeValue(), "attributedTitle": attributedTitle?.toMap() ?? {} }; } @@ -112,7 +112,7 @@ class PullToRefreshOptions { "backgroundColor": backgroundColor?.toHex(), "distanceToTriggerSync": distanceToTriggerSync, "slingshotDistance": slingshotDistance, - "size": size?.toValue(), + "size": size?.toNativeValue(), "attributedTitle": attributedTitle?.toMap() ?? {} }; } diff --git a/lib/src/web/in_app_web_view_web_element.dart b/lib/src/web/in_app_web_view_web_element.dart index ea60074c..0cddc5f2 100644 --- a/lib/src/web/in_app_web_view_web_element.dart +++ b/lib/src/web/in_app_web_view_web_element.dart @@ -174,18 +174,18 @@ class InAppWebViewWebElement implements Disposable { iframe.allowFullscreen = settings.iframeAllowFullscreen ?? iframe.allowFullscreen; iframe.referrerPolicy = - settings.iframeReferrerPolicy?.toValue() ?? iframe.referrerPolicy; + settings.iframeReferrerPolicy?.toNativeValue() ?? iframe.referrerPolicy; iframe.name = settings.iframeName ?? iframe.name; iframe.csp = settings.iframeCsp ?? iframe.csp; if (settings.iframeSandbox != null && settings.iframeSandbox != Sandbox.ALLOW_ALL) { iframe.setAttribute( - "sandbox", settings.iframeSandbox!.map((e) => e.toValue()).join(" ")); + "sandbox", settings.iframeSandbox!.map((e) => e.toNativeValue()).join(" ")); } else if (settings.iframeSandbox == Sandbox.ALLOW_ALL) { iframe.removeAttribute("sandbox"); } else if (sandbox != Sandbox.values) { - iframe.setAttribute("sandbox", sandbox.map((e) => e.toValue()).join(" ")); + iframe.setAttribute("sandbox", sandbox.map((e) => e.toNativeValue()).join(" ")); settings.iframeSandbox = sandbox; } @@ -394,7 +394,7 @@ class InAppWebViewWebElement implements Disposable { iframe.allowFullscreen = newSettings.iframeAllowFullscreen; } if (settings.iframeReferrerPolicy != newSettings.iframeReferrerPolicy) { - iframe.referrerPolicy = newSettings.iframeReferrerPolicy?.toValue(); + iframe.referrerPolicy = newSettings.iframeReferrerPolicy?.toNativeValue(); } if (settings.iframeName != newSettings.iframeName) { iframe.name = newSettings.iframeName; @@ -407,12 +407,12 @@ class InAppWebViewWebElement implements Disposable { var sandbox = newSettings.iframeSandbox; if (sandbox != null && sandbox != Sandbox.ALLOW_ALL) { iframe.setAttribute( - "sandbox", sandbox.map((e) => e.toValue()).join(" ")); + "sandbox", sandbox.map((e) => e.toNativeValue()).join(" ")); } else if (sandbox == Sandbox.ALLOW_ALL) { iframe.removeAttribute("sandbox"); } } else if (sandbox != Sandbox.values) { - iframe.setAttribute("sandbox", sandbox.map((e) => e.toValue()).join(" ")); + iframe.setAttribute("sandbox", sandbox.map((e) => e.toNativeValue()).join(" ")); } newSettings.iframeSandbox = sandbox; diff --git a/lib/src/web_authentication_session/web_authenticate_session.dart b/lib/src/web_authentication_session/web_authenticate_session.dart index e0afabb1..a7a7a84c 100755 --- a/lib/src/web_authentication_session/web_authenticate_session.dart +++ b/lib/src/web_authentication_session/web_authenticate_session.dart @@ -126,7 +126,7 @@ class WebAuthenticationSession implements Disposable { case "onComplete": String? url = call.arguments["url"]; Uri? uri = url != null ? Uri.parse(url) : null; - var error = WebAuthenticationSessionError.fromValue( + var error = WebAuthenticationSessionError.fromNativeValue( call.arguments["errorCode"]); if (onComplete != null) { onComplete!(uri, error); diff --git a/lib/src/web_storage/ios/web_storage_manager.dart b/lib/src/web_storage/ios/web_storage_manager.dart index 9dc74115..143d106c 100755 --- a/lib/src/web_storage/ios/web_storage_manager.dart +++ b/lib/src/web_storage/ios/web_storage_manager.dart @@ -34,7 +34,7 @@ class IOSWebStorageManager { List dataTypesString = record["dataTypes"].cast(); Set dataTypes = Set(); for (var dataTypeValue in dataTypesString) { - var dataType = IOSWKWebsiteDataType.fromValue(dataTypeValue); + var dataType = IOSWKWebsiteDataType.fromNativeValue(dataTypeValue); if (dataType != null) { dataTypes.add(dataType); } diff --git a/lib/src/web_storage/web_storage_manager.dart b/lib/src/web_storage/web_storage_manager.dart index 655dcd50..65b17277 100755 --- a/lib/src/web_storage/web_storage_manager.dart +++ b/lib/src/web_storage/web_storage_manager.dart @@ -115,7 +115,7 @@ class WebStorageManager { List recordList = []; List dataTypesList = []; for (var dataType in dataTypes) { - dataTypesList.add(dataType.toValue()); + dataTypesList.add(dataType.toNativeValue()); } Map args = {}; args.putIfAbsent("dataTypes", () => dataTypesList); @@ -126,7 +126,7 @@ class WebStorageManager { List dataTypesString = record["dataTypes"].cast(); Set dataTypes = Set(); for (var dataTypeValue in dataTypesString) { - var dataType = WebsiteDataType.fromValue(dataTypeValue); + var dataType = WebsiteDataType.fromNativeValue(dataTypeValue); if (dataType != null) { dataTypes.add(dataType); } @@ -150,7 +150,7 @@ class WebStorageManager { required List dataRecords}) async { List dataTypesList = []; for (var dataType in dataTypes) { - dataTypesList.add(dataType.toValue()); + dataTypesList.add(dataType.toNativeValue()); } List> recordList = []; @@ -176,7 +176,7 @@ class WebStorageManager { {required Set dataTypes, required DateTime date}) async { List dataTypesList = []; for (var dataType in dataTypes) { - dataTypesList.add(dataType.toValue()); + dataTypesList.add(dataType.toNativeValue()); } var timestamp = date.millisecondsSinceEpoch;