updated all toValue and fromValue

This commit is contained in:
Lorenzo Pichilli 2022-10-05 13:52:07 +02:00
parent cd523c9d53
commit 9d738d3435
24 changed files with 173 additions and 145 deletions

View File

@ -107,7 +107,7 @@ class ServiceWorkerController {
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#getCacheMode()
static Future<CacheMode?> getCacheMode() async {
Map<String, dynamic> args = <String, dynamic>{};
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<void> setCacheMode(CacheMode mode) async {
Map<String, dynamic> args = <String, dynamic>{};
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<AndroidCacheMode?> getCacheMode() async {
Map<String, dynamic> args = <String, dynamic>{};
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<void> setCacheMode(AndroidCacheMode mode) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("mode", () => mode.toValue());
args.putIfAbsent("mode", () => mode.toNativeValue());
await _channel.invokeMethod('setCacheMode', args);
}
}

View File

@ -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<bool> isFeatureSupported(WebViewFeature_ feature) async {
Map<String, dynamic> args = <String, dynamic>{};
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<bool> isFeatureSupported(AndroidWebViewFeature_ feature) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("feature", () => feature.toValue());
args.putIfAbsent("feature", () => feature.toNativeValue());
return await _channel.invokeMethod('isFeatureSupported', args);
}
}

View File

@ -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<bool> isFeatureSupported(WebViewFeature_ feature) async {
static Future<bool> isFeatureSupported(WebViewFeature feature) async {
Map<String, dynamic> args = <String, dynamic>{};
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<bool> isFeatureSupported(AndroidWebViewFeature_ feature) async {
static Future<bool> isFeatureSupported(AndroidWebViewFeature feature) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("feature", () => feature.toValue());
args.putIfAbsent("feature", () => feature.toNativeValue());
return await _channel.invokeMethod('isFeatureSupported', args);
}

View File

@ -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()
};
}

View File

@ -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;
}

View File

@ -201,7 +201,7 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
@override
Map<String, dynamic> 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;
}

View File

@ -88,11 +88,11 @@ class ContentBlockerTrigger {
Map<String, dynamic> toMap() {
List<String> resourceTypeStringList = [];
resourceType.forEach((type) {
resourceTypeStringList.add(type.toValue());
resourceTypeStringList.add(type.toNativeValue());
});
List<String> loadTypeStringList = [];
loadType.forEach((type) {
loadTypeStringList.add(type.toValue());
loadTypeStringList.add(type.toNativeValue());
});
Map<String, dynamic> map = {
@ -123,7 +123,7 @@ class ContentBlockerTrigger {
List<String> resourceTypeStringList =
List<String>.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<String> loadTypeStringList = List<String>.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<String, dynamic> toMap() {
Map<String, dynamic> map = {"type": type.toValue(), "selector": selector};
Map<String, dynamic> map = {"type": type.toNativeValue(), "selector": selector};
map.keys
.where((key) =>
@ -186,7 +186,7 @@ class ContentBlockerAction {
static ContentBlockerAction fromMap(Map<String, dynamic> map) {
return ContentBlockerAction(
type: ContentBlockerActionType.fromValue(map["type"])!,
type: ContentBlockerActionType.fromNativeValue(map["type"])!,
selector: map["selector"]);
}
}

View File

@ -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"]));

View File

@ -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;
}

View File

@ -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<dynamic> _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);

View File

@ -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;
}

View File

@ -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"];

View File

@ -270,7 +270,7 @@ class IOSInAppWebViewOptions
Map<String, dynamic> toMap() {
List<String> 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<String>.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"];

View File

@ -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,

View File

@ -646,7 +646,7 @@ class _InAppWebViewState extends State<InAppWebView> {
'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<InAppWebView> {
'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<InAppWebView> {
'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

View File

@ -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<String, dynamic>();
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<MediaPlaybackState?> requestMediaPlaybackState() async {
Map<String, dynamic> args = <String, dynamic>{};
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<MediaCaptureState?> getCameraCaptureState() async {
Map<String, dynamic> args = <String, dynamic>{};
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<MediaCaptureState?> getMicrophoneCaptureState() async {
Map<String, dynamic> args = <String, dynamic>{};
return MediaCaptureState.fromValue(
return MediaCaptureState.fromNativeValue(
await _channel.invokeMethod('getMicrophoneCaptureState', args));
}

View File

@ -1182,7 +1182,7 @@ class InAppWebViewSettings {
});
List<String> 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<String> dataDetectorTypesList =
List<String>.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<String>.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<String>() as List<String>)
.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<String>.from(map["resourceCustomSchemes"] ?? []);
instance.contentBlockers = contentBlockers;
instance.preferredContentMode =
UserPreferredContentMode.fromValue(map["preferredContentMode"]);
UserPreferredContentMode.fromNativeValue(map["preferredContentMode"]);
instance.useShouldInterceptAjaxRequest =
map["useShouldInterceptAjaxRequest"];
instance.useShouldInterceptFetchRequest =

View File

@ -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<String, dynamic>()),
mediaSize:
PrintJobMediaSize.fromMap(map["mediaSize"]?.cast<String, dynamic>()),
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<String, dynamic>()),
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,

View File

@ -133,7 +133,7 @@ class PullToRefreshController {
@Deprecated("Use setIndicatorSize instead")
Future<void> setSize(AndroidPullToRefreshSize size) async {
Map<String, dynamic> args = <String, dynamic>{};
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<void> setIndicatorSize(PullToRefreshSize size) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent('size', () => size.toValue());
args.putIfAbsent('size', () => size.toNativeValue());
await _channel?.invokeMethod('setSize', args);
}

View File

@ -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() ?? {}
};
}

View File

@ -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;

View File

@ -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);

View File

@ -34,7 +34,7 @@ class IOSWebStorageManager {
List<String> dataTypesString = record["dataTypes"].cast<String>();
Set<IOSWKWebsiteDataType> dataTypes = Set();
for (var dataTypeValue in dataTypesString) {
var dataType = IOSWKWebsiteDataType.fromValue(dataTypeValue);
var dataType = IOSWKWebsiteDataType.fromNativeValue(dataTypeValue);
if (dataType != null) {
dataTypes.add(dataType);
}

View File

@ -115,7 +115,7 @@ class WebStorageManager {
List<WebsiteDataRecord> recordList = [];
List<String> dataTypesList = [];
for (var dataType in dataTypes) {
dataTypesList.add(dataType.toValue());
dataTypesList.add(dataType.toNativeValue());
}
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("dataTypes", () => dataTypesList);
@ -126,7 +126,7 @@ class WebStorageManager {
List<String> dataTypesString = record["dataTypes"].cast<String>();
Set<WebsiteDataType> 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<WebsiteDataRecord> dataRecords}) async {
List<String> dataTypesList = [];
for (var dataType in dataTypes) {
dataTypesList.add(dataType.toValue());
dataTypesList.add(dataType.toNativeValue());
}
List<Map<String, dynamic>> recordList = [];
@ -176,7 +176,7 @@ class WebStorageManager {
{required Set<WebsiteDataType> dataTypes, required DateTime date}) async {
List<String> dataTypesList = [];
for (var dataType in dataTypes) {
dataTypesList.add(dataType.toValue());
dataTypesList.add(dataType.toNativeValue());
}
var timestamp = date.millisecondsSinceEpoch;