complete applying internal annotations to types folder

This commit is contained in:
Lorenzo Pichilli 2022-10-05 13:13:20 +02:00
parent caa5c7525e
commit cd523c9d53
99 changed files with 6248 additions and 2704 deletions

View File

@ -16,10 +16,10 @@
### BREAKING CHANGES ### BREAKING CHANGES
- On Android, the `InAppWebView` widget uses hybrid composition by default (`useHybridComposition: true`) - On Android, the `InAppWebView` widget uses hybrid composition by default (`useHybridComposition: true`)
- All properties of `GeolocationPermissionShowPromptResponse` cannot be `null` - All properties of `GeolocationPermissionShowPromptResponse` cannot be `null`
- Removed `URLProtectionSpace.iosIsProxy` property - Removed `URLProtectionSpace.iosIsProxy` property
- `historyUrl` and `baseUrl` of `InAppWebViewInitialData` can be `null` - `historyUrl` and `baseUrl` of `InAppWebViewInitialData` can be `null`
## 5.4.4+2 ## 5.4.4+2
@ -90,7 +90,7 @@
## 5.4.1 ## 5.4.1
- Managed iOS native `detachFromEngine` flutter plugin event and updated `dispose` methods - Managed iOS native `detachFromEngine` flutter plugin event and updated `dispose` methods
- Updated Android native `HeadlessInAppWebViewManager.dispose` and `HeadlessInAppWebView.dispose` methods - Updated Android native `HeadlessInAppWebViewManager.dispose` and `HeadlessInAppWebView.dispose` methods
## 5.4.0+3 ## 5.4.0+3
@ -345,7 +345,7 @@
- Renamed `toolbarTop` InAppBrowser cross-platform option to `hideToolbarTop` - Renamed `toolbarTop` InAppBrowser cross-platform option to `hideToolbarTop`
- Renamed `toolbarBottom` InAppBrowser ios-specific option to `hideToolbarBottom` - Renamed `toolbarBottom` InAppBrowser ios-specific option to `hideToolbarBottom`
- Removed `debuggingEnabled` WebView option; on Android you should use now the `AndroidInAppWebViewController.setWebContentsDebuggingEnabled(bool debuggingEnabled)` static method; on iOS, debugging is always enabled - Removed `debuggingEnabled` WebView option; on Android you should use now the `AndroidInAppWebViewController.setWebContentsDebuggingEnabled(bool debuggingEnabled)` static method; on iOS, debugging is always enabled
- Removed `androidOnRequestFocus` event because it is never called - Removed `androidOnRequestFocus` event because it is never called
- Removed `initialHeaders` WebView attribute. Use `URLRequest.headers` attribute - Removed `initialHeaders` WebView attribute. Use `URLRequest.headers` attribute
- Removed `headers` argument from `loadFile` WebView method - Removed `headers` argument from `loadFile` WebView method
- Removed `headers` argument from `openFile` InAppBrowser method - Removed `headers` argument from `openFile` InAppBrowser method
@ -361,11 +361,11 @@
- Changed return type of `getOriginalUrl` Android-specific WebView method to `Uri` - Changed return type of `getOriginalUrl` Android-specific WebView method to `Uri`
- Changed return type of `getSafeBrowsingPrivacyPolicyUrl` Android-specific WebView method to `Uri` - Changed return type of `getSafeBrowsingPrivacyPolicyUrl` Android-specific WebView method to `Uri`
- Changed type of `url` argument of `onLoadStart`, `onLoadStop`, `onLoadError`, `onLoadHttpError`, `onLoadResourceCustomScheme`, `onUpdateVisitedHistory`, `onPrint`, `onPageCommitVisible`, `androidOnSafeBrowsingHit`, `androidOnRenderProcessUnresponsive`, `androidOnRenderProcessResponsive`, `androidOnFormResubmission`, `androidOnReceivedTouchIconUrl` WebView events to `Uri` - Changed type of `url` argument of `onLoadStart`, `onLoadStop`, `onLoadError`, `onLoadHttpError`, `onLoadResourceCustomScheme`, `onUpdateVisitedHistory`, `onPrint`, `onPageCommitVisible`, `androidOnSafeBrowsingHit`, `androidOnRenderProcessUnresponsive`, `androidOnRenderProcessResponsive`, `androidOnFormResubmission`, `androidOnReceivedTouchIconUrl` WebView events to `Uri`
- Changed type of `baseUrl` and `androidHistoryUrl` arguments of `loadData` WebView method and `openData` InAppBrowser method - Changed type of `baseUrl` and `androidHistoryUrl` arguments of `loadData` WebView method and `openData` InAppBrowser method
- Changed `openUrl` InAppBrowser method to `openUrlRequest` - Changed `openUrl` InAppBrowser method to `openUrlRequest`
- Changed type of `url` argument of `openWithSystemBrowser` InAppBrowser method to `Uri` - Changed type of `url` argument of `openWithSystemBrowser` InAppBrowser method to `Uri`
- Changed all InAppBrowser color options type from `String` to `Color` - Changed all InAppBrowser color options type from `String` to `Color`
- Changed all ChromeSafariBrowser color options type from `String` to `Color` - Changed all ChromeSafariBrowser color options type from `String` to `Color`
- Updated attributes of `ShouldOverrideUrlLoadingRequest`, `ServerTrustChallenge` and `ClientCertChallenge` classes - Updated attributes of `ShouldOverrideUrlLoadingRequest`, `ServerTrustChallenge` and `ClientCertChallenge` classes
- Changed type of `url` attribute to `Uri` for `JsAlertRequest`, `JsAlertConfirm`, `JsPromptRequest` classes - Changed type of `url` attribute to `Uri` for `JsAlertRequest`, `JsAlertConfirm`, `JsPromptRequest` classes

View File

@ -1182,7 +1182,7 @@ public class WebViewChannelDelegate extends ChannelDelegateImpl {
@Nullable @Nullable
@Override @Override
public Integer decodeResult(@Nullable Object obj) { public Integer decodeResult(@Nullable Object obj) {
return obj != null ? (Integer) ((Map<String, Object>) obj).get("action") : null; return obj instanceof Integer ? (Integer) obj : null;
} }
} }
@ -1201,7 +1201,7 @@ public class WebViewChannelDelegate extends ChannelDelegateImpl {
@Nullable @Nullable
@Override @Override
public Integer decodeResult(@Nullable Object obj) { public Integer decodeResult(@Nullable Object obj) {
return obj != null ? (Integer) ((Map<String, Object>) obj).get("action") : null; return obj instanceof Integer ? (Integer) obj : null;
} }
} }

View File

@ -3,6 +3,8 @@ library flutter_inappwebview_internal_annotations;
export 'src/exchangeable_object.dart'; export 'src/exchangeable_object.dart';
export 'src/exchangeable_object_constructor.dart'; export 'src/exchangeable_object_constructor.dart';
export 'src/exchangeable_object_property.dart'; export 'src/exchangeable_object_property.dart';
export 'src/exchangeable_object_method.dart';
export 'src/exchangeable_enum.dart'; export 'src/exchangeable_enum.dart';
export 'src/exchangeable_enum_custom_value.dart';
export 'src/supported_platforms.dart'; export 'src/supported_platforms.dart';
export 'src/enum_supported_platforms.dart'; export 'src/enum_supported_platforms.dart';

View File

@ -0,0 +1,3 @@
class ExchangeableEnumCustomValue {
const ExchangeableEnumCustomValue();
}

View File

@ -0,0 +1,9 @@
class ExchangeableObjectMethod {
final bool ignore;
final bool toMapMergeWith;
const ExchangeableObjectMethod({
this.ignore = false,
this.toMapMergeWith = false
});
}

View File

@ -1,20 +1,27 @@
# Generated by pub # Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile # See https://dart.dev/tools/pub/glossary#lockfile
packages: packages:
_fe_analyzer_shared:
dependency: transitive
description:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "49.0.0"
analyzer: analyzer:
dependency: transitive dependency: transitive
description: description:
name: analyzer name: analyzer
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.33.6+1" version: "5.1.0"
args: args:
dependency: transitive dependency: transitive
description: description:
name: args name: args
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.6.0" version: "2.3.1"
async: async:
dependency: transitive dependency: transitive
description: description:
@ -28,21 +35,7 @@ packages:
name: boolean_selector name: boolean_selector
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.5" version: "2.1.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
collection: collection:
dependency: transitive dependency: transitive
description: description:
@ -56,84 +49,63 @@ packages:
name: convert name: convert
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.1" version: "3.0.2"
coverage:
dependency: transitive
description:
name: coverage
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.1"
crypto: crypto:
dependency: transitive dependency: transitive
description: description:
name: crypto name: crypto
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.5" version: "3.0.2"
csslib:
dependency: transitive
description:
name: csslib
url: "https://pub.dartlang.org"
source: hosted
version: "0.17.1"
file: file:
dependency: transitive dependency: transitive
description: description:
name: file name: file
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.2.1" version: "6.1.4"
front_end: frontend_server_client:
dependency: transitive dependency: transitive
description: description:
name: front_end name: frontend_server_client
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.6+9" version: "3.0.0"
glob: glob:
dependency: transitive dependency: transitive
description: description:
name: glob name: glob
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "2.1.0"
html:
dependency: transitive
description:
name: html
url: "https://pub.dartlang.org"
source: hosted
version: "0.15.0"
http:
dependency: transitive
description:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.2"
http_multi_server: http_multi_server:
dependency: transitive dependency: transitive
description: description:
name: http_multi_server name: http_multi_server
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.0" version: "3.2.1"
http_parser: http_parser:
dependency: transitive dependency: transitive
description: description:
name: http_parser name: http_parser
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.1.4" version: "4.0.1"
intl:
dependency: transitive
description:
name: intl
url: "https://pub.dartlang.org"
source: hosted
version: "0.17.0"
io: io:
dependency: transitive dependency: transitive
description: description:
name: io name: io
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.3.5" version: "1.0.3"
js: js:
dependency: transitive dependency: transitive
description: description:
@ -141,34 +113,20 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.6.4" version: "0.6.4"
json_rpc_2:
dependency: transitive
description:
name: json_rpc_2
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.2"
kernel:
dependency: transitive
description:
name: kernel
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.6+9"
logging: logging:
dependency: transitive dependency: transitive
description: description:
name: logging name: logging
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.11.4" version: "1.0.2"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.12.3+1" version: "0.12.12"
meta: meta:
dependency: transitive dependency: transitive
description: description:
@ -183,48 +141,20 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0" version: "1.0.0"
multi_server_socket:
dependency: transitive
description:
name: multi_server_socket
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
node_interop:
dependency: transitive
description:
name: node_interop
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
node_io:
dependency: transitive
description:
name: node_io
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
node_preamble: node_preamble:
dependency: transitive dependency: transitive
description: description:
name: node_preamble name: node_preamble
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.4.13" version: "2.0.1"
package_config: package_config:
dependency: transitive dependency: transitive
description: description:
name: package_config name: package_config
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.9.3" version: "2.1.0"
package_resolver:
dependency: transitive
description:
name: package_resolver
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.10"
path: path:
dependency: transitive dependency: transitive
description: description:
@ -232,20 +162,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.1" version: "1.8.1"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.11.1"
plugin:
dependency: transitive
description:
name: plugin
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0+3"
pool: pool:
dependency: transitive dependency: transitive
description: description:
@ -259,42 +175,42 @@ packages:
name: pub_semver name: pub_semver
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.4.4" version: "2.1.1"
shelf: shelf:
dependency: transitive dependency: transitive
description: description:
name: shelf name: shelf
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.7.9" version: "1.4.0"
shelf_packages_handler: shelf_packages_handler:
dependency: transitive dependency: transitive
description: description:
name: shelf_packages_handler name: shelf_packages_handler
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.4" version: "3.0.1"
shelf_static: shelf_static:
dependency: transitive dependency: transitive
description: description:
name: shelf_static name: shelf_static
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.9+2" version: "1.1.1"
shelf_web_socket: shelf_web_socket:
dependency: transitive dependency: transitive
description: description:
name: shelf_web_socket name: shelf_web_socket
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.4+1" version: "1.0.2"
source_map_stack_trace: source_map_stack_trace:
dependency: transitive dependency: transitive
description: description:
name: source_map_stack_trace name: source_map_stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.5" version: "2.1.0"
source_maps: source_maps:
dependency: transitive dependency: transitive
description: description:
@ -322,7 +238,7 @@ packages:
name: stream_channel name: stream_channel
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.7.0" version: "2.1.1"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
@ -343,7 +259,21 @@ packages:
name: test name: test
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.4" version: "1.21.6"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.14"
test_core:
dependency: transitive
description:
name: test_core
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.18"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
@ -351,26 +281,33 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0" version: "1.3.0"
vm_service_client: vm_service:
dependency: transitive dependency: transitive
description: description:
name: vm_service_client name: vm_service
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.6+3" version: "9.4.0"
watcher: watcher:
dependency: transitive dependency: transitive
description: description:
name: watcher name: watcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.9.7+15" version: "1.0.1"
web_socket_channel: web_socket_channel:
dependency: transitive dependency: transitive
description: description:
name: web_socket_channel name: web_socket_channel
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.0"
webkit_inspection_protocol:
dependency: transitive
description:
name: webkit_inspection_protocol
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0" version: "1.2.0"
yaml: yaml:
dependency: transitive dependency: transitive
@ -378,6 +315,6 @@ packages:
name: yaml name: yaml
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.1" version: "3.1.1"
sdks: sdks:
dart: ">=2.16.0-100.0.dev <3.0.0" dart: ">=2.18.0 <3.0.0"

View File

@ -7,4 +7,4 @@ environment:
sdk: ">=2.14.0 <3.0.0" sdk: ">=2.14.0 <3.0.0"
dev_dependencies: dev_dependencies:
test: 1.3.4 test: ^1.21.6

View File

@ -11,6 +11,8 @@ import 'util.dart';
final _coreCheckerEnumSupportedPlatforms = final _coreCheckerEnumSupportedPlatforms =
const TypeChecker.fromRuntime(EnumSupportedPlatforms); const TypeChecker.fromRuntime(EnumSupportedPlatforms);
final _coreCheckerDeprecated = const TypeChecker.fromRuntime(Deprecated); final _coreCheckerDeprecated = const TypeChecker.fromRuntime(Deprecated);
final _coreCheckerEnumCustomValue =
const TypeChecker.fromRuntime(ExchangeableEnumCustomValue);
class ExchangeableEnumGenerator class ExchangeableEnumGenerator
extends GeneratorForAnnotation<ExchangeableEnum> { extends GeneratorForAnnotation<ExchangeableEnum> {
@ -21,25 +23,25 @@ class ExchangeableEnumGenerator
// Visits all the children of element in no particular order. // Visits all the children of element in no particular order.
element.visitChildren(visitor); element.visitChildren(visitor);
final className = visitor.constructor.returnType.element.name; final className = visitor.constructor.returnType.element2.name;
// remove "_" to generate the correct class name // remove "_" to generate the correct class name
final extClassName = className.replaceFirst("_", ""); final extClassName = className.replaceFirst("_", "");
final classBuffer = StringBuffer(); final classBuffer = StringBuffer();
final classDocs = final classDocs =
visitor.constructor.returnType.element.documentationComment; visitor.constructor.returnType.element2.documentationComment;
if (classDocs != null) { if (classDocs != null) {
classBuffer.writeln(classDocs); classBuffer.writeln(classDocs);
} }
final classSupportedDocs = Util.getSupportedDocs( final classSupportedDocs = Util.getSupportedDocs(
_coreCheckerEnumSupportedPlatforms, _coreCheckerEnumSupportedPlatforms,
visitor.constructor.returnType.element); visitor.constructor.returnType.element2);
if (classSupportedDocs != null) { if (classSupportedDocs != null) {
classBuffer.writeln(classSupportedDocs); classBuffer.writeln(classSupportedDocs);
} }
if (visitor.constructor.returnType.element.hasDeprecated) { if (visitor.constructor.returnType.element2.hasDeprecated) {
classBuffer.writeln( classBuffer.writeln(
"@Deprecated('${_coreCheckerDeprecated.firstAnnotationOfExact(visitor.constructor.returnType.element)?.getField("message")?.toStringValue()}')"); "@Deprecated('${_coreCheckerDeprecated.firstAnnotationOfExact(visitor.constructor.returnType.element2)?.getField("message")?.toStringValue()}')");
} }
classBuffer.writeln('class $extClassName {'); classBuffer.writeln('class $extClassName {');
@ -66,6 +68,38 @@ class ExchangeableEnumGenerator
if (fieldName == "_value" || fieldName == "_nativeValue") { if (fieldName == "_value" || fieldName == "_nativeValue") {
continue; continue;
} }
final isEnumCustomValue = _coreCheckerEnumCustomValue
.firstAnnotationOf(fieldElement) != null;
if (isEnumCustomValue) {
ParsedLibraryResult parsed = fieldElement.session
?.getParsedLibraryByElement(fieldElement.library)
as ParsedLibraryResult;
final fieldBody = parsed
.getElementDeclaration(fieldElement)
?.node
.toString()
.replaceAll(className, extClassName);
if (fieldBody != null) {
final docs = fieldElement.documentationComment;
if (docs != null) {
classBuffer.writeln(docs);
}
if (fieldElement.isStatic) {
classBuffer.write("static ");
}
if (fieldElement.isLate) {
classBuffer.write("late ");
}
if (fieldElement.isFinal) {
classBuffer.write("final ");
}
if (fieldElement.isConst) {
classBuffer.write("const ");
}
classBuffer.writeln("$fieldBody;");
}
continue;
}
final docs = fieldElement.documentationComment; final docs = fieldElement.documentationComment;
if (docs != null) { if (docs != null) {
classBuffer.writeln(docs); classBuffer.writeln(docs);
@ -145,14 +179,17 @@ class ExchangeableEnumGenerator
for (final entry in visitor.fields.entries) { for (final entry in visitor.fields.entries) {
final fieldName = entry.key; final fieldName = entry.key;
final fieldElement = entry.value; final fieldElement = entry.value;
if (!fieldElement.isPrivate && fieldElement.isStatic) { final isEnumCustomValue = _coreCheckerEnumCustomValue
.firstAnnotationOf(fieldElement) != null;
if (!fieldElement.isPrivate && fieldElement.isStatic && !isEnumCustomValue) {
classBuffer.writeln('$extClassName.$fieldName,'); classBuffer.writeln('$extClassName.$fieldName,');
} }
} }
classBuffer.writeln('].toSet();'); classBuffer.writeln('].toSet();');
} }
if (annotation.read("fromValueMethod").boolValue && !visitor.methods.containsKey("fromValue")) { if (annotation.read("fromValueMethod").boolValue && (!visitor.methods.containsKey("fromValue") ||
Util.methodHasIgnore(visitor.methods['fromNativeValue']!))) {
final hasBitwiseOrOperator = final hasBitwiseOrOperator =
annotation.read("bitwiseOrOperator").boolValue; annotation.read("bitwiseOrOperator").boolValue;
classBuffer.writeln(""" classBuffer.writeln("""
@ -171,7 +208,8 @@ class ExchangeableEnumGenerator
"""); """);
} }
if (annotation.read("fromNativeValueMethod").boolValue && !visitor.methods.containsKey("fromNativeValue")) { if (annotation.read("fromNativeValueMethod").boolValue && (!visitor.methods.containsKey("fromNativeValue") ||
Util.methodHasIgnore(visitor.methods['fromNativeValue']!))) {
final hasBitwiseOrOperator = final hasBitwiseOrOperator =
annotation.read("bitwiseOrOperator").boolValue; annotation.read("bitwiseOrOperator").boolValue;
classBuffer.writeln(""" classBuffer.writeln("""
@ -192,8 +230,13 @@ class ExchangeableEnumGenerator
for (final entry in visitor.methods.entries) { for (final entry in visitor.methods.entries) {
final methodElement = entry.value; final methodElement = entry.value;
if (Util.methodHasIgnore(methodElement)) {
continue;
}
ParsedLibraryResult parsed = methodElement.session?.getParsedLibraryByElement(methodElement.library) as ParsedLibraryResult; ParsedLibraryResult parsed = methodElement.session?.getParsedLibraryByElement(methodElement.library) as ParsedLibraryResult;
final methodBody = parsed.getElementDeclaration(methodElement)?.node; final methodBody = parsed.getElementDeclaration(methodElement)?.node
.toString()
.replaceAll(className, extClassName);
if (methodBody != null) { if (methodBody != null) {
final docs = methodElement.documentationComment; final docs = methodElement.documentationComment;
if (docs != null) { if (docs != null) {
@ -208,21 +251,24 @@ class ExchangeableEnumGenerator
} }
} }
if (annotation.read("toValueMethod").boolValue && !visitor.methods.containsKey("toValue")) { if (annotation.read("toValueMethod").boolValue && (!visitor.methods.containsKey("toValue") ||
Util.methodHasIgnore(visitor.methods['toValue']!))) {
classBuffer.writeln(""" classBuffer.writeln("""
///Gets [${enumValue.type}] value. ///Gets [${enumValue.type}] value.
${enumValue.type} toValue() => _value; ${enumValue.type} toValue() => _value;
"""); """);
} }
if (annotation.read("toNativeValueMethod").boolValue && !visitor.methods.containsKey("toNativeValue")) { if (annotation.read("toNativeValueMethod").boolValue && (!visitor.methods.containsKey("toNativeValue") ||
Util.methodHasIgnore(visitor.methods['toNativeValue']!))) {
classBuffer.writeln(""" classBuffer.writeln("""
///Gets [${enumNativeValue.type}] native value. ///Gets [${enumNativeValue.type}] native value.
${enumNativeValue.type} toNativeValue() => _nativeValue; ${enumNativeValue.type} toNativeValue() => _nativeValue;
"""); """);
} }
if (annotation.read("hashCodeMethod").boolValue && !visitor.fields.containsKey("hashCode")) { if (annotation.read("hashCodeMethod").boolValue && (!visitor.fields.containsKey("hashCode") ||
Util.methodHasIgnore(visitor.methods['hashCode']!))) {
classBuffer.writeln(""" classBuffer.writeln("""
@override @override
int get hashCode => _value.hashCode; int get hashCode => _value.hashCode;
@ -241,7 +287,8 @@ class ExchangeableEnumGenerator
"$extClassName operator |($extClassName value) => $extClassName._internal(value.toValue() | _value, value.toNativeValue() | _nativeValue);"); "$extClassName operator |($extClassName value) => $extClassName._internal(value.toValue() | _value, value.toNativeValue() | _nativeValue);");
} }
if (annotation.read("toStringMethod").boolValue && !visitor.methods.containsKey("toString")) { if (annotation.read("toStringMethod").boolValue && (!visitor.methods.containsKey("toString") ||
Util.methodHasIgnore(visitor.methods['toString']!))) {
classBuffer.writeln('@override'); classBuffer.writeln('@override');
classBuffer.writeln('String toString() {'); classBuffer.writeln('String toString() {');
if (enumValue.type.isDartCoreString) { if (enumValue.type.isDartCoreString) {

View File

@ -13,6 +13,8 @@ final _coreCheckerObjectConstructor =
const TypeChecker.fromRuntime(ExchangeableObjectConstructor); const TypeChecker.fromRuntime(ExchangeableObjectConstructor);
final _coreCheckerObjectProperty = final _coreCheckerObjectProperty =
const TypeChecker.fromRuntime(ExchangeableObjectProperty); const TypeChecker.fromRuntime(ExchangeableObjectProperty);
final _coreCheckerObjectMethod =
const TypeChecker.fromRuntime(ExchangeableObjectMethod);
final _coreCheckerEnum = const TypeChecker.fromRuntime(ExchangeableEnum); final _coreCheckerEnum = const TypeChecker.fromRuntime(ExchangeableEnum);
final _coreCheckerDeprecated = const TypeChecker.fromRuntime(Deprecated); final _coreCheckerDeprecated = const TypeChecker.fromRuntime(Deprecated);
final _coreCheckerSupportedPlatforms = final _coreCheckerSupportedPlatforms =
@ -27,32 +29,36 @@ class ExchangeableObjectGenerator
// Visits all the children of element in no particular order. // Visits all the children of element in no particular order.
element.visitChildren(visitor); element.visitChildren(visitor);
final className = visitor.constructor.returnType.element.name; final className = visitor.constructor.returnType.element2.name;
final superClass = final superClass =
visitor.constructor.returnType.superclass?.element.name != 'Object' visitor.constructor.returnType.superclass?.element2.name != 'Object'
? visitor.constructor.returnType.superclass ? visitor.constructor.returnType.superclass
: null; : null;
final superClassName = superClass?.element.name.replaceFirst("_", ""); final interfaces = visitor.constructor.returnType.interfaces;
final superClassName = superClass?.element2.name.replaceFirst("_", "");
// remove "_" to generate the correct class name // remove "_" to generate the correct class name
final extClassName = className.replaceFirst("_", ""); final extClassName = className.replaceFirst("_", "");
final classBuffer = StringBuffer(); final classBuffer = StringBuffer();
final classDocs = final classDocs =
visitor.constructor.returnType.element.documentationComment; visitor.constructor.returnType.element2.documentationComment;
if (classDocs != null) { if (classDocs != null) {
classBuffer.writeln(classDocs); classBuffer.writeln(classDocs);
} }
final classSupportedDocs = Util.getSupportedDocs( final classSupportedDocs = Util.getSupportedDocs(
_coreCheckerSupportedPlatforms, visitor.constructor.returnType.element); _coreCheckerSupportedPlatforms, visitor.constructor.returnType.element2);
if (classSupportedDocs != null) { if (classSupportedDocs != null) {
classBuffer.writeln(classSupportedDocs); classBuffer.writeln(classSupportedDocs);
} }
if (visitor.constructor.returnType.element.hasDeprecated) { if (visitor.constructor.returnType.element2.hasDeprecated) {
classBuffer.writeln( classBuffer.writeln(
"@Deprecated('${_coreCheckerDeprecated.firstAnnotationOfExact(visitor.constructor.returnType.element)?.getField("message")?.toStringValue()}')"); "@Deprecated('${_coreCheckerDeprecated.firstAnnotationOfExact(visitor.constructor.returnType.element2)?.getField("message")?.toStringValue()}')");
} }
classBuffer.write('class $extClassName'); classBuffer.write('${(visitor.constructor.enclosingElement3 as ClassElement).isAbstract ? 'abstract ' : ''}class $extClassName');
if (interfaces.isNotEmpty) {
classBuffer.writeln(' implements ${interfaces.map((i) => i.element2.name.replaceFirst("_", "")).join(', ')}');
}
if (superClass != null) { if (superClass != null) {
classBuffer.writeln(' extends ${superClassName}'); classBuffer.writeln(' extends ${superClassName}');
} }
@ -98,6 +104,9 @@ class ExchangeableObjectGenerator
if (fieldElement.isStatic) { if (fieldElement.isStatic) {
classBuffer.write("static "); classBuffer.write("static ");
} }
if (fieldElement.isLate) {
classBuffer.write("late ");
}
if (fieldElement.isFinal) { if (fieldElement.isFinal) {
classBuffer.write("final "); classBuffer.write("final ");
} }
@ -155,7 +164,7 @@ class ExchangeableObjectGenerator
if (constructorSupportedDocs == null) { if (constructorSupportedDocs == null) {
constructorSupportedDocs = Util.getSupportedDocs( constructorSupportedDocs = Util.getSupportedDocs(
_coreCheckerSupportedPlatforms, _coreCheckerSupportedPlatforms,
visitor.constructor.returnType.element); visitor.constructor.returnType.element2);
} }
if (constructorSupportedDocs != null) { if (constructorSupportedDocs != null) {
classBuffer.writeln(constructorSupportedDocs); classBuffer.writeln(constructorSupportedDocs);
@ -214,12 +223,17 @@ class ExchangeableObjectGenerator
.trim(); .trim();
final fieldElement = visitor.fields[fieldName]; final fieldElement = visitor.fields[fieldName];
if (fieldElement != null) { if (fieldElement != null) {
final fieldTypeElement = fieldElement.type.element; final fieldTypeElement = fieldElement.type.element2;
final deprecatedFieldTypeElement = deprecatedField.type.element; final deprecatedFieldTypeElement = deprecatedField.type.element2;
final isNullable = Util.typeIsNullable(fieldElement.type);
var hasDefaultValue = (fieldElement is ParameterElement) ? (fieldElement as ParameterElement).hasDefaultValue : false;
if (!isNullable && hasDefaultValue) {
continue;
}
classBuffer.write('$fieldName = $fieldName ?? '); classBuffer.write('$fieldName = $fieldName ?? ');
if (fieldTypeElement != null && deprecatedFieldTypeElement != null) { if (fieldTypeElement != null && deprecatedFieldTypeElement != null) {
final isNullable = Util.typeIsNullable(fieldElement.type);
final deprecatedIsNullable = final deprecatedIsNullable =
Util.typeIsNullable(deprecatedField.type); Util.typeIsNullable(deprecatedField.type);
final hasFromMap = hasFromMapMethod(fieldTypeElement); final hasFromMap = hasFromMapMethod(fieldTypeElement);
@ -257,8 +271,8 @@ class ExchangeableObjectGenerator
classBuffer.writeln(';'); classBuffer.writeln(';');
} }
if (annotation.read("fromMapFactory").boolValue && if (annotation.read("fromMapFactory").boolValue && (!visitor.methods.containsKey("fromMap") ||
!visitor.methods.containsKey("fromMap")) { Util.methodHasIgnore(visitor.methods['fromMap']!))) {
classBuffer.writeln( classBuffer.writeln(
'///Gets a possible [$extClassName] instance from a [Map] value.'); '///Gets a possible [$extClassName] instance from a [Map] value.');
final nullable = annotation.read("nullableFromMapFactory").boolValue; final nullable = annotation.read("nullableFromMapFactory").boolValue;
@ -272,7 +286,7 @@ class ExchangeableObjectGenerator
classBuffer.writeln('final instance = $extClassName('); classBuffer.writeln('final instance = $extClassName(');
final fieldElements = <FieldElement>[]; final fieldElements = <FieldElement>[];
if (superClass != null) { if (superClass != null) {
fieldElements.addAll(superClass.element.fields); fieldElements.addAll(superClass.element2.fields);
} }
fieldElements.addAll(visitor.fields.values); fieldElements.addAll(visitor.fields.values);
final nonRequiredFields = <String>[]; final nonRequiredFields = <String>[];
@ -301,7 +315,7 @@ class ExchangeableObjectGenerator
?.toFunctionValue(); ?.toFunctionValue();
if (customDeserializer != null) { if (customDeserializer != null) {
final deserializerClassName = final deserializerClassName =
customDeserializer.enclosingElement.name; customDeserializer.enclosingElement3.name;
if (deserializerClassName != null) { if (deserializerClassName != null) {
value = value =
"$deserializerClassName.${customDeserializer.name}($value)"; "$deserializerClassName.${customDeserializer.name}($value)";
@ -334,6 +348,9 @@ class ExchangeableObjectGenerator
for (final entry in visitor.methods.entries) { for (final entry in visitor.methods.entries) {
final methodElement = entry.value; final methodElement = entry.value;
if (Util.methodHasIgnore(methodElement)) {
continue;
}
ParsedLibraryResult parsed = methodElement.session ParsedLibraryResult parsed = methodElement.session
?.getParsedLibraryByElement(methodElement.library) ?.getParsedLibraryByElement(methodElement.library)
as ParsedLibraryResult; as ParsedLibraryResult;
@ -353,14 +370,24 @@ class ExchangeableObjectGenerator
} }
} }
if (annotation.read("toMapMethod").boolValue && if (annotation.read("toMapMethod").boolValue && (!visitor.methods.containsKey("toMap") ||
!visitor.methods.containsKey("toMap")) { Util.methodHasIgnore(visitor.methods['toMap']!))) {
classBuffer.writeln('///Converts instance to a map.'); classBuffer.writeln('///Converts instance to a map.');
classBuffer.writeln('Map<String, dynamic> toMap() {'); classBuffer.writeln('Map<String, dynamic> toMap() {');
classBuffer.writeln('return {'); classBuffer.writeln('return {');
for (final entry in visitor.methods.entries) {
final methodElement = entry.value;
final toMapMergeWith = _coreCheckerObjectMethod
.firstAnnotationOf(methodElement)
?.getField("toMapMergeWith")
?.toBoolValue();
if (toMapMergeWith == true) {
classBuffer.writeln('...${methodElement.name}(),');
}
}
final fieldElements = <FieldElement>[]; final fieldElements = <FieldElement>[];
if (superClass != null) { if (superClass != null) {
for (final fieldElement in superClass.element.fields) { for (final fieldElement in superClass.element2.fields) {
if (!fieldElement.isPrivate && if (!fieldElement.isPrivate &&
!fieldElement.hasDeprecated && !fieldElement.hasDeprecated &&
!fieldElement.isStatic && !fieldElement.isStatic &&
@ -390,7 +417,7 @@ class ExchangeableObjectGenerator
?.getField("serializer") ?.getField("serializer")
?.toFunctionValue(); ?.toFunctionValue();
if (customSerializer != null) { if (customSerializer != null) {
final serializerClassName = customSerializer.enclosingElement.name; final serializerClassName = customSerializer.enclosingElement3.name;
if (serializerClassName != null) { if (serializerClassName != null) {
mapValue = mapValue =
"$serializerClassName.${customSerializer.name}($mapValue)"; "$serializerClassName.${customSerializer.name}($mapValue)";
@ -408,22 +435,22 @@ class ExchangeableObjectGenerator
classBuffer.writeln('}'); classBuffer.writeln('}');
} }
if (annotation.read("toJsonMethod").boolValue && if (annotation.read("toJsonMethod").boolValue && (!visitor.methods.containsKey("toJson") ||
!visitor.methods.containsKey("toJson")) { Util.methodHasIgnore(visitor.methods['toJson']!))) {
classBuffer.writeln('///Converts instance to a map.'); classBuffer.writeln('///Converts instance to a map.');
classBuffer.writeln('Map<String, dynamic> toJson() {'); classBuffer.writeln('Map<String, dynamic> toJson() {');
classBuffer.writeln('return toMap();'); classBuffer.writeln('return toMap();');
classBuffer.writeln('}'); classBuffer.writeln('}');
} }
if (annotation.read("toStringMethod").boolValue && if (annotation.read("toStringMethod").boolValue && (!visitor.methods.containsKey("toString") ||
!visitor.methods.containsKey("toString")) { Util.methodHasIgnore(visitor.methods['toString']!))) {
classBuffer.writeln('@override'); classBuffer.writeln('@override');
classBuffer.writeln('String toString() {'); classBuffer.writeln('String toString() {');
classBuffer.write('return \'$extClassName{'); classBuffer.write('return \'$extClassName{');
final fieldNames = <String>[]; final fieldNames = <String>[];
if (superClass != null) { if (superClass != null) {
for (final fieldElement in superClass.element.fields) { for (final fieldElement in superClass.element2.fields) {
final fieldName = fieldElement.name; final fieldName = fieldElement.name;
if (!fieldElement.isPrivate && if (!fieldElement.isPrivate &&
!fieldElement.hasDeprecated && !fieldElement.hasDeprecated &&
@ -453,7 +480,7 @@ class ExchangeableObjectGenerator
} }
String getFromMapValue(String value, DartType elementType) { String getFromMapValue(String value, DartType elementType) {
final fieldTypeElement = elementType.element; final fieldTypeElement = elementType.element2;
final isNullable = Util.typeIsNullable(elementType); final isNullable = Util.typeIsNullable(elementType);
if (elementType.getDisplayString(withNullability: false) == "Uri") { if (elementType.getDisplayString(withNullability: false) == "Uri") {
if (!isNullable) { if (!isNullable) {
@ -486,9 +513,9 @@ class ExchangeableObjectGenerator
final genericTypeFieldName = 'e'; final genericTypeFieldName = 'e';
return value + return value +
(isNullable ? '?' : '') + (isNullable ? '?' : '') +
'.forEach(($genericTypeFieldName) => ' + '.map(($genericTypeFieldName) => ' +
getFromMapValue('$genericTypeFieldName', genericType) + getFromMapValue('$genericTypeFieldName', genericType) +
')'; ')${elementType.isDartCoreSet ? '.toSet()' : ''}';
} else { } else {
return value; return value;
} }
@ -523,7 +550,7 @@ class ExchangeableObjectGenerator
} }
String getToMapValue(String fieldName, DartType elementType) { String getToMapValue(String fieldName, DartType elementType) {
final fieldTypeElement = elementType.element; final fieldTypeElement = elementType.element2;
final isNullable = Util.typeIsNullable(elementType); final isNullable = Util.typeIsNullable(elementType);
if (elementType.getDisplayString(withNullability: false) == "Uri") { if (elementType.getDisplayString(withNullability: false) == "Uri") {
return fieldName + (isNullable ? '?' : '') + '.toString()'; return fieldName + (isNullable ? '?' : '') + '.toString()';

View File

@ -3,6 +3,10 @@ import 'package:source_gen/source_gen.dart';
import 'package:analyzer/dart/element/type.dart'; import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/dart/element/nullability_suffix.dart'; import 'package:analyzer/dart/element/nullability_suffix.dart';
import 'package:analyzer/dart/constant/value.dart'; import 'package:analyzer/dart/constant/value.dart';
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
final _coreCheckerObjectMethod =
const TypeChecker.fromRuntime(ExchangeableObjectMethod);
abstract class Util { abstract class Util {
static bool typeIsNullable(DartType type) { static bool typeIsNullable(DartType type) {
@ -10,6 +14,14 @@ abstract class Util {
type.toString() == 'dynamic'; type.toString() == 'dynamic';
} }
static bool methodHasIgnore(MethodElement method) {
return _coreCheckerObjectMethod
.firstAnnotationOf(method)
?.getField("ignore")
?.toBoolValue() ==
true;
}
static String? getSupportedDocs(TypeChecker checker, Element element) { static String? getSupportedDocs(TypeChecker checker, Element element) {
final platformNoteList = <String>[]; final platformNoteList = <String>[];
final platformSupportedList = <String>[]; final platformSupportedList = <String>[];
@ -64,7 +76,7 @@ abstract class Util {
} }
static bool canHaveGenerics(DartType type) { static bool canHaveGenerics(DartType type) {
final element = type.element; final element = type.element2;
if (element is ClassElement) { if (element is ClassElement) {
return element.typeParameters.isNotEmpty; return element.typeParameters.isNotEmpty;
} }

View File

@ -7,14 +7,14 @@ packages:
name: _fe_analyzer_shared name: _fe_analyzer_shared
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "39.0.0" version: "49.0.0"
analyzer: analyzer:
dependency: transitive dependency: transitive
description: description:
name: analyzer name: analyzer
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.0.0" version: "5.1.0"
args: args:
dependency: transitive dependency: transitive
description: description:
@ -42,14 +42,14 @@ packages:
name: build name: build
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.3.0" version: "2.3.1"
build_config: build_config:
dependency: transitive dependency: transitive
description: description:
name: build_config name: build_config
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0" version: "1.1.0"
build_daemon: build_daemon:
dependency: transitive dependency: transitive
description: description:
@ -63,21 +63,21 @@ packages:
name: build_resolvers name: build_resolvers
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.8" version: "2.0.10"
build_runner: build_runner:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: build_runner name: build_runner
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.10" version: "2.2.1"
build_runner_core: build_runner_core:
dependency: transitive dependency: transitive
description: description:
name: build_runner_core name: build_runner_core
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "7.2.3" version: "7.2.4"
build_test: build_test:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -98,21 +98,14 @@ packages:
name: built_value name: built_value
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "8.3.0" version: "8.4.1"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.2.1"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
checked_yaml: checked_yaml:
dependency: transitive dependency: transitive
description: description:
@ -126,28 +119,28 @@ packages:
name: code_builder name: code_builder
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.1.0" version: "4.3.0"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.15.0" version: "1.16.0"
convert: convert:
dependency: transitive dependency: transitive
description: description:
name: convert name: convert
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.1" version: "3.0.2"
coverage: coverage:
dependency: transitive dependency: transitive
description: description:
name: coverage name: coverage
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.1" version: "1.6.1"
crypto: crypto:
dependency: transitive dependency: transitive
description: description:
@ -161,21 +154,21 @@ packages:
name: csslib name: csslib
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.17.1" version: "0.17.2"
dart_style: dart_style:
dependency: transitive dependency: transitive
description: description:
name: dart_style name: dart_style
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.3" version: "2.2.4"
file: file:
dependency: transitive dependency: transitive
description: description:
name: file name: file
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.1.2" version: "6.1.4"
fixnum: fixnum:
dependency: transitive dependency: transitive
description: description:
@ -201,14 +194,14 @@ packages:
name: frontend_server_client name: frontend_server_client
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.2" version: "2.1.3"
glob: glob:
dependency: transitive dependency: transitive
description: description:
name: glob name: glob
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.2" version: "2.1.0"
graphs: graphs:
dependency: transitive dependency: transitive
description: description:
@ -229,14 +222,14 @@ packages:
name: http_multi_server name: http_multi_server
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.2.0" version: "3.2.1"
http_parser: http_parser:
dependency: transitive dependency: transitive
description: description:
name: http_parser name: http_parser
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.0.0" version: "4.0.1"
io: io:
dependency: transitive dependency: transitive
description: description:
@ -257,7 +250,7 @@ packages:
name: json_annotation name: json_annotation
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.5.0" version: "4.7.0"
logging: logging:
dependency: transitive dependency: transitive
description: description:
@ -271,21 +264,21 @@ packages:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.12.11" version: "0.12.12"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.3" version: "0.1.5"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.7.0" version: "1.8.0"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -306,21 +299,21 @@ packages:
name: package_config name: package_config
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.2" version: "2.1.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.1" version: "1.8.2"
pool: pool:
dependency: transitive dependency: transitive
description: description:
name: pool name: pool
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.5.0" version: "1.5.1"
pub_semver: pub_semver:
dependency: transitive dependency: transitive
description: description:
@ -334,35 +327,35 @@ packages:
name: pubspec_parse name: pubspec_parse
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.2.1"
shelf: shelf:
dependency: transitive dependency: transitive
description: description:
name: shelf name: shelf
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0" version: "1.4.0"
shelf_packages_handler: shelf_packages_handler:
dependency: transitive dependency: transitive
description: description:
name: shelf_packages_handler name: shelf_packages_handler
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.0" version: "3.0.1"
shelf_static: shelf_static:
dependency: transitive dependency: transitive
description: description:
name: shelf_static name: shelf_static
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" version: "1.1.1"
shelf_web_socket: shelf_web_socket:
dependency: transitive dependency: transitive
description: description:
name: shelf_web_socket name: shelf_web_socket
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.1" version: "1.0.2"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@ -374,7 +367,7 @@ packages:
name: source_gen name: source_gen
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.2" version: "1.2.5"
source_map_stack_trace: source_map_stack_trace:
dependency: transitive dependency: transitive
description: description:
@ -395,7 +388,7 @@ packages:
name: source_span name: source_span
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.9.0" version: "1.9.1"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
@ -409,7 +402,7 @@ packages:
name: stream_channel name: stream_channel
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0" version: "2.1.1"
stream_transform: stream_transform:
dependency: transitive dependency: transitive
description: description:
@ -430,28 +423,28 @@ packages:
name: term_glyph name: term_glyph
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.2.1"
test: test:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: test name: test
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.21.1" version: "1.21.6"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.4.9" version: "0.4.14"
test_core: test_core:
dependency: transitive dependency: transitive
description: description:
name: test_core name: test_core
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.4.13" version: "0.4.18"
timing: timing:
dependency: transitive dependency: transitive
description: description:
@ -465,21 +458,21 @@ packages:
name: typed_data name: typed_data
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0" version: "1.3.1"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.1" version: "2.1.2"
vm_service: vm_service:
dependency: transitive dependency: transitive
description: description:
name: vm_service name: vm_service
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "8.3.0" version: "9.4.0"
watcher: watcher:
dependency: transitive dependency: transitive
description: description:
@ -500,7 +493,7 @@ packages:
name: webkit_inspection_protocol name: webkit_inspection_protocol
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.1" version: "1.2.0"
yaml: yaml:
dependency: transitive dependency: transitive
description: description:
@ -509,5 +502,5 @@ packages:
source: hosted source: hosted
version: "3.1.1" version: "3.1.1"
sdks: sdks:
dart: ">=2.16.0 <3.0.0" dart: ">=2.18.0 <3.0.0"
flutter: ">=2.5.0" flutter: ">=2.5.0"

View File

@ -10,12 +10,12 @@ environment:
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
build: build: ^2.3.1
source_gen: source_gen: ^1.2.5
flutter_inappwebview_internal_annotations: flutter_inappwebview_internal_annotations:
path: ../flutter_inappwebview_internal_annotations/ path: ../flutter_inappwebview_internal_annotations/
dev_dependencies: dev_dependencies:
build_runner: build_runner: ^2.2.1
build_test: build_test: ^2.1.5
test: ^1.21.1 test: ^1.21.1

View File

@ -7,14 +7,14 @@ packages:
name: _fe_analyzer_shared name: _fe_analyzer_shared
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "39.0.0" version: "49.0.0"
analyzer: analyzer:
dependency: transitive dependency: transitive
description: description:
name: analyzer name: analyzer
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.0.0" version: "5.1.0"
args: args:
dependency: transitive dependency: transitive
description: description:
@ -35,14 +35,14 @@ packages:
name: build name: build
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.3.0" version: "2.3.1"
build_config: build_config:
dependency: transitive dependency: transitive
description: description:
name: build_config name: build_config
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0" version: "1.1.0"
build_daemon: build_daemon:
dependency: transitive dependency: transitive
description: description:
@ -56,21 +56,21 @@ packages:
name: build_resolvers name: build_resolvers
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.8" version: "2.0.10"
build_runner: build_runner:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: build_runner name: build_runner
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.10" version: "2.2.1"
build_runner_core: build_runner_core:
dependency: transitive dependency: transitive
description: description:
name: build_runner_core name: build_runner_core
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "7.2.3" version: "7.2.4"
built_collection: built_collection:
dependency: transitive dependency: transitive
description: description:
@ -84,21 +84,14 @@ packages:
name: built_value name: built_value
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "8.3.0" version: "8.4.1"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.2.1"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
checked_yaml: checked_yaml:
dependency: transitive dependency: transitive
description: description:
@ -112,21 +105,21 @@ packages:
name: code_builder name: code_builder
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.1.0" version: "4.3.0"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.15.0" version: "1.16.0"
convert: convert:
dependency: transitive dependency: transitive
description: description:
name: convert name: convert
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.1" version: "3.0.2"
crypto: crypto:
dependency: transitive dependency: transitive
description: description:
@ -140,14 +133,14 @@ packages:
name: dart_style name: dart_style
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.3" version: "2.2.4"
file: file:
dependency: transitive dependency: transitive
description: description:
name: file name: file
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.1.2" version: "6.1.4"
fixnum: fixnum:
dependency: transitive dependency: transitive
description: description:
@ -173,7 +166,7 @@ packages:
name: frontend_server_client name: frontend_server_client
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.2" version: "2.1.3"
generators: generators:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -187,7 +180,7 @@ packages:
name: glob name: glob
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.2" version: "2.1.0"
graphs: graphs:
dependency: transitive dependency: transitive
description: description:
@ -201,14 +194,14 @@ packages:
name: http_multi_server name: http_multi_server
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.2.0" version: "3.2.1"
http_parser: http_parser:
dependency: transitive dependency: transitive
description: description:
name: http_parser name: http_parser
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.0.0" version: "4.0.1"
io: io:
dependency: transitive dependency: transitive
description: description:
@ -229,7 +222,7 @@ packages:
name: json_annotation name: json_annotation
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.5.0" version: "4.7.0"
lints: lints:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -250,21 +243,21 @@ packages:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.12.11" version: "0.12.12"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.3" version: "0.1.5"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.7.0" version: "1.8.0"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -278,21 +271,21 @@ packages:
name: package_config name: package_config
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.2" version: "2.1.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.1" version: "1.8.2"
pool: pool:
dependency: transitive dependency: transitive
description: description:
name: pool name: pool
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.5.0" version: "1.5.1"
pub_semver: pub_semver:
dependency: transitive dependency: transitive
description: description:
@ -306,21 +299,21 @@ packages:
name: pubspec_parse name: pubspec_parse
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.2.1"
shelf: shelf:
dependency: transitive dependency: transitive
description: description:
name: shelf name: shelf
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0" version: "1.4.0"
shelf_web_socket: shelf_web_socket:
dependency: transitive dependency: transitive
description: description:
name: shelf_web_socket name: shelf_web_socket
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.1" version: "1.0.2"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@ -332,14 +325,14 @@ packages:
name: source_gen name: source_gen
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.2" version: "1.2.5"
source_span: source_span:
dependency: transitive dependency: transitive
description: description:
name: source_span name: source_span
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.9.0" version: "1.9.1"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
@ -353,7 +346,7 @@ packages:
name: stream_channel name: stream_channel
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0" version: "2.1.1"
stream_transform: stream_transform:
dependency: transitive dependency: transitive
description: description:
@ -374,7 +367,7 @@ packages:
name: term_glyph name: term_glyph
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.2.1"
timing: timing:
dependency: transitive dependency: transitive
description: description:
@ -388,14 +381,14 @@ packages:
name: typed_data name: typed_data
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0" version: "1.3.1"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.1" version: "2.1.2"
watcher: watcher:
dependency: transitive dependency: transitive
description: description:
@ -418,5 +411,5 @@ packages:
source: hosted source: hosted
version: "3.1.1" version: "3.1.1"
sdks: sdks:
dart: ">=2.16.0 <3.0.0" dart: ">=2.17.0 <3.0.0"
flutter: ">=2.5.0" flutter: ">=2.5.0"

View File

@ -14,7 +14,7 @@ dependencies:
path: ../flutter_inappwebview_internal_annotations/ path: ../flutter_inappwebview_internal_annotations/
dev_dependencies: dev_dependencies:
build_runner: build_runner: ^2.2.1
generators: generators:
path: ../generators/ path: ../generators/
lints: ^1.0.1 lints: ^1.0.1

Binary file not shown.

View File

@ -1007,7 +1007,7 @@ public class WebViewChannelDelegate : ChannelDelegate {
override init() { override init() {
super.init() super.init()
self.decodeResult = { (obj: Any?) in self.decodeResult = { (obj: Any?) in
if let obj = obj as? [String: Any?], let action = obj["action"] as? Int { if let action = obj as? Int {
return action == 1 return action == 1
} }
return false return false

View File

@ -1,3 +1,3 @@
export 'service_worker_controller.dart'; export 'service_worker_controller.dart';
export 'webview_feature.dart'; export 'webview_feature.dart' show WebViewFeature, AndroidWebViewFeature;
export 'proxy_controller.dart'; export 'proxy_controller.dart';

View File

@ -1,255 +1,198 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../in_app_webview/in_app_webview_controller.dart'; import '../in_app_webview/in_app_webview_controller.dart';
import '../in_app_webview/in_app_webview_settings.dart'; import '../in_app_webview/in_app_webview_settings.dart';
import 'proxy_controller.dart'; import 'proxy_controller.dart';
import 'service_worker_controller.dart'; import 'service_worker_controller.dart';
import '../web_message/main.dart'; import '../web_message/main.dart';
part 'webview_feature.g.dart';
///Class that represents an Android-specific utility class for checking which WebView Support Library features are supported on the device. ///Class that represents an Android-specific utility class for checking which WebView Support Library features are supported on the device.
class WebViewFeature { @ExchangeableEnum()
class WebViewFeature_ {
@ExchangeableEnumCustomValue()
static const MethodChannel _channel = const MethodChannel( static const MethodChannel _channel = const MethodChannel(
'com.pichillilorenzo/flutter_inappwebview_webviewfeature'); 'com.pichillilorenzo/flutter_inappwebview_webviewfeature');
// ignore: unused_field
final String _value; final String _value;
const WebViewFeature_._internal(this._value);
const WebViewFeature._internal(this._value); @ExchangeableObjectMethod(ignore: true)
static final Set<WebViewFeature> values = [
WebViewFeature.CREATE_WEB_MESSAGE_CHANNEL,
WebViewFeature.DISABLED_ACTION_MODE_MENU_ITEMS,
WebViewFeature.FORCE_DARK,
WebViewFeature.FORCE_DARK_STRATEGY,
WebViewFeature.GET_WEB_CHROME_CLIENT,
WebViewFeature.GET_WEB_VIEW_CLIENT,
WebViewFeature.GET_WEB_VIEW_RENDERER,
WebViewFeature.MULTI_PROCESS,
WebViewFeature.OFF_SCREEN_PRERASTER,
WebViewFeature.POST_WEB_MESSAGE,
WebViewFeature.PROXY_OVERRIDE,
WebViewFeature.RECEIVE_HTTP_ERROR,
WebViewFeature.RECEIVE_WEB_RESOURCE_ERROR,
WebViewFeature.SAFE_BROWSING_ALLOWLIST,
WebViewFeature.SAFE_BROWSING_ENABLE,
WebViewFeature.SAFE_BROWSING_HIT,
WebViewFeature.SAFE_BROWSING_PRIVACY_POLICY_URL,
WebViewFeature.SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY,
WebViewFeature.SAFE_BROWSING_RESPONSE_PROCEED,
WebViewFeature.SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL,
WebViewFeature.SERVICE_WORKER_BASIC_USAGE,
WebViewFeature.SERVICE_WORKER_BLOCK_NETWORK_LOADS,
WebViewFeature.SERVICE_WORKER_CACHE_MODE,
WebViewFeature.SERVICE_WORKER_CONTENT_ACCESS,
WebViewFeature.SERVICE_WORKER_FILE_ACCESS,
WebViewFeature.SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST,
WebViewFeature.SHOULD_OVERRIDE_WITH_REDIRECTS,
WebViewFeature.START_SAFE_BROWSING,
WebViewFeature.TRACING_CONTROLLER_BASIC_USAGE,
WebViewFeature.VISUAL_STATE_CALLBACK,
WebViewFeature.WEB_MESSAGE_CALLBACK_ON_MESSAGE,
WebViewFeature.WEB_MESSAGE_LISTENER,
WebViewFeature.WEB_MESSAGE_PORT_CLOSE,
WebViewFeature.WEB_MESSAGE_PORT_POST_MESSAGE,
WebViewFeature.WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK,
WebViewFeature.WEB_RESOURCE_ERROR_GET_CODE,
WebViewFeature.WEB_RESOURCE_ERROR_GET_DESCRIPTION,
WebViewFeature.WEB_RESOURCE_REQUEST_IS_REDIRECT,
WebViewFeature.WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE,
WebViewFeature.WEB_VIEW_RENDERER_TERMINATE,
].toSet();
static WebViewFeature? fromValue(String? value) {
if (value != null) {
try {
return WebViewFeature.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
String toValue() => _value; String toValue() => _value;
@override
String toString() => _value;
///This feature covers [InAppWebViewController.createWebMessageChannel]. ///This feature covers [InAppWebViewController.createWebMessageChannel].
static const CREATE_WEB_MESSAGE_CHANNEL = static const CREATE_WEB_MESSAGE_CHANNEL =
const WebViewFeature._internal("CREATE_WEB_MESSAGE_CHANNEL"); const WebViewFeature_._internal("CREATE_WEB_MESSAGE_CHANNEL");
///This feature covers [InAppWebViewSettings.disabledActionModeMenuItems]. ///This feature covers [InAppWebViewSettings.disabledActionModeMenuItems].
static const DISABLED_ACTION_MODE_MENU_ITEMS = static const DISABLED_ACTION_MODE_MENU_ITEMS =
const WebViewFeature._internal("DISABLED_ACTION_MODE_MENU_ITEMS"); const WebViewFeature_._internal("DISABLED_ACTION_MODE_MENU_ITEMS");
///This feature covers [InAppWebViewSettings.forceDark]. ///This feature covers [InAppWebViewSettings.forceDark].
static const FORCE_DARK = const WebViewFeature._internal("FORCE_DARK"); static const FORCE_DARK = const WebViewFeature_._internal("FORCE_DARK");
///This feature covers [InAppWebViewSettings.forceDarkStrategy]. ///This feature covers [InAppWebViewSettings.forceDarkStrategy].
static const FORCE_DARK_STRATEGY = static const FORCE_DARK_STRATEGY =
const WebViewFeature._internal("FORCE_DARK_STRATEGY"); const WebViewFeature_._internal("FORCE_DARK_STRATEGY");
/// ///
static const GET_WEB_CHROME_CLIENT = static const GET_WEB_CHROME_CLIENT =
const WebViewFeature._internal("GET_WEB_CHROME_CLIENT"); const WebViewFeature_._internal("GET_WEB_CHROME_CLIENT");
/// ///
static const GET_WEB_VIEW_CLIENT = static const GET_WEB_VIEW_CLIENT =
const WebViewFeature._internal("GET_WEB_VIEW_CLIENT"); const WebViewFeature_._internal("GET_WEB_VIEW_CLIENT");
/// ///
static const GET_WEB_VIEW_RENDERER = static const GET_WEB_VIEW_RENDERER =
const WebViewFeature._internal("GET_WEB_VIEW_RENDERER"); const WebViewFeature_._internal("GET_WEB_VIEW_RENDERER");
/// ///
static const MULTI_PROCESS = const WebViewFeature._internal("MULTI_PROCESS"); static const MULTI_PROCESS = const WebViewFeature_._internal("MULTI_PROCESS");
///This feature covers [InAppWebViewSettings.offscreenPreRaster]. ///This feature covers [InAppWebViewSettings.offscreenPreRaster].
static const OFF_SCREEN_PRERASTER = static const OFF_SCREEN_PRERASTER =
const WebViewFeature._internal("OFF_SCREEN_PRERASTER"); const WebViewFeature_._internal("OFF_SCREEN_PRERASTER");
///This feature covers [InAppWebViewController.postWebMessage]. ///This feature covers [InAppWebViewController.postWebMessage].
static const POST_WEB_MESSAGE = static const POST_WEB_MESSAGE =
const WebViewFeature._internal("POST_WEB_MESSAGE"); const WebViewFeature_._internal("POST_WEB_MESSAGE");
///This feature covers [ProxyController.setProxyOverride] and [ProxyController.clearProxyOverride]. ///This feature covers [ProxyController.setProxyOverride] and [ProxyController.clearProxyOverride].
static const PROXY_OVERRIDE = static const PROXY_OVERRIDE =
const WebViewFeature._internal("PROXY_OVERRIDE"); const WebViewFeature_._internal("PROXY_OVERRIDE");
/// ///
static const RECEIVE_HTTP_ERROR = static const RECEIVE_HTTP_ERROR =
const WebViewFeature._internal("RECEIVE_HTTP_ERROR"); const WebViewFeature_._internal("RECEIVE_HTTP_ERROR");
/// ///
static const RECEIVE_WEB_RESOURCE_ERROR = static const RECEIVE_WEB_RESOURCE_ERROR =
const WebViewFeature._internal("RECEIVE_WEB_RESOURCE_ERROR"); const WebViewFeature_._internal("RECEIVE_WEB_RESOURCE_ERROR");
///This feature covers [InAppWebViewController.setSafeBrowsingAllowlist]. ///This feature covers [InAppWebViewController.setSafeBrowsingAllowlist].
static const SAFE_BROWSING_ALLOWLIST = static const SAFE_BROWSING_ALLOWLIST =
const WebViewFeature._internal("SAFE_BROWSING_ALLOWLIST"); const WebViewFeature_._internal("SAFE_BROWSING_ALLOWLIST");
///This feature covers [InAppWebViewSettings.safeBrowsingEnabled]. ///This feature covers [InAppWebViewSettings.safeBrowsingEnabled].
static const SAFE_BROWSING_ENABLE = static const SAFE_BROWSING_ENABLE =
const WebViewFeature._internal("SAFE_BROWSING_ENABLE"); const WebViewFeature_._internal("SAFE_BROWSING_ENABLE");
/// ///
static const SAFE_BROWSING_HIT = static const SAFE_BROWSING_HIT =
const WebViewFeature._internal("SAFE_BROWSING_HIT"); const WebViewFeature_._internal("SAFE_BROWSING_HIT");
///This feature covers [InAppWebViewController.getSafeBrowsingPrivacyPolicyUrl]. ///This feature covers [InAppWebViewController.getSafeBrowsingPrivacyPolicyUrl].
static const SAFE_BROWSING_PRIVACY_POLICY_URL = static const SAFE_BROWSING_PRIVACY_POLICY_URL =
const WebViewFeature._internal("SAFE_BROWSING_PRIVACY_POLICY_URL"); const WebViewFeature_._internal("SAFE_BROWSING_PRIVACY_POLICY_URL");
/// ///
static const SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY = static const SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY =
const WebViewFeature._internal("SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY"); const WebViewFeature_._internal("SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY");
/// ///
static const SAFE_BROWSING_RESPONSE_PROCEED = static const SAFE_BROWSING_RESPONSE_PROCEED =
const WebViewFeature._internal("SAFE_BROWSING_RESPONSE_PROCEED"); const WebViewFeature_._internal("SAFE_BROWSING_RESPONSE_PROCEED");
/// ///
static const SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL = static const SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL =
const WebViewFeature._internal( const WebViewFeature_._internal(
"SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL"); "SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL");
///Use [SAFE_BROWSING_ALLOWLIST] instead. ///Use [SAFE_BROWSING_ALLOWLIST] instead.
@Deprecated('Use SAFE_BROWSING_ALLOWLIST instead') @Deprecated('Use SAFE_BROWSING_ALLOWLIST instead')
static const SAFE_BROWSING_WHITELIST = static const SAFE_BROWSING_WHITELIST =
const WebViewFeature._internal("SAFE_BROWSING_WHITELIST"); const WebViewFeature_._internal("SAFE_BROWSING_WHITELIST");
///This feature covers [ServiceWorkerController]. ///This feature covers [ServiceWorkerController].
static const SERVICE_WORKER_BASIC_USAGE = static const SERVICE_WORKER_BASIC_USAGE =
const WebViewFeature._internal("SERVICE_WORKER_BASIC_USAGE"); const WebViewFeature_._internal("SERVICE_WORKER_BASIC_USAGE");
///This feature covers [ServiceWorkerController.setBlockNetworkLoads] and [ServiceWorkerController.getBlockNetworkLoads]. ///This feature covers [ServiceWorkerController.setBlockNetworkLoads] and [ServiceWorkerController.getBlockNetworkLoads].
static const SERVICE_WORKER_BLOCK_NETWORK_LOADS = static const SERVICE_WORKER_BLOCK_NETWORK_LOADS =
const WebViewFeature._internal("SERVICE_WORKER_BLOCK_NETWORK_LOADS"); const WebViewFeature_._internal("SERVICE_WORKER_BLOCK_NETWORK_LOADS");
///This feature covers [ServiceWorkerController.setCacheMode] and [ServiceWorkerController.getCacheMode]. ///This feature covers [ServiceWorkerController.setCacheMode] and [ServiceWorkerController.getCacheMode].
static const SERVICE_WORKER_CACHE_MODE = static const SERVICE_WORKER_CACHE_MODE =
const WebViewFeature._internal("SERVICE_WORKER_CACHE_MODE"); const WebViewFeature_._internal("SERVICE_WORKER_CACHE_MODE");
///This feature covers [ServiceWorkerController.setAllowContentAccess] and [ServiceWorkerController.getAllowContentAccess]. ///This feature covers [ServiceWorkerController.setAllowContentAccess] and [ServiceWorkerController.getAllowContentAccess].
static const SERVICE_WORKER_CONTENT_ACCESS = static const SERVICE_WORKER_CONTENT_ACCESS =
const WebViewFeature._internal("SERVICE_WORKER_CONTENT_ACCESS"); const WebViewFeature_._internal("SERVICE_WORKER_CONTENT_ACCESS");
///This feature covers [ServiceWorkerController.setAllowFileAccess] and [ServiceWorkerController.getAllowFileAccess]. ///This feature covers [ServiceWorkerController.setAllowFileAccess] and [ServiceWorkerController.getAllowFileAccess].
static const SERVICE_WORKER_FILE_ACCESS = static const SERVICE_WORKER_FILE_ACCESS =
const WebViewFeature._internal("SERVICE_WORKER_FILE_ACCESS"); const WebViewFeature_._internal("SERVICE_WORKER_FILE_ACCESS");
///This feature covers [ServiceWorkerClient.shouldInterceptRequest]. ///This feature covers [ServiceWorkerClient.shouldInterceptRequest].
static const SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST = static const SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST =
const WebViewFeature._internal("SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST"); const WebViewFeature_._internal("SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST");
/// ///
static const SHOULD_OVERRIDE_WITH_REDIRECTS = static const SHOULD_OVERRIDE_WITH_REDIRECTS =
const WebViewFeature._internal("SHOULD_OVERRIDE_WITH_REDIRECTS"); const WebViewFeature_._internal("SHOULD_OVERRIDE_WITH_REDIRECTS");
///This feature covers [InAppWebViewController.startSafeBrowsing]. ///This feature covers [InAppWebViewController.startSafeBrowsing].
static const START_SAFE_BROWSING = static const START_SAFE_BROWSING =
const WebViewFeature._internal("START_SAFE_BROWSING"); const WebViewFeature_._internal("START_SAFE_BROWSING");
/// ///
static const TRACING_CONTROLLER_BASIC_USAGE = static const TRACING_CONTROLLER_BASIC_USAGE =
const WebViewFeature._internal("TRACING_CONTROLLER_BASIC_USAGE"); const WebViewFeature_._internal("TRACING_CONTROLLER_BASIC_USAGE");
/// ///
static const VISUAL_STATE_CALLBACK = static const VISUAL_STATE_CALLBACK =
const WebViewFeature._internal("VISUAL_STATE_CALLBACK"); const WebViewFeature_._internal("VISUAL_STATE_CALLBACK");
/// ///
static const WEB_MESSAGE_CALLBACK_ON_MESSAGE = static const WEB_MESSAGE_CALLBACK_ON_MESSAGE =
const WebViewFeature._internal("WEB_MESSAGE_CALLBACK_ON_MESSAGE"); const WebViewFeature_._internal("WEB_MESSAGE_CALLBACK_ON_MESSAGE");
///This feature covers [WebMessageListener]. ///This feature covers [WebMessageListener].
static const WEB_MESSAGE_LISTENER = static const WEB_MESSAGE_LISTENER =
const WebViewFeature._internal("WEB_MESSAGE_LISTENER"); const WebViewFeature_._internal("WEB_MESSAGE_LISTENER");
/// ///
static const WEB_MESSAGE_PORT_CLOSE = static const WEB_MESSAGE_PORT_CLOSE =
const WebViewFeature._internal("WEB_MESSAGE_PORT_CLOSE"); const WebViewFeature_._internal("WEB_MESSAGE_PORT_CLOSE");
/// ///
static const WEB_MESSAGE_PORT_POST_MESSAGE = static const WEB_MESSAGE_PORT_POST_MESSAGE =
const WebViewFeature._internal("WEB_MESSAGE_PORT_POST_MESSAGE"); const WebViewFeature_._internal("WEB_MESSAGE_PORT_POST_MESSAGE");
/// ///
static const WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK = static const WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK =
const WebViewFeature._internal("WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK"); const WebViewFeature_._internal("WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK");
/// ///
static const WEB_RESOURCE_ERROR_GET_CODE = static const WEB_RESOURCE_ERROR_GET_CODE =
const WebViewFeature._internal("WEB_RESOURCE_ERROR_GET_CODE"); const WebViewFeature_._internal("WEB_RESOURCE_ERROR_GET_CODE");
/// ///
static const WEB_RESOURCE_ERROR_GET_DESCRIPTION = static const WEB_RESOURCE_ERROR_GET_DESCRIPTION =
const WebViewFeature._internal("WEB_RESOURCE_ERROR_GET_DESCRIPTION"); const WebViewFeature_._internal("WEB_RESOURCE_ERROR_GET_DESCRIPTION");
/// ///
static const WEB_RESOURCE_REQUEST_IS_REDIRECT = static const WEB_RESOURCE_REQUEST_IS_REDIRECT =
const WebViewFeature._internal("WEB_RESOURCE_REQUEST_IS_REDIRECT"); const WebViewFeature_._internal("WEB_RESOURCE_REQUEST_IS_REDIRECT");
/// ///
static const WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE = static const WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE =
const WebViewFeature._internal("WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE"); const WebViewFeature_._internal("WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE");
/// ///
static const WEB_VIEW_RENDERER_TERMINATE = static const WEB_VIEW_RENDERER_TERMINATE =
const WebViewFeature._internal("WEB_VIEW_RENDERER_TERMINATE"); const WebViewFeature_._internal("WEB_VIEW_RENDERER_TERMINATE");
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
///Return whether a feature is supported at run-time. On devices running Android version `Build.VERSION_CODES.LOLLIPOP` and higher, ///Return whether a feature is supported at run-time. On devices running Android version `Build.VERSION_CODES.LOLLIPOP` and higher,
///this will check whether a feature is supported, depending on the combination of the desired feature, the Android version of device, ///this will check whether a feature is supported, depending on the combination of the desired feature, the Android version of device,
///and the WebView APK on the device. If running on a device with a lower API level, this will always return `false`. ///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) ///**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>{}; Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("feature", () => feature.toValue()); args.putIfAbsent("feature", () => feature.toValue());
return await _channel.invokeMethod('isFeatureSupported', args); return await _channel.invokeMethod('isFeatureSupported', args);
@ -259,256 +202,196 @@ class WebViewFeature {
///Class that represents an Android-specific utility class for checking which WebView Support Library features are supported on the device. ///Class that represents an Android-specific utility class for checking which WebView Support Library features are supported on the device.
///Use [WebViewFeature] instead. ///Use [WebViewFeature] instead.
@Deprecated("Use WebViewFeature instead") @Deprecated("Use WebViewFeature instead")
class AndroidWebViewFeature { @ExchangeableEnum()
class AndroidWebViewFeature_ {
@ExchangeableEnumCustomValue()
static const MethodChannel _channel = const MethodChannel( static const MethodChannel _channel = const MethodChannel(
'com.pichillilorenzo/flutter_inappwebview_webviewfeature'); 'com.pichillilorenzo/flutter_inappwebview_webviewfeature');
// ignore: unused_field
final String _value; final String _value;
const AndroidWebViewFeature_._internal(this._value);
const AndroidWebViewFeature._internal(this._value); @ExchangeableObjectMethod(ignore: true)
static final Set<AndroidWebViewFeature> values = [
AndroidWebViewFeature.CREATE_WEB_MESSAGE_CHANNEL,
AndroidWebViewFeature.DISABLED_ACTION_MODE_MENU_ITEMS,
AndroidWebViewFeature.FORCE_DARK,
AndroidWebViewFeature.FORCE_DARK_STRATEGY,
AndroidWebViewFeature.GET_WEB_CHROME_CLIENT,
AndroidWebViewFeature.GET_WEB_VIEW_CLIENT,
AndroidWebViewFeature.GET_WEB_VIEW_RENDERER,
AndroidWebViewFeature.MULTI_PROCESS,
AndroidWebViewFeature.OFF_SCREEN_PRERASTER,
AndroidWebViewFeature.POST_WEB_MESSAGE,
AndroidWebViewFeature.PROXY_OVERRIDE,
AndroidWebViewFeature.RECEIVE_HTTP_ERROR,
AndroidWebViewFeature.RECEIVE_WEB_RESOURCE_ERROR,
AndroidWebViewFeature.SAFE_BROWSING_ALLOWLIST,
AndroidWebViewFeature.SAFE_BROWSING_ENABLE,
AndroidWebViewFeature.SAFE_BROWSING_HIT,
AndroidWebViewFeature.SAFE_BROWSING_PRIVACY_POLICY_URL,
AndroidWebViewFeature.SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY,
AndroidWebViewFeature.SAFE_BROWSING_RESPONSE_PROCEED,
AndroidWebViewFeature.SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL,
AndroidWebViewFeature.SERVICE_WORKER_BASIC_USAGE,
AndroidWebViewFeature.SERVICE_WORKER_BLOCK_NETWORK_LOADS,
AndroidWebViewFeature.SERVICE_WORKER_CACHE_MODE,
AndroidWebViewFeature.SERVICE_WORKER_CONTENT_ACCESS,
AndroidWebViewFeature.SERVICE_WORKER_FILE_ACCESS,
AndroidWebViewFeature.SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST,
AndroidWebViewFeature.SHOULD_OVERRIDE_WITH_REDIRECTS,
AndroidWebViewFeature.START_SAFE_BROWSING,
AndroidWebViewFeature.TRACING_CONTROLLER_BASIC_USAGE,
AndroidWebViewFeature.VISUAL_STATE_CALLBACK,
AndroidWebViewFeature.WEB_MESSAGE_CALLBACK_ON_MESSAGE,
AndroidWebViewFeature.WEB_MESSAGE_LISTENER,
AndroidWebViewFeature.WEB_MESSAGE_PORT_CLOSE,
AndroidWebViewFeature.WEB_MESSAGE_PORT_POST_MESSAGE,
AndroidWebViewFeature.WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK,
AndroidWebViewFeature.WEB_RESOURCE_ERROR_GET_CODE,
AndroidWebViewFeature.WEB_RESOURCE_ERROR_GET_DESCRIPTION,
AndroidWebViewFeature.WEB_RESOURCE_REQUEST_IS_REDIRECT,
AndroidWebViewFeature.WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE,
AndroidWebViewFeature.WEB_VIEW_RENDERER_TERMINATE,
].toSet();
static AndroidWebViewFeature? fromValue(String? value) {
if (value != null) {
try {
return AndroidWebViewFeature.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
String toValue() => _value; String toValue() => _value;
@override
String toString() => _value;
/// ///
static const CREATE_WEB_MESSAGE_CHANNEL = static const CREATE_WEB_MESSAGE_CHANNEL =
const AndroidWebViewFeature._internal("CREATE_WEB_MESSAGE_CHANNEL"); const AndroidWebViewFeature_._internal("CREATE_WEB_MESSAGE_CHANNEL");
/// ///
static const DISABLED_ACTION_MODE_MENU_ITEMS = static const DISABLED_ACTION_MODE_MENU_ITEMS =
const AndroidWebViewFeature._internal("DISABLED_ACTION_MODE_MENU_ITEMS"); const AndroidWebViewFeature_._internal("DISABLED_ACTION_MODE_MENU_ITEMS");
/// ///
static const FORCE_DARK = const AndroidWebViewFeature._internal("FORCE_DARK"); static const FORCE_DARK = const AndroidWebViewFeature_._internal("FORCE_DARK");
/// ///
static const FORCE_DARK_STRATEGY = static const FORCE_DARK_STRATEGY =
const AndroidWebViewFeature._internal("FORCE_DARK_STRATEGY"); const AndroidWebViewFeature_._internal("FORCE_DARK_STRATEGY");
/// ///
static const GET_WEB_CHROME_CLIENT = static const GET_WEB_CHROME_CLIENT =
const AndroidWebViewFeature._internal("GET_WEB_CHROME_CLIENT"); const AndroidWebViewFeature_._internal("GET_WEB_CHROME_CLIENT");
/// ///
static const GET_WEB_VIEW_CLIENT = static const GET_WEB_VIEW_CLIENT =
const AndroidWebViewFeature._internal("GET_WEB_VIEW_CLIENT"); const AndroidWebViewFeature_._internal("GET_WEB_VIEW_CLIENT");
/// ///
static const GET_WEB_VIEW_RENDERER = static const GET_WEB_VIEW_RENDERER =
const AndroidWebViewFeature._internal("GET_WEB_VIEW_RENDERER"); const AndroidWebViewFeature_._internal("GET_WEB_VIEW_RENDERER");
/// ///
static const MULTI_PROCESS = static const MULTI_PROCESS =
const AndroidWebViewFeature._internal("MULTI_PROCESS"); const AndroidWebViewFeature_._internal("MULTI_PROCESS");
/// ///
static const OFF_SCREEN_PRERASTER = static const OFF_SCREEN_PRERASTER =
const AndroidWebViewFeature._internal("OFF_SCREEN_PRERASTER"); const AndroidWebViewFeature_._internal("OFF_SCREEN_PRERASTER");
/// ///
static const POST_WEB_MESSAGE = static const POST_WEB_MESSAGE =
const AndroidWebViewFeature._internal("POST_WEB_MESSAGE"); const AndroidWebViewFeature_._internal("POST_WEB_MESSAGE");
/// ///
static const PROXY_OVERRIDE = static const PROXY_OVERRIDE =
const AndroidWebViewFeature._internal("PROXY_OVERRIDE"); const AndroidWebViewFeature_._internal("PROXY_OVERRIDE");
/// ///
static const RECEIVE_HTTP_ERROR = static const RECEIVE_HTTP_ERROR =
const AndroidWebViewFeature._internal("RECEIVE_HTTP_ERROR"); const AndroidWebViewFeature_._internal("RECEIVE_HTTP_ERROR");
/// ///
static const RECEIVE_WEB_RESOURCE_ERROR = static const RECEIVE_WEB_RESOURCE_ERROR =
const AndroidWebViewFeature._internal("RECEIVE_WEB_RESOURCE_ERROR"); const AndroidWebViewFeature_._internal("RECEIVE_WEB_RESOURCE_ERROR");
/// ///
static const SAFE_BROWSING_ALLOWLIST = static const SAFE_BROWSING_ALLOWLIST =
const AndroidWebViewFeature._internal("SAFE_BROWSING_ALLOWLIST"); const AndroidWebViewFeature_._internal("SAFE_BROWSING_ALLOWLIST");
/// ///
static const SAFE_BROWSING_ENABLE = static const SAFE_BROWSING_ENABLE =
const AndroidWebViewFeature._internal("SAFE_BROWSING_ENABLE"); const AndroidWebViewFeature_._internal("SAFE_BROWSING_ENABLE");
/// ///
static const SAFE_BROWSING_HIT = static const SAFE_BROWSING_HIT =
const AndroidWebViewFeature._internal("SAFE_BROWSING_HIT"); const AndroidWebViewFeature_._internal("SAFE_BROWSING_HIT");
/// ///
static const SAFE_BROWSING_PRIVACY_POLICY_URL = static const SAFE_BROWSING_PRIVACY_POLICY_URL =
const AndroidWebViewFeature._internal("SAFE_BROWSING_PRIVACY_POLICY_URL"); const AndroidWebViewFeature_._internal("SAFE_BROWSING_PRIVACY_POLICY_URL");
/// ///
static const SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY = static const SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY =
const AndroidWebViewFeature._internal( const AndroidWebViewFeature_._internal(
"SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY"); "SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY");
/// ///
static const SAFE_BROWSING_RESPONSE_PROCEED = static const SAFE_BROWSING_RESPONSE_PROCEED =
const AndroidWebViewFeature._internal("SAFE_BROWSING_RESPONSE_PROCEED"); const AndroidWebViewFeature_._internal("SAFE_BROWSING_RESPONSE_PROCEED");
/// ///
static const SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL = static const SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL =
const AndroidWebViewFeature._internal( const AndroidWebViewFeature_._internal(
"SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL"); "SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL");
///Use [SAFE_BROWSING_ALLOWLIST] instead. ///Use [SAFE_BROWSING_ALLOWLIST] instead.
@Deprecated('Use SAFE_BROWSING_ALLOWLIST instead') @Deprecated('Use SAFE_BROWSING_ALLOWLIST instead')
static const SAFE_BROWSING_WHITELIST = static const SAFE_BROWSING_WHITELIST =
const AndroidWebViewFeature._internal("SAFE_BROWSING_WHITELIST"); const AndroidWebViewFeature_._internal("SAFE_BROWSING_WHITELIST");
/// ///
static const SERVICE_WORKER_BASIC_USAGE = static const SERVICE_WORKER_BASIC_USAGE =
const AndroidWebViewFeature._internal("SERVICE_WORKER_BASIC_USAGE"); const AndroidWebViewFeature_._internal("SERVICE_WORKER_BASIC_USAGE");
/// ///
static const SERVICE_WORKER_BLOCK_NETWORK_LOADS = static const SERVICE_WORKER_BLOCK_NETWORK_LOADS =
const AndroidWebViewFeature._internal( const AndroidWebViewFeature_._internal(
"SERVICE_WORKER_BLOCK_NETWORK_LOADS"); "SERVICE_WORKER_BLOCK_NETWORK_LOADS");
/// ///
static const SERVICE_WORKER_CACHE_MODE = static const SERVICE_WORKER_CACHE_MODE =
const AndroidWebViewFeature._internal("SERVICE_WORKER_CACHE_MODE"); const AndroidWebViewFeature_._internal("SERVICE_WORKER_CACHE_MODE");
/// ///
static const SERVICE_WORKER_CONTENT_ACCESS = static const SERVICE_WORKER_CONTENT_ACCESS =
const AndroidWebViewFeature._internal("SERVICE_WORKER_CONTENT_ACCESS"); const AndroidWebViewFeature_._internal("SERVICE_WORKER_CONTENT_ACCESS");
/// ///
static const SERVICE_WORKER_FILE_ACCESS = static const SERVICE_WORKER_FILE_ACCESS =
const AndroidWebViewFeature._internal("SERVICE_WORKER_FILE_ACCESS"); const AndroidWebViewFeature_._internal("SERVICE_WORKER_FILE_ACCESS");
/// ///
static const SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST = static const SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST =
const AndroidWebViewFeature._internal( const AndroidWebViewFeature_._internal(
"SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST"); "SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST");
/// ///
static const SHOULD_OVERRIDE_WITH_REDIRECTS = static const SHOULD_OVERRIDE_WITH_REDIRECTS =
const AndroidWebViewFeature._internal("SHOULD_OVERRIDE_WITH_REDIRECTS"); const AndroidWebViewFeature_._internal("SHOULD_OVERRIDE_WITH_REDIRECTS");
/// ///
static const START_SAFE_BROWSING = static const START_SAFE_BROWSING =
const AndroidWebViewFeature._internal("START_SAFE_BROWSING"); const AndroidWebViewFeature_._internal("START_SAFE_BROWSING");
/// ///
static const TRACING_CONTROLLER_BASIC_USAGE = static const TRACING_CONTROLLER_BASIC_USAGE =
const AndroidWebViewFeature._internal("TRACING_CONTROLLER_BASIC_USAGE"); const AndroidWebViewFeature_._internal("TRACING_CONTROLLER_BASIC_USAGE");
/// ///
static const VISUAL_STATE_CALLBACK = static const VISUAL_STATE_CALLBACK =
const AndroidWebViewFeature._internal("VISUAL_STATE_CALLBACK"); const AndroidWebViewFeature_._internal("VISUAL_STATE_CALLBACK");
/// ///
static const WEB_MESSAGE_CALLBACK_ON_MESSAGE = static const WEB_MESSAGE_CALLBACK_ON_MESSAGE =
const AndroidWebViewFeature._internal("WEB_MESSAGE_CALLBACK_ON_MESSAGE"); const AndroidWebViewFeature_._internal("WEB_MESSAGE_CALLBACK_ON_MESSAGE");
/// ///
static const WEB_MESSAGE_LISTENER = static const WEB_MESSAGE_LISTENER =
const AndroidWebViewFeature._internal("WEB_MESSAGE_LISTENER"); const AndroidWebViewFeature_._internal("WEB_MESSAGE_LISTENER");
/// ///
static const WEB_MESSAGE_PORT_CLOSE = static const WEB_MESSAGE_PORT_CLOSE =
const AndroidWebViewFeature._internal("WEB_MESSAGE_PORT_CLOSE"); const AndroidWebViewFeature_._internal("WEB_MESSAGE_PORT_CLOSE");
/// ///
static const WEB_MESSAGE_PORT_POST_MESSAGE = static const WEB_MESSAGE_PORT_POST_MESSAGE =
const AndroidWebViewFeature._internal("WEB_MESSAGE_PORT_POST_MESSAGE"); const AndroidWebViewFeature_._internal("WEB_MESSAGE_PORT_POST_MESSAGE");
/// ///
static const WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK = static const WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK =
const AndroidWebViewFeature._internal( const AndroidWebViewFeature_._internal(
"WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK"); "WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK");
/// ///
static const WEB_RESOURCE_ERROR_GET_CODE = static const WEB_RESOURCE_ERROR_GET_CODE =
const AndroidWebViewFeature._internal("WEB_RESOURCE_ERROR_GET_CODE"); const AndroidWebViewFeature_._internal("WEB_RESOURCE_ERROR_GET_CODE");
/// ///
static const WEB_RESOURCE_ERROR_GET_DESCRIPTION = static const WEB_RESOURCE_ERROR_GET_DESCRIPTION =
const AndroidWebViewFeature._internal( const AndroidWebViewFeature_._internal(
"WEB_RESOURCE_ERROR_GET_DESCRIPTION"); "WEB_RESOURCE_ERROR_GET_DESCRIPTION");
/// ///
static const WEB_RESOURCE_REQUEST_IS_REDIRECT = static const WEB_RESOURCE_REQUEST_IS_REDIRECT =
const AndroidWebViewFeature._internal("WEB_RESOURCE_REQUEST_IS_REDIRECT"); const AndroidWebViewFeature_._internal("WEB_RESOURCE_REQUEST_IS_REDIRECT");
/// ///
static const WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE = static const WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE =
const AndroidWebViewFeature._internal( const AndroidWebViewFeature_._internal(
"WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE"); "WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE");
/// ///
static const WEB_VIEW_RENDERER_TERMINATE = static const WEB_VIEW_RENDERER_TERMINATE =
const AndroidWebViewFeature._internal("WEB_VIEW_RENDERER_TERMINATE"); const AndroidWebViewFeature_._internal("WEB_VIEW_RENDERER_TERMINATE");
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
///Return whether a feature is supported at run-time. On devices running Android version `Build.VERSION_CODES.LOLLIPOP` and higher, ///Return whether a feature is supported at run-time. On devices running Android version `Build.VERSION_CODES.LOLLIPOP` and higher,
///this will check whether a feature is supported, depending on the combination of the desired feature, the Android version of device, ///this will check whether a feature is supported, depending on the combination of the desired feature, the Android version of device,
///and the WebView APK on the device. If running on a device with a lower API level, this will always return `false`. ///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) ///**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>{}; Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("feature", () => feature.toValue()); args.putIfAbsent("feature", () => feature.toValue());
return await _channel.invokeMethod('isFeatureSupported', args); return await _channel.invokeMethod('isFeatureSupported', args);

View File

@ -0,0 +1,580 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'webview_feature.dart';
// **************************************************************************
// ExchangeableEnumGenerator
// **************************************************************************
///Class that represents an Android-specific utility class for checking which WebView Support Library features are supported on the device.
class WebViewFeature {
final String _value;
final String _nativeValue;
const WebViewFeature._internal(this._value, this._nativeValue);
// ignore: unused_element
factory WebViewFeature._internalMultiPlatform(
String value, Function nativeValue) =>
WebViewFeature._internal(value, nativeValue());
static const _channel = const MethodChannel(
'com.pichillilorenzo/flutter_inappwebview_webviewfeature');
///This feature covers [InAppWebViewController.createWebMessageChannel].
static const CREATE_WEB_MESSAGE_CHANNEL = WebViewFeature._internal(
'CREATE_WEB_MESSAGE_CHANNEL', 'CREATE_WEB_MESSAGE_CHANNEL');
///This feature covers [InAppWebViewSettings.disabledActionModeMenuItems].
static const DISABLED_ACTION_MODE_MENU_ITEMS = WebViewFeature._internal(
'DISABLED_ACTION_MODE_MENU_ITEMS', 'DISABLED_ACTION_MODE_MENU_ITEMS');
///This feature covers [InAppWebViewSettings.forceDark].
static const FORCE_DARK =
WebViewFeature._internal('FORCE_DARK', 'FORCE_DARK');
///This feature covers [InAppWebViewSettings.forceDarkStrategy].
static const FORCE_DARK_STRATEGY =
WebViewFeature._internal('FORCE_DARK_STRATEGY', 'FORCE_DARK_STRATEGY');
///
static const GET_WEB_CHROME_CLIENT = WebViewFeature._internal(
'GET_WEB_CHROME_CLIENT', 'GET_WEB_CHROME_CLIENT');
///
static const GET_WEB_VIEW_CLIENT =
WebViewFeature._internal('GET_WEB_VIEW_CLIENT', 'GET_WEB_VIEW_CLIENT');
///
static const GET_WEB_VIEW_RENDERER = WebViewFeature._internal(
'GET_WEB_VIEW_RENDERER', 'GET_WEB_VIEW_RENDERER');
///
static const MULTI_PROCESS =
WebViewFeature._internal('MULTI_PROCESS', 'MULTI_PROCESS');
///This feature covers [InAppWebViewSettings.offscreenPreRaster].
static const OFF_SCREEN_PRERASTER =
WebViewFeature._internal('OFF_SCREEN_PRERASTER', 'OFF_SCREEN_PRERASTER');
///This feature covers [InAppWebViewController.postWebMessage].
static const POST_WEB_MESSAGE =
WebViewFeature._internal('POST_WEB_MESSAGE', 'POST_WEB_MESSAGE');
///This feature covers [ProxyController.setProxyOverride] and [ProxyController.clearProxyOverride].
static const PROXY_OVERRIDE =
WebViewFeature._internal('PROXY_OVERRIDE', 'PROXY_OVERRIDE');
///
static const RECEIVE_HTTP_ERROR =
WebViewFeature._internal('RECEIVE_HTTP_ERROR', 'RECEIVE_HTTP_ERROR');
///
static const RECEIVE_WEB_RESOURCE_ERROR = WebViewFeature._internal(
'RECEIVE_WEB_RESOURCE_ERROR', 'RECEIVE_WEB_RESOURCE_ERROR');
///This feature covers [InAppWebViewController.setSafeBrowsingAllowlist].
static const SAFE_BROWSING_ALLOWLIST = WebViewFeature._internal(
'SAFE_BROWSING_ALLOWLIST', 'SAFE_BROWSING_ALLOWLIST');
///This feature covers [InAppWebViewSettings.safeBrowsingEnabled].
static const SAFE_BROWSING_ENABLE =
WebViewFeature._internal('SAFE_BROWSING_ENABLE', 'SAFE_BROWSING_ENABLE');
///
static const SAFE_BROWSING_HIT =
WebViewFeature._internal('SAFE_BROWSING_HIT', 'SAFE_BROWSING_HIT');
///This feature covers [InAppWebViewController.getSafeBrowsingPrivacyPolicyUrl].
static const SAFE_BROWSING_PRIVACY_POLICY_URL = WebViewFeature._internal(
'SAFE_BROWSING_PRIVACY_POLICY_URL', 'SAFE_BROWSING_PRIVACY_POLICY_URL');
///
static const SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY = WebViewFeature._internal(
'SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY',
'SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY');
///
static const SAFE_BROWSING_RESPONSE_PROCEED = WebViewFeature._internal(
'SAFE_BROWSING_RESPONSE_PROCEED', 'SAFE_BROWSING_RESPONSE_PROCEED');
///
static const SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL =
WebViewFeature._internal('SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL',
'SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL');
///Use [SAFE_BROWSING_ALLOWLIST] instead.
static const SAFE_BROWSING_WHITELIST = WebViewFeature._internal(
'SAFE_BROWSING_WHITELIST', 'SAFE_BROWSING_WHITELIST');
///This feature covers [ServiceWorkerController].
static const SERVICE_WORKER_BASIC_USAGE = WebViewFeature._internal(
'SERVICE_WORKER_BASIC_USAGE', 'SERVICE_WORKER_BASIC_USAGE');
///This feature covers [ServiceWorkerController.setBlockNetworkLoads] and [ServiceWorkerController.getBlockNetworkLoads].
static const SERVICE_WORKER_BLOCK_NETWORK_LOADS = WebViewFeature._internal(
'SERVICE_WORKER_BLOCK_NETWORK_LOADS',
'SERVICE_WORKER_BLOCK_NETWORK_LOADS');
///This feature covers [ServiceWorkerController.setCacheMode] and [ServiceWorkerController.getCacheMode].
static const SERVICE_WORKER_CACHE_MODE = WebViewFeature._internal(
'SERVICE_WORKER_CACHE_MODE', 'SERVICE_WORKER_CACHE_MODE');
///This feature covers [ServiceWorkerController.setAllowContentAccess] and [ServiceWorkerController.getAllowContentAccess].
static const SERVICE_WORKER_CONTENT_ACCESS = WebViewFeature._internal(
'SERVICE_WORKER_CONTENT_ACCESS', 'SERVICE_WORKER_CONTENT_ACCESS');
///This feature covers [ServiceWorkerController.setAllowFileAccess] and [ServiceWorkerController.getAllowFileAccess].
static const SERVICE_WORKER_FILE_ACCESS = WebViewFeature._internal(
'SERVICE_WORKER_FILE_ACCESS', 'SERVICE_WORKER_FILE_ACCESS');
///This feature covers [ServiceWorkerClient.shouldInterceptRequest].
static const SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST =
WebViewFeature._internal('SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST',
'SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST');
///
static const SHOULD_OVERRIDE_WITH_REDIRECTS = WebViewFeature._internal(
'SHOULD_OVERRIDE_WITH_REDIRECTS', 'SHOULD_OVERRIDE_WITH_REDIRECTS');
///This feature covers [InAppWebViewController.startSafeBrowsing].
static const START_SAFE_BROWSING =
WebViewFeature._internal('START_SAFE_BROWSING', 'START_SAFE_BROWSING');
///
static const TRACING_CONTROLLER_BASIC_USAGE = WebViewFeature._internal(
'TRACING_CONTROLLER_BASIC_USAGE', 'TRACING_CONTROLLER_BASIC_USAGE');
///
static const VISUAL_STATE_CALLBACK = WebViewFeature._internal(
'VISUAL_STATE_CALLBACK', 'VISUAL_STATE_CALLBACK');
///
static const WEB_MESSAGE_CALLBACK_ON_MESSAGE = WebViewFeature._internal(
'WEB_MESSAGE_CALLBACK_ON_MESSAGE', 'WEB_MESSAGE_CALLBACK_ON_MESSAGE');
///This feature covers [WebMessageListener].
static const WEB_MESSAGE_LISTENER =
WebViewFeature._internal('WEB_MESSAGE_LISTENER', 'WEB_MESSAGE_LISTENER');
///
static const WEB_MESSAGE_PORT_CLOSE = WebViewFeature._internal(
'WEB_MESSAGE_PORT_CLOSE', 'WEB_MESSAGE_PORT_CLOSE');
///
static const WEB_MESSAGE_PORT_POST_MESSAGE = WebViewFeature._internal(
'WEB_MESSAGE_PORT_POST_MESSAGE', 'WEB_MESSAGE_PORT_POST_MESSAGE');
///
static const WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK = WebViewFeature._internal(
'WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK',
'WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK');
///
static const WEB_RESOURCE_ERROR_GET_CODE = WebViewFeature._internal(
'WEB_RESOURCE_ERROR_GET_CODE', 'WEB_RESOURCE_ERROR_GET_CODE');
///
static const WEB_RESOURCE_ERROR_GET_DESCRIPTION = WebViewFeature._internal(
'WEB_RESOURCE_ERROR_GET_DESCRIPTION',
'WEB_RESOURCE_ERROR_GET_DESCRIPTION');
///
static const WEB_RESOURCE_REQUEST_IS_REDIRECT = WebViewFeature._internal(
'WEB_RESOURCE_REQUEST_IS_REDIRECT', 'WEB_RESOURCE_REQUEST_IS_REDIRECT');
///
static const WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE = WebViewFeature._internal(
'WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE',
'WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE');
///
static const WEB_VIEW_RENDERER_TERMINATE = WebViewFeature._internal(
'WEB_VIEW_RENDERER_TERMINATE', 'WEB_VIEW_RENDERER_TERMINATE');
///Set of all values of [WebViewFeature].
static final Set<WebViewFeature> values = [
WebViewFeature.CREATE_WEB_MESSAGE_CHANNEL,
WebViewFeature.DISABLED_ACTION_MODE_MENU_ITEMS,
WebViewFeature.FORCE_DARK,
WebViewFeature.FORCE_DARK_STRATEGY,
WebViewFeature.GET_WEB_CHROME_CLIENT,
WebViewFeature.GET_WEB_VIEW_CLIENT,
WebViewFeature.GET_WEB_VIEW_RENDERER,
WebViewFeature.MULTI_PROCESS,
WebViewFeature.OFF_SCREEN_PRERASTER,
WebViewFeature.POST_WEB_MESSAGE,
WebViewFeature.PROXY_OVERRIDE,
WebViewFeature.RECEIVE_HTTP_ERROR,
WebViewFeature.RECEIVE_WEB_RESOURCE_ERROR,
WebViewFeature.SAFE_BROWSING_ALLOWLIST,
WebViewFeature.SAFE_BROWSING_ENABLE,
WebViewFeature.SAFE_BROWSING_HIT,
WebViewFeature.SAFE_BROWSING_PRIVACY_POLICY_URL,
WebViewFeature.SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY,
WebViewFeature.SAFE_BROWSING_RESPONSE_PROCEED,
WebViewFeature.SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL,
WebViewFeature.SAFE_BROWSING_WHITELIST,
WebViewFeature.SERVICE_WORKER_BASIC_USAGE,
WebViewFeature.SERVICE_WORKER_BLOCK_NETWORK_LOADS,
WebViewFeature.SERVICE_WORKER_CACHE_MODE,
WebViewFeature.SERVICE_WORKER_CONTENT_ACCESS,
WebViewFeature.SERVICE_WORKER_FILE_ACCESS,
WebViewFeature.SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST,
WebViewFeature.SHOULD_OVERRIDE_WITH_REDIRECTS,
WebViewFeature.START_SAFE_BROWSING,
WebViewFeature.TRACING_CONTROLLER_BASIC_USAGE,
WebViewFeature.VISUAL_STATE_CALLBACK,
WebViewFeature.WEB_MESSAGE_CALLBACK_ON_MESSAGE,
WebViewFeature.WEB_MESSAGE_LISTENER,
WebViewFeature.WEB_MESSAGE_PORT_CLOSE,
WebViewFeature.WEB_MESSAGE_PORT_POST_MESSAGE,
WebViewFeature.WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK,
WebViewFeature.WEB_RESOURCE_ERROR_GET_CODE,
WebViewFeature.WEB_RESOURCE_ERROR_GET_DESCRIPTION,
WebViewFeature.WEB_RESOURCE_REQUEST_IS_REDIRECT,
WebViewFeature.WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE,
WebViewFeature.WEB_VIEW_RENDERER_TERMINATE,
].toSet();
///Gets a possible [WebViewFeature] instance from [String] value.
static WebViewFeature? fromValue(String? value) {
if (value != null) {
try {
return WebViewFeature.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets a possible [WebViewFeature] instance from a native value.
static WebViewFeature? fromNativeValue(String? value) {
if (value != null) {
try {
return WebViewFeature.values
.firstWhere((element) => element.toNativeValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Return whether a feature is supported at run-time. On devices running Android version `Build.VERSION_CODES.LOLLIPOP` and higher,
///this will check whether a feature is supported, depending on the combination of the desired feature, the Android version of device,
///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 {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("feature", () => feature.toValue());
return await _channel.invokeMethod('isFeatureSupported', args);
}
///Gets [String] value.
String toValue() => _value;
///Gets [String] native value.
String toNativeValue() => _nativeValue;
@override
int get hashCode => _value.hashCode;
@override
bool operator ==(value) => value == _value;
@override
String toString() {
return _value;
}
}
///Class that represents an Android-specific utility class for checking which WebView Support Library features are supported on the device.
///Use [WebViewFeature] instead.
@Deprecated('Use WebViewFeature instead')
class AndroidWebViewFeature {
final String _value;
final String _nativeValue;
const AndroidWebViewFeature._internal(this._value, this._nativeValue);
// ignore: unused_element
factory AndroidWebViewFeature._internalMultiPlatform(
String value, Function nativeValue) =>
AndroidWebViewFeature._internal(value, nativeValue());
static const _channel = const MethodChannel(
'com.pichillilorenzo/flutter_inappwebview_webviewfeature');
///
static const CREATE_WEB_MESSAGE_CHANNEL = AndroidWebViewFeature._internal(
'CREATE_WEB_MESSAGE_CHANNEL', 'CREATE_WEB_MESSAGE_CHANNEL');
///
static const DISABLED_ACTION_MODE_MENU_ITEMS =
AndroidWebViewFeature._internal(
'DISABLED_ACTION_MODE_MENU_ITEMS', 'DISABLED_ACTION_MODE_MENU_ITEMS');
///
static const FORCE_DARK =
AndroidWebViewFeature._internal('FORCE_DARK', 'FORCE_DARK');
///
static const FORCE_DARK_STRATEGY = AndroidWebViewFeature._internal(
'FORCE_DARK_STRATEGY', 'FORCE_DARK_STRATEGY');
///
static const GET_WEB_CHROME_CLIENT = AndroidWebViewFeature._internal(
'GET_WEB_CHROME_CLIENT', 'GET_WEB_CHROME_CLIENT');
///
static const GET_WEB_VIEW_CLIENT = AndroidWebViewFeature._internal(
'GET_WEB_VIEW_CLIENT', 'GET_WEB_VIEW_CLIENT');
///
static const GET_WEB_VIEW_RENDERER = AndroidWebViewFeature._internal(
'GET_WEB_VIEW_RENDERER', 'GET_WEB_VIEW_RENDERER');
///
static const MULTI_PROCESS =
AndroidWebViewFeature._internal('MULTI_PROCESS', 'MULTI_PROCESS');
///
static const OFF_SCREEN_PRERASTER = AndroidWebViewFeature._internal(
'OFF_SCREEN_PRERASTER', 'OFF_SCREEN_PRERASTER');
///
static const POST_WEB_MESSAGE =
AndroidWebViewFeature._internal('POST_WEB_MESSAGE', 'POST_WEB_MESSAGE');
///
static const PROXY_OVERRIDE =
AndroidWebViewFeature._internal('PROXY_OVERRIDE', 'PROXY_OVERRIDE');
///
static const RECEIVE_HTTP_ERROR = AndroidWebViewFeature._internal(
'RECEIVE_HTTP_ERROR', 'RECEIVE_HTTP_ERROR');
///
static const RECEIVE_WEB_RESOURCE_ERROR = AndroidWebViewFeature._internal(
'RECEIVE_WEB_RESOURCE_ERROR', 'RECEIVE_WEB_RESOURCE_ERROR');
///
static const SAFE_BROWSING_ALLOWLIST = AndroidWebViewFeature._internal(
'SAFE_BROWSING_ALLOWLIST', 'SAFE_BROWSING_ALLOWLIST');
///
static const SAFE_BROWSING_ENABLE = AndroidWebViewFeature._internal(
'SAFE_BROWSING_ENABLE', 'SAFE_BROWSING_ENABLE');
///
static const SAFE_BROWSING_HIT =
AndroidWebViewFeature._internal('SAFE_BROWSING_HIT', 'SAFE_BROWSING_HIT');
///
static const SAFE_BROWSING_PRIVACY_POLICY_URL =
AndroidWebViewFeature._internal('SAFE_BROWSING_PRIVACY_POLICY_URL',
'SAFE_BROWSING_PRIVACY_POLICY_URL');
///
static const SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY =
AndroidWebViewFeature._internal('SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY',
'SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY');
///
static const SAFE_BROWSING_RESPONSE_PROCEED = AndroidWebViewFeature._internal(
'SAFE_BROWSING_RESPONSE_PROCEED', 'SAFE_BROWSING_RESPONSE_PROCEED');
///
static const SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL =
AndroidWebViewFeature._internal(
'SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL',
'SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL');
///Use [SAFE_BROWSING_ALLOWLIST] instead.
static const SAFE_BROWSING_WHITELIST = AndroidWebViewFeature._internal(
'SAFE_BROWSING_WHITELIST', 'SAFE_BROWSING_WHITELIST');
///
static const SERVICE_WORKER_BASIC_USAGE = AndroidWebViewFeature._internal(
'SERVICE_WORKER_BASIC_USAGE', 'SERVICE_WORKER_BASIC_USAGE');
///
static const SERVICE_WORKER_BLOCK_NETWORK_LOADS =
AndroidWebViewFeature._internal('SERVICE_WORKER_BLOCK_NETWORK_LOADS',
'SERVICE_WORKER_BLOCK_NETWORK_LOADS');
///
static const SERVICE_WORKER_CACHE_MODE = AndroidWebViewFeature._internal(
'SERVICE_WORKER_CACHE_MODE', 'SERVICE_WORKER_CACHE_MODE');
///
static const SERVICE_WORKER_CONTENT_ACCESS = AndroidWebViewFeature._internal(
'SERVICE_WORKER_CONTENT_ACCESS', 'SERVICE_WORKER_CONTENT_ACCESS');
///
static const SERVICE_WORKER_FILE_ACCESS = AndroidWebViewFeature._internal(
'SERVICE_WORKER_FILE_ACCESS', 'SERVICE_WORKER_FILE_ACCESS');
///
static const SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST =
AndroidWebViewFeature._internal('SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST',
'SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST');
///
static const SHOULD_OVERRIDE_WITH_REDIRECTS = AndroidWebViewFeature._internal(
'SHOULD_OVERRIDE_WITH_REDIRECTS', 'SHOULD_OVERRIDE_WITH_REDIRECTS');
///
static const START_SAFE_BROWSING = AndroidWebViewFeature._internal(
'START_SAFE_BROWSING', 'START_SAFE_BROWSING');
///
static const TRACING_CONTROLLER_BASIC_USAGE = AndroidWebViewFeature._internal(
'TRACING_CONTROLLER_BASIC_USAGE', 'TRACING_CONTROLLER_BASIC_USAGE');
///
static const VISUAL_STATE_CALLBACK = AndroidWebViewFeature._internal(
'VISUAL_STATE_CALLBACK', 'VISUAL_STATE_CALLBACK');
///
static const WEB_MESSAGE_CALLBACK_ON_MESSAGE =
AndroidWebViewFeature._internal(
'WEB_MESSAGE_CALLBACK_ON_MESSAGE', 'WEB_MESSAGE_CALLBACK_ON_MESSAGE');
///
static const WEB_MESSAGE_LISTENER = AndroidWebViewFeature._internal(
'WEB_MESSAGE_LISTENER', 'WEB_MESSAGE_LISTENER');
///
static const WEB_MESSAGE_PORT_CLOSE = AndroidWebViewFeature._internal(
'WEB_MESSAGE_PORT_CLOSE', 'WEB_MESSAGE_PORT_CLOSE');
///
static const WEB_MESSAGE_PORT_POST_MESSAGE = AndroidWebViewFeature._internal(
'WEB_MESSAGE_PORT_POST_MESSAGE', 'WEB_MESSAGE_PORT_POST_MESSAGE');
///
static const WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK =
AndroidWebViewFeature._internal('WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK',
'WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK');
///
static const WEB_RESOURCE_ERROR_GET_CODE = AndroidWebViewFeature._internal(
'WEB_RESOURCE_ERROR_GET_CODE', 'WEB_RESOURCE_ERROR_GET_CODE');
///
static const WEB_RESOURCE_ERROR_GET_DESCRIPTION =
AndroidWebViewFeature._internal('WEB_RESOURCE_ERROR_GET_DESCRIPTION',
'WEB_RESOURCE_ERROR_GET_DESCRIPTION');
///
static const WEB_RESOURCE_REQUEST_IS_REDIRECT =
AndroidWebViewFeature._internal('WEB_RESOURCE_REQUEST_IS_REDIRECT',
'WEB_RESOURCE_REQUEST_IS_REDIRECT');
///
static const WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE =
AndroidWebViewFeature._internal('WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE',
'WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE');
///
static const WEB_VIEW_RENDERER_TERMINATE = AndroidWebViewFeature._internal(
'WEB_VIEW_RENDERER_TERMINATE', 'WEB_VIEW_RENDERER_TERMINATE');
///Set of all values of [AndroidWebViewFeature].
static final Set<AndroidWebViewFeature> values = [
AndroidWebViewFeature.CREATE_WEB_MESSAGE_CHANNEL,
AndroidWebViewFeature.DISABLED_ACTION_MODE_MENU_ITEMS,
AndroidWebViewFeature.FORCE_DARK,
AndroidWebViewFeature.FORCE_DARK_STRATEGY,
AndroidWebViewFeature.GET_WEB_CHROME_CLIENT,
AndroidWebViewFeature.GET_WEB_VIEW_CLIENT,
AndroidWebViewFeature.GET_WEB_VIEW_RENDERER,
AndroidWebViewFeature.MULTI_PROCESS,
AndroidWebViewFeature.OFF_SCREEN_PRERASTER,
AndroidWebViewFeature.POST_WEB_MESSAGE,
AndroidWebViewFeature.PROXY_OVERRIDE,
AndroidWebViewFeature.RECEIVE_HTTP_ERROR,
AndroidWebViewFeature.RECEIVE_WEB_RESOURCE_ERROR,
AndroidWebViewFeature.SAFE_BROWSING_ALLOWLIST,
AndroidWebViewFeature.SAFE_BROWSING_ENABLE,
AndroidWebViewFeature.SAFE_BROWSING_HIT,
AndroidWebViewFeature.SAFE_BROWSING_PRIVACY_POLICY_URL,
AndroidWebViewFeature.SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY,
AndroidWebViewFeature.SAFE_BROWSING_RESPONSE_PROCEED,
AndroidWebViewFeature.SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL,
AndroidWebViewFeature.SAFE_BROWSING_WHITELIST,
AndroidWebViewFeature.SERVICE_WORKER_BASIC_USAGE,
AndroidWebViewFeature.SERVICE_WORKER_BLOCK_NETWORK_LOADS,
AndroidWebViewFeature.SERVICE_WORKER_CACHE_MODE,
AndroidWebViewFeature.SERVICE_WORKER_CONTENT_ACCESS,
AndroidWebViewFeature.SERVICE_WORKER_FILE_ACCESS,
AndroidWebViewFeature.SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST,
AndroidWebViewFeature.SHOULD_OVERRIDE_WITH_REDIRECTS,
AndroidWebViewFeature.START_SAFE_BROWSING,
AndroidWebViewFeature.TRACING_CONTROLLER_BASIC_USAGE,
AndroidWebViewFeature.VISUAL_STATE_CALLBACK,
AndroidWebViewFeature.WEB_MESSAGE_CALLBACK_ON_MESSAGE,
AndroidWebViewFeature.WEB_MESSAGE_LISTENER,
AndroidWebViewFeature.WEB_MESSAGE_PORT_CLOSE,
AndroidWebViewFeature.WEB_MESSAGE_PORT_POST_MESSAGE,
AndroidWebViewFeature.WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK,
AndroidWebViewFeature.WEB_RESOURCE_ERROR_GET_CODE,
AndroidWebViewFeature.WEB_RESOURCE_ERROR_GET_DESCRIPTION,
AndroidWebViewFeature.WEB_RESOURCE_REQUEST_IS_REDIRECT,
AndroidWebViewFeature.WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE,
AndroidWebViewFeature.WEB_VIEW_RENDERER_TERMINATE,
].toSet();
///Gets a possible [AndroidWebViewFeature] instance from [String] value.
static AndroidWebViewFeature? fromValue(String? value) {
if (value != null) {
try {
return AndroidWebViewFeature.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets a possible [AndroidWebViewFeature] instance from a native value.
static AndroidWebViewFeature? fromNativeValue(String? value) {
if (value != null) {
try {
return AndroidWebViewFeature.values
.firstWhere((element) => element.toNativeValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Return whether a feature is supported at run-time. On devices running Android version `Build.VERSION_CODES.LOLLIPOP` and higher,
///this will check whether a feature is supported, depending on the combination of the desired feature, the Android version of device,
///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 {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("feature", () => feature.toValue());
return await _channel.invokeMethod('isFeatureSupported', args);
}
///Gets [String] value.
String toValue() => _value;
///Gets [String] native value.
String toNativeValue() => _nativeValue;
@override
int get hashCode => _value.hashCode;
@override
bool operator ==(value) => value == _value;
@override
String toString() {
return _value;
}
}

View File

@ -196,8 +196,8 @@ class IOSInAppWebViewOptions
///- [IOSInAppWebViewOptions.enableViewportScale] ///- [IOSInAppWebViewOptions.enableViewportScale]
/// ///
///Events affected: ///Events affected:
///- the `hitTestResult` argument of [WebView.onLongPressHitTestResult] will be empty ///- the `hitTestResult` argument of [WebView.onLongPressHitTestResult] will be empty
///- the `hitTestResult` argument of [ContextMenu.onCreateContextMenu] will be empty ///- the `hitTestResult` argument of [ContextMenu.onCreateContextMenu] will be empty
///- [WebView.onLoadResource] ///- [WebView.onLoadResource]
///- [WebView.shouldInterceptAjaxRequest] ///- [WebView.shouldInterceptAjaxRequest]
///- [WebView.onAjaxReadyStateChange] ///- [WebView.onAjaxReadyStateChange]
@ -214,7 +214,7 @@ class IOSInAppWebViewOptions
///Used in combination with [WebView.initialUrlRequest] or [WebView.initialData] (using the `file://` scheme), it represents the URL from which to read the web content. ///Used in combination with [WebView.initialUrlRequest] or [WebView.initialData] (using the `file://` scheme), it represents the URL from which to read the web content.
///This URL must be a file-based URL (using the `file://` scheme). ///This URL must be a file-based URL (using the `file://` scheme).
///Specify the same value as the [URLRequest.url] if you are using it with the [WebView.initialUrlRequest] parameter or ///Specify the same value as the [URLRequest.url] if you are using it with the [WebView.initialUrlRequest] parameter or
///the [InAppWebViewInitialData.baseUrl] if you are using it with the [WebView.initialData] parameter to prevent WebView from reading any other content. ///the [InAppWebViewInitialData.baseUrl] if you are using it with the [WebView.initialData] parameter to prevent WebView from reading any other content.
///Specify a directory to give WebView permission to read additional files in the specified directory. ///Specify a directory to give WebView permission to read additional files in the specified directory.
Uri? allowingReadAccessTo; Uri? allowingReadAccessTo;

View File

@ -445,19 +445,19 @@ class InAppWebViewController {
if (_webview != null) { if (_webview != null) {
if (_webview!.onRenderProcessUnresponsive != null) if (_webview!.onRenderProcessUnresponsive != null)
return (await _webview!.onRenderProcessUnresponsive!(this, uri)) return (await _webview!.onRenderProcessUnresponsive!(this, uri))
?.toMap(); ?.toNativeValue();
else { else {
// ignore: deprecated_member_use_from_same_package // ignore: deprecated_member_use_from_same_package
return (await _webview!.androidOnRenderProcessUnresponsive!( return (await _webview!.androidOnRenderProcessUnresponsive!(
this, uri)) this, uri))
?.toMap(); ?.toNativeValue();
} }
} else { } else {
return ((await _inAppBrowser!.onRenderProcessUnresponsive(uri)) ?? return ((await _inAppBrowser!.onRenderProcessUnresponsive(uri)) ??
(await _inAppBrowser! (await _inAppBrowser!
// ignore: deprecated_member_use_from_same_package // ignore: deprecated_member_use_from_same_package
.androidOnRenderProcessUnresponsive(uri))) .androidOnRenderProcessUnresponsive(uri)))
?.toMap(); ?.toNativeValue();
} }
} }
break; break;
@ -473,19 +473,19 @@ class InAppWebViewController {
if (_webview != null) { if (_webview != null) {
if (_webview!.onRenderProcessResponsive != null) if (_webview!.onRenderProcessResponsive != null)
return (await _webview!.onRenderProcessResponsive!(this, uri)) return (await _webview!.onRenderProcessResponsive!(this, uri))
?.toMap(); ?.toNativeValue();
else { else {
// ignore: deprecated_member_use_from_same_package // ignore: deprecated_member_use_from_same_package
return (await _webview!.androidOnRenderProcessResponsive!( return (await _webview!.androidOnRenderProcessResponsive!(
this, uri)) this, uri))
?.toMap(); ?.toNativeValue();
} }
} else { } else {
return ((await _inAppBrowser!.onRenderProcessResponsive(uri)) ?? return ((await _inAppBrowser!.onRenderProcessResponsive(uri)) ??
(await _inAppBrowser! (await _inAppBrowser!
// ignore: deprecated_member_use_from_same_package // ignore: deprecated_member_use_from_same_package
.androidOnRenderProcessResponsive(uri))) .androidOnRenderProcessResponsive(uri)))
?.toMap(); ?.toNativeValue();
} }
} }
break; break;
@ -957,19 +957,19 @@ class InAppWebViewController {
if (_webview!.shouldAllowDeprecatedTLS != null) if (_webview!.shouldAllowDeprecatedTLS != null)
return (await _webview!.shouldAllowDeprecatedTLS!( return (await _webview!.shouldAllowDeprecatedTLS!(
this, challenge)) this, challenge))
?.toMap(); ?.toNativeValue();
else { else {
// ignore: deprecated_member_use_from_same_package // ignore: deprecated_member_use_from_same_package
return (await _webview!.iosShouldAllowDeprecatedTLS!( return (await _webview!.iosShouldAllowDeprecatedTLS!(
this, challenge)) this, challenge))
?.toMap(); ?.toNativeValue();
} }
} else { } else {
return (await _inAppBrowser!.shouldAllowDeprecatedTLS(challenge)) return (await _inAppBrowser!.shouldAllowDeprecatedTLS(challenge))
?.toMap() ?? ?.toNativeValue() ??
// ignore: deprecated_member_use_from_same_package // ignore: deprecated_member_use_from_same_package
(await _inAppBrowser!.iosShouldAllowDeprecatedTLS(challenge)) (await _inAppBrowser!.iosShouldAllowDeprecatedTLS(challenge))
?.toMap(); ?.toNativeValue();
} }
} }
break; break;
@ -2281,7 +2281,7 @@ class InAppWebViewController {
///Prints the current page. ///Prints the current page.
/// ///
///To obtain the [PrintJobController], use [settings] argument with [PrintJobSettings.handledByClient] to `true`. ///To obtain the [PrintJobController], use [settings] argument with [PrintJobSettings.handledByClient] to `true`.
///Otherwise this method will return `null` and the [PrintJobController] will be handled and disposed automatically by the system. ///Otherwise this method will return `null` and the [PrintJobController] will be handled and disposed automatically by the system.
/// ///
///**NOTE**: available on Android 19+. ///**NOTE**: available on Android 19+.
/// ///
@ -2823,9 +2823,9 @@ class InAppWebViewController {
///[autoname] if `false`, takes [filePath] to be a file. ///[autoname] if `false`, takes [filePath] to be a file.
///If `true`, [filePath] is assumed to be a directory in which a filename will be chosen according to the URL of the current page. ///If `true`, [filePath] is assumed to be a directory in which a filename will be chosen according to the URL of the current page.
/// ///
///**NOTE for iOS**: Available on iOS 14.0+. If [autoname] is `false`, the [filePath] must ends with the [WebArchiveFormat.WEBARCHIVE] file extension. ///**NOTE for iOS**: Available on iOS 14.0+. If [autoname] is `false`, the [filePath] must ends with the [WebArchiveFormat.WEBARCHIVE] file extension.
/// ///
///**NOTE for Android**: if [autoname] is `false`, the [filePath] must ends with the [WebArchiveFormat.MHT] file extension. ///**NOTE for Android**: if [autoname] is `false`, the [filePath] must ends with the [WebArchiveFormat.MHT] file extension.
/// ///
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebView.saveWebArchive](https://developer.android.com/reference/android/webkit/WebView#saveWebArchive(java.lang.String,%20boolean,%20android.webkit.ValueCallback%3Cjava.lang.String%3E))) ///- Android native WebView ([Official API - WebView.saveWebArchive](https://developer.android.com/reference/android/webkit/WebView#saveWebArchive(java.lang.String,%20boolean,%20android.webkit.ValueCallback%3Cjava.lang.String%3E)))
@ -2834,9 +2834,9 @@ class InAppWebViewController {
{required String filePath, bool autoname = false}) async { {required String filePath, bool autoname = false}) async {
if (!autoname) { if (!autoname) {
if (defaultTargetPlatform == TargetPlatform.android) { if (defaultTargetPlatform == TargetPlatform.android) {
assert(filePath.endsWith("." + WebArchiveFormat.MHT.toValue())); assert(filePath.endsWith("." + WebArchiveFormat.MHT.toNativeValue()));
} else if (defaultTargetPlatform == TargetPlatform.iOS) { } else if (defaultTargetPlatform == TargetPlatform.iOS) {
assert(filePath.endsWith("." + WebArchiveFormat.WEBARCHIVE.toValue())); assert(filePath.endsWith("." + WebArchiveFormat.WEBARCHIVE.toNativeValue()));
} }
} }

View File

@ -916,8 +916,8 @@ class InAppWebViewSettings {
///- [InAppWebViewSettings.enableViewportScale] ///- [InAppWebViewSettings.enableViewportScale]
/// ///
///Events affected: ///Events affected:
///- the `hitTestResult` argument of [WebView.onLongPressHitTestResult] will be empty ///- the `hitTestResult` argument of [WebView.onLongPressHitTestResult] will be empty
///- the `hitTestResult` argument of [ContextMenu.onCreateContextMenu] will be empty ///- the `hitTestResult` argument of [ContextMenu.onCreateContextMenu] will be empty
///- [WebView.onLoadResource] ///- [WebView.onLoadResource]
///- [WebView.shouldInterceptAjaxRequest] ///- [WebView.shouldInterceptAjaxRequest]
///- [WebView.onAjaxReadyStateChange] ///- [WebView.onAjaxReadyStateChange]
@ -937,7 +937,7 @@ class InAppWebViewSettings {
///Used in combination with [WebView.initialUrlRequest] or [WebView.initialData] (using the `file://` scheme), it represents the URL from which to read the web content. ///Used in combination with [WebView.initialUrlRequest] or [WebView.initialData] (using the `file://` scheme), it represents the URL from which to read the web content.
///This URL must be a file-based URL (using the `file://` scheme). ///This URL must be a file-based URL (using the `file://` scheme).
///Specify the same value as the [URLRequest.url] if you are using it with the [WebView.initialUrlRequest] parameter or ///Specify the same value as the [URLRequest.url] if you are using it with the [WebView.initialUrlRequest] parameter or
///the [InAppWebViewInitialData.baseUrl] if you are using it with the [WebView.initialData] parameter to prevent WebView from reading any other content. ///the [InAppWebViewInitialData.baseUrl] if you are using it with the [WebView.initialData] parameter to prevent WebView from reading any other content.
///Specify a directory to give WebView permission to read additional files in the specified directory. ///Specify a directory to give WebView permission to read additional files in the specified directory.
/// ///
@ -1108,7 +1108,7 @@ class InAppWebViewSettings {
this.useHybridComposition = true, this.useHybridComposition = true,
this.useShouldInterceptRequest = false, this.useShouldInterceptRequest = false,
this.useOnRenderProcessGone = false, this.useOnRenderProcessGone = false,
this.overScrollMode = OverScrollMode.OVER_SCROLL_IF_CONTENT_SCROLLS, this.overScrollMode = OverScrollMode.IF_CONTENT_SCROLLS,
this.networkAvailable, this.networkAvailable,
this.scrollBarStyle = ScrollBarStyle.SCROLLBARS_INSIDE_OVERLAY, this.scrollBarStyle = ScrollBarStyle.SCROLLBARS_INSIDE_OVERLAY,
this.verticalScrollbarPosition = this.verticalScrollbarPosition =

View File

@ -6,7 +6,7 @@ import 'print_job_controller.dart';
///Class that represents the settings of a [PrintJobController]. ///Class that represents the settings of a [PrintJobController].
class PrintJobSettings { class PrintJobSettings {
///Set this to `true` to handle the [PrintJobController]. ///Set this to `true` to handle the [PrintJobController].
///Otherwise, it will be handled and disposed automatically by the system. ///Otherwise, it will be handled and disposed automatically by the system.
///The default value is `false`. ///The default value is `false`.
/// ///

View File

@ -4,7 +4,7 @@ final _contentWorldNameRegExp = RegExp(r'[\s]');
/// ///
///**NOTE for iOS**: available on iOS 14.0+. This class represents the native [WKContentWorld](https://developer.apple.com/documentation/webkit/wkcontentworld) class. ///**NOTE for iOS**: available on iOS 14.0+. This class represents the native [WKContentWorld](https://developer.apple.com/documentation/webkit/wkcontentworld) class.
/// ///
///**NOTE for Android**: it will create and append an `<iframe>` HTML element with `id` attribute equals to `flutter_inappwebview_[name]` ///**NOTE for Android**: it will create and append an `<iframe>` HTML element with `id` attribute equals to `flutter_inappwebview_[name]`
///to the webpage's content that contains only the inline `<script>` HTML elements in order to define a new scope of execution for JavaScript code. ///to the webpage's content that contains only the inline `<script>` HTML elements in order to define a new scope of execution for JavaScript code.
///Unfortunately, there isn't any other way to do it. ///Unfortunately, there isn't any other way to do it.
///There are some limitations: ///There are some limitations:

View File

@ -28,6 +28,9 @@ class LayoutInDisplayCutoutMode_ {
/// ///
///**NOTE**: available on Android 30+. ///**NOTE**: available on Android 30+.
static const ALWAYS = const LayoutInDisplayCutoutMode_._internal(3); static const ALWAYS = const LayoutInDisplayCutoutMode_._internal(3);
@ExchangeableObjectMethod(ignore: true)
static LayoutInDisplayCutoutMode_? fromNativeValue(int? value) {return null;}
} }
///Android-specific class representing the share state that should be applied to the custom tab. ///Android-specific class representing the share state that should be applied to the custom tab.
@ -62,4 +65,7 @@ class AndroidLayoutInDisplayCutoutMode_ {
/// ///
///**NOTE**: available on Android 30+. ///**NOTE**: available on Android 30+.
static const ALWAYS = const AndroidLayoutInDisplayCutoutMode_._internal(3); static const ALWAYS = const AndroidLayoutInDisplayCutoutMode_._internal(3);
@ExchangeableObjectMethod(ignore: true)
int toNativeValue() => 0;
} }

View File

@ -26,8 +26,8 @@ class MetaTag {
final instance = MetaTag( final instance = MetaTag(
name: map['name'], name: map['name'],
content: map['content'], content: map['content'],
attrs: map['attrs']?.forEach( attrs: map['attrs']
(e) => MetaTagAttribute.fromMap(e?.cast<String, dynamic>())!), ?.map((e) => MetaTagAttribute.fromMap(e?.cast<String, dynamic>())!),
); );
return instance; return instance;
} }

View File

@ -31,8 +31,8 @@ class PermissionRequest {
origin: Uri.parse(map['origin']), origin: Uri.parse(map['origin']),
frame: FrameInfo.fromMap(map['frame']?.cast<String, dynamic>()), frame: FrameInfo.fromMap(map['frame']?.cast<String, dynamic>()),
); );
instance.resources = map['resources'] instance.resources =
.forEach((e) => PermissionResourceType.fromNativeValue(e)!); map['resources'].map((e) => PermissionResourceType.fromNativeValue(e)!);
return instance; return instance;
} }

View File

@ -24,8 +24,8 @@ class PermissionResponse {
return null; return null;
} }
final instance = PermissionResponse(); final instance = PermissionResponse();
instance.resources = map['resources'] instance.resources =
.forEach((e) => PermissionResourceType.fromNativeValue(e)!); map['resources'].map((e) => PermissionResourceType.fromNativeValue(e)!);
instance.action = PermissionResponseAction.fromNativeValue(map['action']); instance.action = PermissionResponseAction.fromNativeValue(map['action']);
return instance; return instance;
} }

View File

@ -1,59 +1,37 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../in_app_webview/webview.dart'; import '../in_app_webview/webview.dart';
part 'should_allow_deprecated_tls_action.g.dart';
///Class that is used by [WebView.shouldAllowDeprecatedTLS] event. ///Class that is used by [WebView.shouldAllowDeprecatedTLS] event.
///It represents the policy to pass back to the decision handler. ///It represents the policy to pass back to the decision handler.
class ShouldAllowDeprecatedTLSAction { @ExchangeableEnum()
class ShouldAllowDeprecatedTLSAction_ {
// ignore: unused_field
final int _value; final int _value;
const ShouldAllowDeprecatedTLSAction_._internal(this._value);
const ShouldAllowDeprecatedTLSAction._internal(this._value);
///Gets [int] value.
int toValue() => _value;
///Cancel the navigation. ///Cancel the navigation.
static const CANCEL = const ShouldAllowDeprecatedTLSAction._internal(0); static const CANCEL = const ShouldAllowDeprecatedTLSAction_._internal(0);
///Allow the navigation to continue. ///Allow the navigation to continue.
static const ALLOW = const ShouldAllowDeprecatedTLSAction._internal(1); static const ALLOW = const ShouldAllowDeprecatedTLSAction_._internal(1);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
Map<String, dynamic> toMap() {
return {
"action": _value,
};
}
} }
///Class that is used by [WebView.shouldAllowDeprecatedTLS] event. ///Class that is used by [WebView.shouldAllowDeprecatedTLS] event.
///It represents the policy to pass back to the decision handler. ///It represents the policy to pass back to the decision handler.
///Use [ShouldAllowDeprecatedTLSAction] instead. ///Use [ShouldAllowDeprecatedTLSAction] instead.
@Deprecated("Use ShouldAllowDeprecatedTLSAction instead") @Deprecated("Use ShouldAllowDeprecatedTLSAction instead")
class IOSShouldAllowDeprecatedTLSAction { @ExchangeableEnum()
class IOSShouldAllowDeprecatedTLSAction_ {
// ignore: unused_field
final int _value; final int _value;
const IOSShouldAllowDeprecatedTLSAction_._internal(this._value);
const IOSShouldAllowDeprecatedTLSAction._internal(this._value);
///Gets [int] value.
int toValue() => _value;
///Cancel the navigation. ///Cancel the navigation.
static const CANCEL = const IOSShouldAllowDeprecatedTLSAction._internal(0); static const CANCEL = const IOSShouldAllowDeprecatedTLSAction_._internal(0);
///Allow the navigation to continue. ///Allow the navigation to continue.
static const ALLOW = const IOSShouldAllowDeprecatedTLSAction._internal(1); static const ALLOW = const IOSShouldAllowDeprecatedTLSAction_._internal(1);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
Map<String, dynamic> toMap() {
return {
"action": _value,
};
}
} }

View File

@ -0,0 +1,157 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'should_allow_deprecated_tls_action.dart';
// **************************************************************************
// ExchangeableEnumGenerator
// **************************************************************************
///Class that is used by [WebView.shouldAllowDeprecatedTLS] event.
///It represents the policy to pass back to the decision handler.
class ShouldAllowDeprecatedTLSAction {
final int _value;
final int _nativeValue;
const ShouldAllowDeprecatedTLSAction._internal(
this._value, this._nativeValue);
// ignore: unused_element
factory ShouldAllowDeprecatedTLSAction._internalMultiPlatform(
int value, Function nativeValue) =>
ShouldAllowDeprecatedTLSAction._internal(value, nativeValue());
///Cancel the navigation.
static const CANCEL = ShouldAllowDeprecatedTLSAction._internal(0, 0);
///Allow the navigation to continue.
static const ALLOW = ShouldAllowDeprecatedTLSAction._internal(1, 1);
///Set of all values of [ShouldAllowDeprecatedTLSAction].
static final Set<ShouldAllowDeprecatedTLSAction> values = [
ShouldAllowDeprecatedTLSAction.CANCEL,
ShouldAllowDeprecatedTLSAction.ALLOW,
].toSet();
///Gets a possible [ShouldAllowDeprecatedTLSAction] instance from [int] value.
static ShouldAllowDeprecatedTLSAction? fromValue(int? value) {
if (value != null) {
try {
return ShouldAllowDeprecatedTLSAction.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets a possible [ShouldAllowDeprecatedTLSAction] instance from a native value.
static ShouldAllowDeprecatedTLSAction? fromNativeValue(int? value) {
if (value != null) {
try {
return ShouldAllowDeprecatedTLSAction.values
.firstWhere((element) => element.toNativeValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [int] value.
int toValue() => _value;
///Gets [int] native value.
int toNativeValue() => _nativeValue;
@override
int get hashCode => _value.hashCode;
@override
bool operator ==(value) => value == _value;
@override
String toString() {
switch (_value) {
case 0:
return 'CANCEL';
case 1:
return 'ALLOW';
}
return _value.toString();
}
}
///Class that is used by [WebView.shouldAllowDeprecatedTLS] event.
///It represents the policy to pass back to the decision handler.
///Use [ShouldAllowDeprecatedTLSAction] instead.
@Deprecated('Use ShouldAllowDeprecatedTLSAction instead')
class IOSShouldAllowDeprecatedTLSAction {
final int _value;
final int _nativeValue;
const IOSShouldAllowDeprecatedTLSAction._internal(
this._value, this._nativeValue);
// ignore: unused_element
factory IOSShouldAllowDeprecatedTLSAction._internalMultiPlatform(
int value, Function nativeValue) =>
IOSShouldAllowDeprecatedTLSAction._internal(value, nativeValue());
///Cancel the navigation.
static const CANCEL = IOSShouldAllowDeprecatedTLSAction._internal(0, 0);
///Allow the navigation to continue.
static const ALLOW = IOSShouldAllowDeprecatedTLSAction._internal(1, 1);
///Set of all values of [IOSShouldAllowDeprecatedTLSAction].
static final Set<IOSShouldAllowDeprecatedTLSAction> values = [
IOSShouldAllowDeprecatedTLSAction.CANCEL,
IOSShouldAllowDeprecatedTLSAction.ALLOW,
].toSet();
///Gets a possible [IOSShouldAllowDeprecatedTLSAction] instance from [int] value.
static IOSShouldAllowDeprecatedTLSAction? fromValue(int? value) {
if (value != null) {
try {
return IOSShouldAllowDeprecatedTLSAction.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets a possible [IOSShouldAllowDeprecatedTLSAction] instance from a native value.
static IOSShouldAllowDeprecatedTLSAction? fromNativeValue(int? value) {
if (value != null) {
try {
return IOSShouldAllowDeprecatedTLSAction.values
.firstWhere((element) => element.toNativeValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [int] value.
int toValue() => _value;
///Gets [int] native value.
int toNativeValue() => _nativeValue;
@override
int get hashCode => _value.hashCode;
@override
bool operator ==(value) => value == _value;
@override
String toString() {
switch (_value) {
case 0:
return 'CANCEL';
case 1:
return 'ALLOW';
}
return _value.toString();
}
}

View File

@ -1,68 +1,30 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'ssl_error_type.dart'; import 'ssl_error_type.dart';
part 'ssl_error.g.dart';
///Class that represents an SSL Error. ///Class that represents an SSL Error.
class SslError { @ExchangeableObject()
class SslError_ {
///Use [code] instead. ///Use [code] instead.
@Deprecated('Use code instead') @Deprecated('Use code instead')
AndroidSslError? androidError; AndroidSslError_? androidError;
///Use [code] instead. ///Use [code] instead.
@Deprecated('Use code instead') @Deprecated('Use code instead')
IOSSslError? iosError; IOSSslError_? iosError;
///Primary code error associated to the server SSL certificate. ///Primary code error associated to the server SSL certificate.
///It represents the most severe SSL error. ///It represents the most severe SSL error.
SslErrorType? code; SslErrorType_? code;
///The message associated to the [code]. ///The message associated to the [code].
String? message; String? message;
SslError( SslError_(
{@Deprecated('Use code instead') this.androidError, {@Deprecated('Use code instead') this.androidError,
@Deprecated('Use code instead') this.iosError, @Deprecated('Use code instead') this.iosError,
this.code, this.code,
this.message}) { this.message}) {}
this.code = this.code ??
// ignore: deprecated_member_use_from_same_package
SslErrorType.fromNativeValue(this.androidError?.toValue() ??
// ignore: deprecated_member_use_from_same_package
this.iosError?.toValue());
}
///Gets a possible [SslError] instance from a [Map] value.
static SslError? fromMap(Map<String, dynamic>? map) {
if (map == null) {
return null;
}
return SslError(
// ignore: deprecated_member_use_from_same_package
androidError: AndroidSslError.fromValue(map["code"]),
// ignore: deprecated_member_use_from_same_package
iosError: IOSSslError.fromValue(map["code"]),
code: SslErrorType.fromNativeValue(map["code"]),
message: map["message"]);
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {
// ignore: deprecated_member_use_from_same_package
"androidError": code?.toNativeValue() ?? androidError?.toValue(),
// ignore: deprecated_member_use_from_same_package
"iosError": code?.toNativeValue() ?? iosError?.toValue(),
// ignore: deprecated_member_use_from_same_package
"code": code?.toNativeValue() ?? androidError?.toValue() ?? iosError?.toValue(),
"message": message,
};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return this.toMap();
}
@override
String toString() {
return toMap().toString();
}
} }

View File

@ -0,0 +1,65 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'ssl_error.dart';
// **************************************************************************
// ExchangeableObjectGenerator
// **************************************************************************
///Class that represents an SSL Error.
class SslError {
///Use [code] instead.
@Deprecated('Use code instead')
AndroidSslError? androidError;
///Use [code] instead.
@Deprecated('Use code instead')
IOSSslError? iosError;
///Primary code error associated to the server SSL certificate.
///It represents the most severe SSL error.
SslErrorType? code;
///The message associated to the [code].
String? message;
SslError(
{@Deprecated('Use code instead') this.androidError,
@Deprecated('Use code instead') this.iosError,
this.code,
this.message}) {
code = code ?? SslErrorType.fromNativeValue(androidError?.toNativeValue());
code = code ?? SslErrorType.fromNativeValue(iosError?.toNativeValue());
}
///Gets a possible [SslError] instance from a [Map] value.
static SslError? fromMap(Map<String, dynamic>? map) {
if (map == null) {
return null;
}
final instance = SslError(
androidError: AndroidSslError.fromNativeValue(map['code']),
iosError: IOSSslError.fromNativeValue(map['code']),
code: SslErrorType.fromNativeValue(map['code']),
message: map['message'],
);
return instance;
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {
"code": code?.toNativeValue(),
"message": message,
};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return toMap();
}
@override
String toString() {
return 'SslError{code: $code, message: $message}';
}
}

View File

@ -1,113 +1,85 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'server_trust_challenge.dart'; import 'server_trust_challenge.dart';
part 'ssl_error_type.g.dart';
///Class that represents the SSL Primary error associated to the server SSL certificate. ///Class that represents the SSL Primary error associated to the server SSL certificate.
///Used by the [ServerTrustChallenge] class. ///Used by the [ServerTrustChallenge] class.
class SslErrorType { @ExchangeableEnum()
class SslErrorType_ {
// ignore: unused_field
final String _value; final String _value;
final int _nativeValue; // ignore: unused_field
final int _nativeValue = -1;
const SslErrorType._internal(this._value, this._nativeValue); const SslErrorType_._internal(this._value);
///Set of all values of [SslErrorType].
static final Set<SslErrorType> values = [
SslErrorType.NOT_YET_VALID,
SslErrorType.EXPIRED,
SslErrorType.IDMISMATCH,
SslErrorType.UNTRUSTED,
SslErrorType.DATE_INVALID,
SslErrorType.INVALID,
SslErrorType.DENY,
SslErrorType.UNSPECIFIED,
SslErrorType.RECOVERABLE_TRUST_FAILURE,
SslErrorType.FATAL_TRUST_FAILURE,
SslErrorType.OTHER_ERROR,
].toSet();
///Gets a possible [SslErrorType] instance from a [String] value.
static SslErrorType? fromValue(String? value) {
if (value != null) {
try {
return SslErrorType.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets a possible [SslErrorType] instance from a native value.
static SslErrorType? fromNativeValue(int? value) {
if (value != null) {
try {
return SslErrorType.values
.firstWhere((element) => element.toNativeValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [String] value.
String toValue() => _value;
///Gets native [int] value.
int toNativeValue() => _nativeValue;
@override
String toString() => _value;
///The certificate is not yet valid. ///The certificate is not yet valid.
/// @EnumSupportedPlatforms(platforms: [
///**Supported Platforms/Implementations**: EnumAndroidPlatform(
///- Android native WebView ([Official API - SslError.SSL_NOTYETVALID](https://developer.android.com/reference/android/net/http/SslError#SSL_NOTYETVALID)) apiName: 'SslError.SSL_NOTYETVALID',
static final NOT_YET_VALID = SslErrorType._internal('NOT_YET_VALID', apiUrl: 'https://developer.android.com/reference/android/net/http/SslError#SSL_NOTYETVALID',
(defaultTargetPlatform == TargetPlatform.android) ? 0 : -1); value: 0
)
])
static const NOT_YET_VALID = SslErrorType_._internal('NOT_YET_VALID');
///The certificate has expired. ///The certificate has expired.
/// @EnumSupportedPlatforms(platforms: [
///**Supported Platforms/Implementations**: EnumAndroidPlatform(
///- Android native WebView ([Official API - SslError.SSL_EXPIRED](https://developer.android.com/reference/android/net/http/SslError#SSL_EXPIRED)) apiName: 'SslError.SSL_EXPIRED',
static final EXPIRED = SslErrorType._internal( apiUrl: 'https://developer.android.com/reference/android/net/http/SslError#SSL_EXPIRED',
'EXPIRED', (defaultTargetPlatform == TargetPlatform.android) ? 1 : -1); value: 1
)
])
static const EXPIRED = SslErrorType_._internal('EXPIRED');
///Hostname mismatch. ///Hostname mismatch.
/// @EnumSupportedPlatforms(platforms: [
///**Supported Platforms/Implementations**: EnumAndroidPlatform(
///- Android native WebView ([Official API - SslError.SSL_IDMISMATCH](https://developer.android.com/reference/android/net/http/SslError#SSL_IDMISMATCH)) apiName: 'SslError.SSL_IDMISMATCH',
static final IDMISMATCH = SslErrorType._internal( apiUrl: 'https://developer.android.com/reference/android/net/http/SslError#SSL_IDMISMATCH',
'IDMISMATCH', (defaultTargetPlatform == TargetPlatform.android) ? 2 : -1); value: 2
)
])
static const IDMISMATCH = SslErrorType_._internal('IDMISMATCH');
///The certificate authority is not trusted. ///The certificate authority is not trusted.
/// @EnumSupportedPlatforms(platforms: [
///**Supported Platforms/Implementations**: EnumAndroidPlatform(
///- Android native WebView ([Official API - SslError.SSL_UNTRUSTED](https://developer.android.com/reference/android/net/http/SslError#SSL_UNTRUSTED)) apiName: 'SslError.SSL_UNTRUSTED',
static final UNTRUSTED = SslErrorType._internal( apiUrl: 'https://developer.android.com/reference/android/net/http/SslError#SSL_UNTRUSTED',
'UNTRUSTED', (defaultTargetPlatform == TargetPlatform.android) ? 3 : -1); value: 3
)
])
static const UNTRUSTED = SslErrorType_._internal('UNTRUSTED');
///The date of the certificate is invalid. ///The date of the certificate is invalid.
/// @EnumSupportedPlatforms(platforms: [
///**Supported Platforms/Implementations**: EnumAndroidPlatform(
///- Android native WebView ([Official API - SslError.SSL_DATE_INVALID](https://developer.android.com/reference/android/net/http/SslError#SSL_DATE_INVALID)) apiName: 'SslError.DATE_INVALID',
static final DATE_INVALID = SslErrorType._internal('DATE_INVALID', apiUrl: 'https://developer.android.com/reference/android/net/http/SslError#SSL_DATE_INVALID',
(defaultTargetPlatform == TargetPlatform.android) ? 4 : -1); value: 4
)
])
static const DATE_INVALID = SslErrorType_._internal('DATE_INVALID');
///Indicates an invalid setting or result. A generic error occurred. ///Indicates an invalid setting or result. A generic error occurred.
/// @EnumSupportedPlatforms(platforms: [
///**Supported Platforms/Implementations**: EnumAndroidPlatform(
///- Android native WebView ([Official API - SslError.SSL_INVALID](https://developer.android.com/reference/android/net/http/SslError#SSL_INVALID)) apiName: 'SslError.SSL_INVALID',
///- iOS ([Official API - SecTrustResultType.invalid](https://developer.apple.com/documentation/security/sectrustresulttype/invalid)) apiUrl: 'https://developer.android.com/reference/android/net/http/SslError#SSL_INVALID',
static final INVALID = SslErrorType._internal( value: 5
'INVALID', ),
(defaultTargetPlatform == TargetPlatform.android) EnumIOSPlatform(
? 5 apiName: 'SecTrustResultType.invalid',
: ((defaultTargetPlatform == TargetPlatform.iOS || apiUrl: 'https://developer.apple.com/documentation/security/sectrustresulttype/invalid',
defaultTargetPlatform == TargetPlatform.macOS) value: 0
? 0 )
: -1)); ])
static const INVALID = SslErrorType_._internal('INVALID');
///The user specified that the certificate should not be trusted. ///The user specified that the certificate should not be trusted.
/// ///
@ -115,15 +87,14 @@ class SslErrorType {
///usually by clicking the appropriate button in a certificate trust panel. ///usually by clicking the appropriate button in a certificate trust panel.
///Your app should not trust the chain. ///Your app should not trust the chain.
///The Keychain Access utility refers to this value as "Never Trust." ///The Keychain Access utility refers to this value as "Never Trust."
/// @EnumSupportedPlatforms(platforms: [
///**Supported Platforms/Implementations**: EnumIOSPlatform(
///- iOS ([Official API - SecTrustResultType.deny](https://developer.apple.com/documentation/security/sectrustresulttype/deny)) apiName: 'SecTrustResultType.deny',
static final DENY = SslErrorType._internal( apiUrl: 'https://developer.apple.com/documentation/security/sectrustresulttype/deny',
'DENY', value: 3
(defaultTargetPlatform == TargetPlatform.iOS || )
defaultTargetPlatform == TargetPlatform.macOS) ])
? 3 static const DENY = SslErrorType_._internal('DENY');
: -1);
///Indicates the evaluation succeeded and the certificate is implicitly trusted, but user intent was not explicitly specified. ///Indicates the evaluation succeeded and the certificate is implicitly trusted, but user intent was not explicitly specified.
/// ///
@ -133,15 +104,14 @@ class SslErrorType {
///The Keychain Access utility refers to this value as the Use System Policy, which is the default user setting. ///The Keychain Access utility refers to this value as the Use System Policy, which is the default user setting.
/// ///
///When receiving this value, most apps should trust the chain. ///When receiving this value, most apps should trust the chain.
/// @EnumSupportedPlatforms(platforms: [
///**Supported Platforms/Implementations**: EnumIOSPlatform(
///- iOS ([Official API - SecTrustResultType.unspecified](https://developer.apple.com/documentation/security/sectrustresulttype/unspecified)) apiName: 'SecTrustResultType.unspecified',
static final UNSPECIFIED = SslErrorType._internal( apiUrl: 'https://developer.apple.com/documentation/security/sectrustresulttype/unspecified',
'UNSPECIFIED', value: 4
(defaultTargetPlatform == TargetPlatform.iOS || )
defaultTargetPlatform == TargetPlatform.macOS) ])
? 4 static const UNSPECIFIED = SslErrorType_._internal('UNSPECIFIED');
: -1);
///Trust is denied, but recovery may be possible. ///Trust is denied, but recovery may be possible.
/// ///
@ -152,15 +122,14 @@ class SslErrorType {
///The way you handle this depends on the situation. ///The way you handle this depends on the situation.
///For example, if you are performing signature validation and you know when the message was originally received, ///For example, if you are performing signature validation and you know when the message was originally received,
///you should check again using that date to see if the message was valid when you originally received it. ///you should check again using that date to see if the message was valid when you originally received it.
/// @EnumSupportedPlatforms(platforms: [
///**Supported Platforms/Implementations**: EnumIOSPlatform(
///- iOS ([Official API - SecTrustResultType.recoverableTrustFailure](https://developer.apple.com/documentation/security/sectrustresulttype/recoverabletrustfailure)) apiName: 'SecTrustResultType.recoverableTrustFailure',
static final RECOVERABLE_TRUST_FAILURE = SslErrorType._internal( apiUrl: 'https://developer.apple.com/documentation/security/sectrustresulttype/recoverabletrustfailure',
'RECOVERABLE_TRUST_FAILURE', value: 5
(defaultTargetPlatform == TargetPlatform.iOS || )
defaultTargetPlatform == TargetPlatform.macOS) ])
? 5 static const RECOVERABLE_TRUST_FAILURE = SslErrorType_._internal('RECOVERABLE_TRUST_FAILURE');
: -1);
///Trust is denied and no simple fix is available. ///Trust is denied and no simple fix is available.
/// ///
@ -168,188 +137,84 @@ class SslErrorType {
///This usually represents a fundamental defect in the certificate data, such as an invalid encoding for a critical subjectAltName extension, ///This usually represents a fundamental defect in the certificate data, such as an invalid encoding for a critical subjectAltName extension,
///an unsupported critical extension, or some other critical portion of the certificate that couldnt be interpreted. ///an unsupported critical extension, or some other critical portion of the certificate that couldnt be interpreted.
///Changing parameter values and reevaluating is unlikely to succeed unless you provide different certificates. ///Changing parameter values and reevaluating is unlikely to succeed unless you provide different certificates.
/// @EnumSupportedPlatforms(platforms: [
///**Supported Platforms/Implementations**: EnumIOSPlatform(
///- iOS ([Official API - SecTrustResultType.fatalTrustFailure](https://developer.apple.com/documentation/security/sectrustresulttype/fataltrustfailure)) apiName: 'SecTrustResultType.fatalTrustFailure',
static final FATAL_TRUST_FAILURE = SslErrorType._internal( apiUrl: 'https://developer.apple.com/documentation/security/sectrustresulttype/fataltrustfailure',
'FATAL_TRUST_FAILURE', value: 6
(defaultTargetPlatform == TargetPlatform.iOS || )
defaultTargetPlatform == TargetPlatform.macOS) ])
? 6 static const FATAL_TRUST_FAILURE = SslErrorType_._internal('FATAL_TRUST_FAILURE');
: -1);
///Indicates a failure other than that of trust evaluation. ///Indicates a failure other than that of trust evaluation.
/// ///
///This value indicates that evaluation failed for some other reason. ///This value indicates that evaluation failed for some other reason.
///This can be caused by either a revoked certificate or by OS-level errors that are unrelated to the certificates themselves. ///This can be caused by either a revoked certificate or by OS-level errors that are unrelated to the certificates themselves.
/// @EnumSupportedPlatforms(platforms: [
///**Supported Platforms/Implementations**: EnumIOSPlatform(
///- iOS ([Official API - SecTrustResultType.otherError](https://developer.apple.com/documentation/security/sectrustresulttype/othererror)) apiName: 'SecTrustResultType.otherError',
static final OTHER_ERROR = SslErrorType._internal( apiUrl: 'https://developer.apple.com/documentation/security/sectrustresulttype/othererror',
'OTHER_ERROR', value: 7
(defaultTargetPlatform == TargetPlatform.iOS || )
defaultTargetPlatform == TargetPlatform.macOS) ])
? 7 static const OTHER_ERROR = SslErrorType_._internal('OTHER_ERROR');
: -1);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///Class that represents the Android-specific primary error associated to the server SSL certificate. ///Class that represents the Android-specific primary error associated to the server SSL certificate.
///Used by the [ServerTrustChallenge] class. ///Used by the [ServerTrustChallenge] class.
///Use [SslErrorType] instead. ///Use [SslErrorType] instead.
@Deprecated("Use SslErrorType instead") @Deprecated("Use SslErrorType instead")
class AndroidSslError { @ExchangeableEnum()
class AndroidSslError_ {
// ignore: unused_field
final int _value; final int _value;
const AndroidSslError_._internal(this._value);
const AndroidSslError._internal(this._value);
///Set of all values of [AndroidSslError].
static final Set<AndroidSslError> values = [
AndroidSslError.SSL_NOTYETVALID,
AndroidSslError.SSL_EXPIRED,
AndroidSslError.SSL_IDMISMATCH,
AndroidSslError.SSL_UNTRUSTED,
AndroidSslError.SSL_DATE_INVALID,
AndroidSslError.SSL_INVALID,
].toSet();
///Gets a possible [AndroidSslError] instance from an [int] value.
static AndroidSslError? fromValue(int? value) {
if (value != null) {
try {
return AndroidSslError.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [int] value.
int toValue() => _value;
@override
String toString() {
switch (_value) {
case 1:
return "SSL_EXPIRED";
case 2:
return "SSL_IDMISMATCH";
case 3:
return "SSL_UNTRUSTED";
case 4:
return "SSL_DATE_INVALID";
case 5:
return "SSL_INVALID";
case 0:
default:
return "SSL_NOTYETVALID";
}
}
///The certificate is not yet valid ///The certificate is not yet valid
static const SSL_NOTYETVALID = const AndroidSslError._internal(0); static const SSL_NOTYETVALID = const AndroidSslError_._internal(0);
///The certificate has expired ///The certificate has expired
static const SSL_EXPIRED = const AndroidSslError._internal(1); static const SSL_EXPIRED = const AndroidSslError_._internal(1);
///Hostname mismatch ///Hostname mismatch
static const SSL_IDMISMATCH = const AndroidSslError._internal(2); static const SSL_IDMISMATCH = const AndroidSslError_._internal(2);
///The certificate authority is not trusted ///The certificate authority is not trusted
static const SSL_UNTRUSTED = const AndroidSslError._internal(3); static const SSL_UNTRUSTED = const AndroidSslError_._internal(3);
///The date of the certificate is invalid ///The date of the certificate is invalid
static const SSL_DATE_INVALID = const AndroidSslError._internal(4); static const SSL_DATE_INVALID = const AndroidSslError_._internal(4);
///A generic error occurred ///A generic error occurred
static const SSL_INVALID = const AndroidSslError._internal(5); static const SSL_INVALID = const AndroidSslError_._internal(5);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///Class that represents the iOS-specific primary error associated to the server SSL certificate. ///Class that represents the iOS-specific primary error associated to the server SSL certificate.
///Used by the [ServerTrustChallenge] class. ///Used by the [ServerTrustChallenge] class.
///Use [SslErrorType] instead. ///Use [SslErrorType] instead.
@Deprecated("Use SslErrorType instead") @Deprecated("Use SslErrorType instead")
class IOSSslError { @ExchangeableEnum()
class IOSSslError_ {
// ignore: unused_field
final int _value; final int _value;
const IOSSslError._internal(this._value); const IOSSslError_._internal(this._value);
///Set of all values of [IOSSslError].
static final Set<IOSSslError> values = [
IOSSslError.INVALID,
IOSSslError.DENY,
IOSSslError.UNSPECIFIED,
IOSSslError.RECOVERABLE_TRUST_FAILURE,
IOSSslError.FATAL_TRUST_FAILURE,
IOSSslError.OTHER_ERROR,
].toSet();
///Gets a possible [IOSSslError] instance from an [int] value.
static IOSSslError? fromValue(int? value) {
if (value != null) {
try {
return IOSSslError.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [int] value.
int toValue() => _value;
@override
String toString() {
switch (_value) {
case 3:
return "DENY";
case 4:
return "UNSPECIFIED";
case 5:
return "RECOVERABLE_TRUST_FAILURE";
case 6:
return "FATAL_TRUST_FAILURE";
case 7:
return "OTHER_ERROR";
case 0:
default:
return "INVALID";
}
}
///Indicates an invalid setting or result. ///Indicates an invalid setting or result.
static const INVALID = const IOSSslError._internal(0); static const INVALID = const IOSSslError_._internal(0);
///Indicates a user-configured deny; do not proceed. ///Indicates a user-configured deny; do not proceed.
static const DENY = const IOSSslError._internal(3); static const DENY = const IOSSslError_._internal(3);
///Indicates the evaluation succeeded and the certificate is implicitly trusted, but user intent was not explicitly specified. ///Indicates the evaluation succeeded and the certificate is implicitly trusted, but user intent was not explicitly specified.
static const UNSPECIFIED = const IOSSslError._internal(4); static const UNSPECIFIED = const IOSSslError_._internal(4);
///Indicates a trust policy failure which can be overridden by the user. ///Indicates a trust policy failure which can be overridden by the user.
static const RECOVERABLE_TRUST_FAILURE = const IOSSslError._internal(5); static const RECOVERABLE_TRUST_FAILURE = const IOSSslError_._internal(5);
///Indicates a trust failure which cannot be overridden by the user. ///Indicates a trust failure which cannot be overridden by the user.
static const FATAL_TRUST_FAILURE = const IOSSslError._internal(6); static const FATAL_TRUST_FAILURE = const IOSSslError_._internal(6);
///Indicates a failure other than that of trust evaluation. ///Indicates a failure other than that of trust evaluation.
static const OTHER_ERROR = const IOSSslError._internal(7); static const OTHER_ERROR = const IOSSslError_._internal(7);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }

View File

@ -0,0 +1,466 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'ssl_error_type.dart';
// **************************************************************************
// ExchangeableEnumGenerator
// **************************************************************************
///Class that represents the SSL Primary error associated to the server SSL certificate.
///Used by the [ServerTrustChallenge] class.
class SslErrorType {
final String _value;
final int _nativeValue;
const SslErrorType._internal(this._value, this._nativeValue);
// ignore: unused_element
factory SslErrorType._internalMultiPlatform(
String value, Function nativeValue) =>
SslErrorType._internal(value, nativeValue());
///The certificate is not yet valid.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - SslError.SSL_NOTYETVALID](https://developer.android.com/reference/android/net/http/SslError#SSL_NOTYETVALID))
static final NOT_YET_VALID =
SslErrorType._internalMultiPlatform('NOT_YET_VALID', () {
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return 0;
default:
break;
}
return null;
});
///The certificate has expired.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - SslError.SSL_EXPIRED](https://developer.android.com/reference/android/net/http/SslError#SSL_EXPIRED))
static final EXPIRED = SslErrorType._internalMultiPlatform('EXPIRED', () {
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return 1;
default:
break;
}
return null;
});
///Hostname mismatch.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - SslError.SSL_IDMISMATCH](https://developer.android.com/reference/android/net/http/SslError#SSL_IDMISMATCH))
static final IDMISMATCH =
SslErrorType._internalMultiPlatform('IDMISMATCH', () {
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return 2;
default:
break;
}
return null;
});
///The certificate authority is not trusted.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - SslError.SSL_UNTRUSTED](https://developer.android.com/reference/android/net/http/SslError#SSL_UNTRUSTED))
static final UNTRUSTED = SslErrorType._internalMultiPlatform('UNTRUSTED', () {
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return 3;
default:
break;
}
return null;
});
///The date of the certificate is invalid.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - SslError.DATE_INVALID](https://developer.android.com/reference/android/net/http/SslError#SSL_DATE_INVALID))
static final DATE_INVALID =
SslErrorType._internalMultiPlatform('DATE_INVALID', () {
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return 4;
default:
break;
}
return null;
});
///Indicates an invalid setting or result. A generic error occurred.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - SslError.SSL_INVALID](https://developer.android.com/reference/android/net/http/SslError#SSL_INVALID))
///- iOS ([Official API - SecTrustResultType.invalid](https://developer.apple.com/documentation/security/sectrustresulttype/invalid))
static final INVALID = SslErrorType._internalMultiPlatform('INVALID', () {
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return 5;
case TargetPlatform.iOS:
return 0;
default:
break;
}
return null;
});
///The user specified that the certificate should not be trusted.
///
///This value indicates that the user explicitly chose to not trust a certificate in the chain,
///usually by clicking the appropriate button in a certificate trust panel.
///Your app should not trust the chain.
///The Keychain Access utility refers to this value as "Never Trust."
///
///**Supported Platforms/Implementations**:
///- iOS ([Official API - SecTrustResultType.deny](https://developer.apple.com/documentation/security/sectrustresulttype/deny))
static final DENY = SslErrorType._internalMultiPlatform('DENY', () {
switch (defaultTargetPlatform) {
case TargetPlatform.iOS:
return 3;
default:
break;
}
return null;
});
///Indicates the evaluation succeeded and the certificate is implicitly trusted, but user intent was not explicitly specified.
///
///This value indicates that evaluation reached an (implicitly trusted) anchor certificate without any evaluation failures,
///but never encountered any explicitly stated user-trust preference.
///This is the most common return value.
///The Keychain Access utility refers to this value as the Use System Policy, which is the default user setting.
///
///When receiving this value, most apps should trust the chain.
///
///**Supported Platforms/Implementations**:
///- iOS ([Official API - SecTrustResultType.unspecified](https://developer.apple.com/documentation/security/sectrustresulttype/unspecified))
static final UNSPECIFIED =
SslErrorType._internalMultiPlatform('UNSPECIFIED', () {
switch (defaultTargetPlatform) {
case TargetPlatform.iOS:
return 4;
default:
break;
}
return null;
});
///Trust is denied, but recovery may be possible.
///
///This value indicates that you should not trust the chain as is,
///but that the chain could be trusted with some minor change to the evaluation context,
///such as ignoring expired certificates or adding another anchor to the set of trusted anchors.
///
///The way you handle this depends on the situation.
///For example, if you are performing signature validation and you know when the message was originally received,
///you should check again using that date to see if the message was valid when you originally received it.
///
///**Supported Platforms/Implementations**:
///- iOS ([Official API - SecTrustResultType.recoverableTrustFailure](https://developer.apple.com/documentation/security/sectrustresulttype/recoverabletrustfailure))
static final RECOVERABLE_TRUST_FAILURE =
SslErrorType._internalMultiPlatform('RECOVERABLE_TRUST_FAILURE', () {
switch (defaultTargetPlatform) {
case TargetPlatform.iOS:
return 5;
default:
break;
}
return null;
});
///Trust is denied and no simple fix is available.
///
///This value indicates that evaluation failed because a certificate in the chain is defective.
///This usually represents a fundamental defect in the certificate data, such as an invalid encoding for a critical subjectAltName extension,
///an unsupported critical extension, or some other critical portion of the certificate that couldnt be interpreted.
///Changing parameter values and reevaluating is unlikely to succeed unless you provide different certificates.
///
///**Supported Platforms/Implementations**:
///- iOS ([Official API - SecTrustResultType.fatalTrustFailure](https://developer.apple.com/documentation/security/sectrustresulttype/fataltrustfailure))
static final FATAL_TRUST_FAILURE =
SslErrorType._internalMultiPlatform('FATAL_TRUST_FAILURE', () {
switch (defaultTargetPlatform) {
case TargetPlatform.iOS:
return 6;
default:
break;
}
return null;
});
///Indicates a failure other than that of trust evaluation.
///
///This value indicates that evaluation failed for some other reason.
///This can be caused by either a revoked certificate or by OS-level errors that are unrelated to the certificates themselves.
///
///**Supported Platforms/Implementations**:
///- iOS ([Official API - SecTrustResultType.otherError](https://developer.apple.com/documentation/security/sectrustresulttype/othererror))
static final OTHER_ERROR =
SslErrorType._internalMultiPlatform('OTHER_ERROR', () {
switch (defaultTargetPlatform) {
case TargetPlatform.iOS:
return 7;
default:
break;
}
return null;
});
///Set of all values of [SslErrorType].
static final Set<SslErrorType> values = [
SslErrorType.NOT_YET_VALID,
SslErrorType.EXPIRED,
SslErrorType.IDMISMATCH,
SslErrorType.UNTRUSTED,
SslErrorType.DATE_INVALID,
SslErrorType.INVALID,
SslErrorType.DENY,
SslErrorType.UNSPECIFIED,
SslErrorType.RECOVERABLE_TRUST_FAILURE,
SslErrorType.FATAL_TRUST_FAILURE,
SslErrorType.OTHER_ERROR,
].toSet();
///Gets a possible [SslErrorType] instance from [String] value.
static SslErrorType? fromValue(String? value) {
if (value != null) {
try {
return SslErrorType.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets a possible [SslErrorType] instance from a native value.
static SslErrorType? fromNativeValue(int? value) {
if (value != null) {
try {
return SslErrorType.values
.firstWhere((element) => element.toNativeValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [String] value.
String toValue() => _value;
///Gets [int] native value.
int toNativeValue() => _nativeValue;
@override
int get hashCode => _value.hashCode;
@override
bool operator ==(value) => value == _value;
@override
String toString() {
return _value;
}
}
///Class that represents the Android-specific primary error associated to the server SSL certificate.
///Used by the [ServerTrustChallenge] class.
///Use [SslErrorType] instead.
@Deprecated('Use SslErrorType instead')
class AndroidSslError {
final int _value;
final int _nativeValue;
const AndroidSslError._internal(this._value, this._nativeValue);
// ignore: unused_element
factory AndroidSslError._internalMultiPlatform(
int value, Function nativeValue) =>
AndroidSslError._internal(value, nativeValue());
///The certificate is not yet valid
static const SSL_NOTYETVALID = AndroidSslError._internal(0, 0);
///The certificate has expired
static const SSL_EXPIRED = AndroidSslError._internal(1, 1);
///Hostname mismatch
static const SSL_IDMISMATCH = AndroidSslError._internal(2, 2);
///The certificate authority is not trusted
static const SSL_UNTRUSTED = AndroidSslError._internal(3, 3);
///The date of the certificate is invalid
static const SSL_DATE_INVALID = AndroidSslError._internal(4, 4);
///A generic error occurred
static const SSL_INVALID = AndroidSslError._internal(5, 5);
///Set of all values of [AndroidSslError].
static final Set<AndroidSslError> values = [
AndroidSslError.SSL_NOTYETVALID,
AndroidSslError.SSL_EXPIRED,
AndroidSslError.SSL_IDMISMATCH,
AndroidSslError.SSL_UNTRUSTED,
AndroidSslError.SSL_DATE_INVALID,
AndroidSslError.SSL_INVALID,
].toSet();
///Gets a possible [AndroidSslError] instance from [int] value.
static AndroidSslError? fromValue(int? value) {
if (value != null) {
try {
return AndroidSslError.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets a possible [AndroidSslError] instance from a native value.
static AndroidSslError? fromNativeValue(int? value) {
if (value != null) {
try {
return AndroidSslError.values
.firstWhere((element) => element.toNativeValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [int] value.
int toValue() => _value;
///Gets [int] native value.
int toNativeValue() => _nativeValue;
@override
int get hashCode => _value.hashCode;
@override
bool operator ==(value) => value == _value;
@override
String toString() {
switch (_value) {
case 0:
return 'SSL_NOTYETVALID';
case 1:
return 'SSL_EXPIRED';
case 2:
return 'SSL_IDMISMATCH';
case 3:
return 'SSL_UNTRUSTED';
case 4:
return 'SSL_DATE_INVALID';
case 5:
return 'SSL_INVALID';
}
return _value.toString();
}
}
///Class that represents the iOS-specific primary error associated to the server SSL certificate.
///Used by the [ServerTrustChallenge] class.
///Use [SslErrorType] instead.
@Deprecated('Use SslErrorType instead')
class IOSSslError {
final int _value;
final int _nativeValue;
const IOSSslError._internal(this._value, this._nativeValue);
// ignore: unused_element
factory IOSSslError._internalMultiPlatform(int value, Function nativeValue) =>
IOSSslError._internal(value, nativeValue());
///Indicates an invalid setting or result.
static const INVALID = IOSSslError._internal(0, 0);
///Indicates a user-configured deny; do not proceed.
static const DENY = IOSSslError._internal(3, 3);
///Indicates the evaluation succeeded and the certificate is implicitly trusted, but user intent was not explicitly specified.
static const UNSPECIFIED = IOSSslError._internal(4, 4);
///Indicates a trust policy failure which can be overridden by the user.
static const RECOVERABLE_TRUST_FAILURE = IOSSslError._internal(5, 5);
///Indicates a trust failure which cannot be overridden by the user.
static const FATAL_TRUST_FAILURE = IOSSslError._internal(6, 6);
///Indicates a failure other than that of trust evaluation.
static const OTHER_ERROR = IOSSslError._internal(7, 7);
///Set of all values of [IOSSslError].
static final Set<IOSSslError> values = [
IOSSslError.INVALID,
IOSSslError.DENY,
IOSSslError.UNSPECIFIED,
IOSSslError.RECOVERABLE_TRUST_FAILURE,
IOSSslError.FATAL_TRUST_FAILURE,
IOSSslError.OTHER_ERROR,
].toSet();
///Gets a possible [IOSSslError] instance from [int] value.
static IOSSslError? fromValue(int? value) {
if (value != null) {
try {
return IOSSslError.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets a possible [IOSSslError] instance from a native value.
static IOSSslError? fromNativeValue(int? value) {
if (value != null) {
try {
return IOSSslError.values
.firstWhere((element) => element.toNativeValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [int] value.
int toValue() => _value;
///Gets [int] native value.
int toNativeValue() => _nativeValue;
@override
int get hashCode => _value.hashCode;
@override
bool operator ==(value) => value == _value;
@override
String toString() {
switch (_value) {
case 0:
return 'INVALID';
case 3:
return 'DENY';
case 4:
return 'UNSPECIFIED';
case 5:
return 'RECOVERABLE_TRUST_FAILURE';
case 6:
return 'FATAL_TRUST_FAILURE';
case 7:
return 'OTHER_ERROR';
}
return _value.toString();
}
}

View File

@ -1,23 +1,23 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'trusted_web_activity_display_mode.dart'; import 'trusted_web_activity_display_mode.dart';
part 'trusted_web_activity_default_display_mode.g.dart';
///Class that represents the default display mode of a Trusted Web Activity. ///Class that represents the default display mode of a Trusted Web Activity.
///The system UI (status bar, navigation bar) is shown, and the browser toolbar is hidden while the user is on a verified origin. ///The system UI (status bar, navigation bar) is shown, and the browser toolbar is hidden while the user is on a verified origin.
class TrustedWebActivityDefaultDisplayMode @ExchangeableObject(fromMapFactory: false)
implements TrustedWebActivityDisplayMode { class TrustedWebActivityDefaultDisplayMode_
String _type = "DEFAULT_MODE"; implements TrustedWebActivityDisplayMode_ {
static final _type = "DEFAULT_MODE";
///Converts instance to a map. @ExchangeableObjectMethod(toMapMergeWith: true)
Map<String, dynamic> toMap() { // ignore: unused_element
Map<String, dynamic> _toMapMergeWith() {
return {"type": _type}; return {"type": _type};
} }
///Converts instance to a map.
Map<String, dynamic> toJson() {
return this.toMap();
}
@override @override
String toString() { @ExchangeableObjectMethod(ignore: true)
return toMap().toString(); dynamic noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
}
} }

View File

@ -0,0 +1,36 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'trusted_web_activity_default_display_mode.dart';
// **************************************************************************
// ExchangeableObjectGenerator
// **************************************************************************
///Class that represents the default display mode of a Trusted Web Activity.
///The system UI (status bar, navigation bar) is shown, and the browser toolbar is hidden while the user is on a verified origin.
class TrustedWebActivityDefaultDisplayMode
implements TrustedWebActivityDisplayMode {
static final String _type = "DEFAULT_MODE";
TrustedWebActivityDefaultDisplayMode();
@ExchangeableObjectMethod(toMapMergeWith: true)
Map<String, dynamic> _toMapMergeWith() {
return {"type": _type};
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {
..._toMapMergeWith(),
};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return toMap();
}
@override
String toString() {
return 'TrustedWebActivityDefaultDisplayMode{}';
}
}

View File

@ -1,17 +1,9 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'trusted_web_activity_display_mode.g.dart';
///Class that represents display mode of a Trusted Web Activity. ///Class that represents display mode of a Trusted Web Activity.
abstract class TrustedWebActivityDisplayMode { @ExchangeableObject(fromMapFactory: false)
///Converts instance to a map. abstract class TrustedWebActivityDisplayMode_ {
Map<String, dynamic> toMap() {
return {};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return this.toMap();
}
@override
String toString() {
return toMap().toString();
}
} }

View File

@ -0,0 +1,27 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'trusted_web_activity_display_mode.dart';
// **************************************************************************
// ExchangeableObjectGenerator
// **************************************************************************
///Class that represents display mode of a Trusted Web Activity.
abstract class TrustedWebActivityDisplayMode {
TrustedWebActivityDisplayMode();
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return toMap();
}
@override
String toString() {
return 'TrustedWebActivityDisplayMode{}';
}
}

View File

@ -1,64 +1,45 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'trusted_web_activity_display_mode.dart'; import 'trusted_web_activity_display_mode.dart';
import 'layout_in_display_cutout_mode.dart'; import 'layout_in_display_cutout_mode.dart';
part 'trusted_web_activity_immersive_display_mode.g.dart';
///Class that represents the default display mode of a Trusted Web Activity. ///Class that represents the default display mode of a Trusted Web Activity.
///The system UI (status bar, navigation bar) is shown, and the browser toolbar is hidden while the user is on a verified origin. ///The system UI (status bar, navigation bar) is shown, and the browser toolbar is hidden while the user is on a verified origin.
class TrustedWebActivityImmersiveDisplayMode @ExchangeableObject()
implements TrustedWebActivityDisplayMode { class TrustedWebActivityImmersiveDisplayMode_
implements TrustedWebActivityDisplayMode_ {
///Whether the Trusted Web Activity should be in sticky immersive mode. ///Whether the Trusted Web Activity should be in sticky immersive mode.
bool isSticky; bool isSticky;
///Use [displayCutoutMode] instead. ///Use [displayCutoutMode] instead.
@Deprecated("Use displayCutoutMode instead") @Deprecated("Use displayCutoutMode instead")
AndroidLayoutInDisplayCutoutMode? layoutInDisplayCutoutMode; AndroidLayoutInDisplayCutoutMode_? layoutInDisplayCutoutMode;
///The constant defining how to deal with display cutouts. ///The constant defining how to deal with display cutouts.
LayoutInDisplayCutoutMode displayCutoutMode; LayoutInDisplayCutoutMode_ displayCutoutMode;
String _type = "IMMERSIVE_MODE"; static final _type = "IMMERSIVE_MODE";
TrustedWebActivityImmersiveDisplayMode( @ExchangeableObjectConstructor()
TrustedWebActivityImmersiveDisplayMode_(
{required this.isSticky, {required this.isSticky,
this.displayCutoutMode = LayoutInDisplayCutoutMode.DEFAULT, this.displayCutoutMode = LayoutInDisplayCutoutMode_.DEFAULT,
this.layoutInDisplayCutoutMode}) { this.layoutInDisplayCutoutMode}) {
// ignore: deprecated_member_use_from_same_package
this.displayCutoutMode = this.layoutInDisplayCutoutMode != null this.displayCutoutMode = this.layoutInDisplayCutoutMode != null
? LayoutInDisplayCutoutMode.fromValue( ? LayoutInDisplayCutoutMode_.fromNativeValue(
// ignore: deprecated_member_use_from_same_package layoutInDisplayCutoutMode?.toNativeValue())!
this.layoutInDisplayCutoutMode!.toValue())!
: this.displayCutoutMode; : this.displayCutoutMode;
} }
///Gets a possible [TrustedWebActivityImmersiveDisplayMode] instance from a [Map] value. @ExchangeableObjectMethod(toMapMergeWith: true)
static TrustedWebActivityImmersiveDisplayMode? fromMap( // ignore: unused_element
Map<String, dynamic>? map) { Map<String, dynamic> _toMapMergeWith() {
if (map == null) { return {"type": _type};
return null;
}
return TrustedWebActivityImmersiveDisplayMode(
isSticky: map["isSticky"],
displayCutoutMode: map["layoutInDisplayCutoutMode"],
layoutInDisplayCutoutMode: map["layoutInDisplayCutoutMode"]);
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {
"isSticky": isSticky,
"layoutInDisplayCutoutMode": displayCutoutMode.toValue(),
"displayCutoutMode": displayCutoutMode.toValue(),
"type": _type
};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return this.toMap();
} }
@override @override
String toString() { @ExchangeableObjectMethod(ignore: true)
return toMap().toString(); dynamic noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
} }
}

View File

@ -0,0 +1,73 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'trusted_web_activity_immersive_display_mode.dart';
// **************************************************************************
// ExchangeableObjectGenerator
// **************************************************************************
///Class that represents the default display mode of a Trusted Web Activity.
///The system UI (status bar, navigation bar) is shown, and the browser toolbar is hidden while the user is on a verified origin.
class TrustedWebActivityImmersiveDisplayMode
implements TrustedWebActivityDisplayMode {
///Whether the Trusted Web Activity should be in sticky immersive mode.
bool isSticky;
///Use [displayCutoutMode] instead.
@Deprecated('Use displayCutoutMode instead')
AndroidLayoutInDisplayCutoutMode? layoutInDisplayCutoutMode;
///The constant defining how to deal with display cutouts.
LayoutInDisplayCutoutMode displayCutoutMode;
static final String _type = "IMMERSIVE_MODE";
TrustedWebActivityImmersiveDisplayMode(
{required this.isSticky,
this.displayCutoutMode = LayoutInDisplayCutoutMode.DEFAULT,
this.layoutInDisplayCutoutMode}) {
this.displayCutoutMode = this.layoutInDisplayCutoutMode != null
? LayoutInDisplayCutoutMode.fromNativeValue(
layoutInDisplayCutoutMode?.toNativeValue())!
: this.displayCutoutMode;
}
///Gets a possible [TrustedWebActivityImmersiveDisplayMode] instance from a [Map] value.
static TrustedWebActivityImmersiveDisplayMode? fromMap(
Map<String, dynamic>? map) {
if (map == null) {
return null;
}
final instance = TrustedWebActivityImmersiveDisplayMode(
isSticky: map['isSticky'],
layoutInDisplayCutoutMode:
AndroidLayoutInDisplayCutoutMode.fromNativeValue(
map['displayCutoutMode']),
);
instance.displayCutoutMode =
LayoutInDisplayCutoutMode.fromNativeValue(map['displayCutoutMode'])!;
return instance;
}
@ExchangeableObjectMethod(toMapMergeWith: true)
Map<String, dynamic> _toMapMergeWith() {
return {"type": _type};
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {
..._toMapMergeWith(),
"isSticky": isSticky,
"displayCutoutMode": displayCutoutMode.toNativeValue(),
};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return toMap();
}
@override
String toString() {
return 'TrustedWebActivityImmersiveDisplayMode{isSticky: $isSticky, displayCutoutMode: $displayCutoutMode}';
}
}

View File

@ -1,115 +1,61 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'trusted_web_activity_screen_orientation.g.dart';
///Class representing Screen Orientation Lock type value of a Trusted Web Activity: ///Class representing Screen Orientation Lock type value of a Trusted Web Activity:
///https://www.w3.org/TR/screen-orientation/#screenorientation-interface ///https://www.w3.org/TR/screen-orientation/#screenorientation-interface
class TrustedWebActivityScreenOrientation { @ExchangeableEnum()
class TrustedWebActivityScreenOrientation_ {
// ignore: unused_field
final int _value; final int _value;
const TrustedWebActivityScreenOrientation_._internal(this._value);
const TrustedWebActivityScreenOrientation._internal(this._value);
///Set of all values of [TrustedWebActivityScreenOrientation].
static final Set<TrustedWebActivityScreenOrientation> values = [
TrustedWebActivityScreenOrientation.DEFAULT,
TrustedWebActivityScreenOrientation.PORTRAIT_PRIMARY,
TrustedWebActivityScreenOrientation.PORTRAIT_SECONDARY,
TrustedWebActivityScreenOrientation.LANDSCAPE_PRIMARY,
TrustedWebActivityScreenOrientation.LANDSCAPE_SECONDARY,
TrustedWebActivityScreenOrientation.ANY,
TrustedWebActivityScreenOrientation.LANDSCAPE,
TrustedWebActivityScreenOrientation.PORTRAIT,
TrustedWebActivityScreenOrientation.NATURAL,
].toSet();
///Gets a possible [TrustedWebActivityScreenOrientation] instance from an [int] value.
static TrustedWebActivityScreenOrientation? fromValue(int? value) {
if (value != null) {
try {
return TrustedWebActivityScreenOrientation.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [int] value.
int toValue() => _value;
@override
String toString() {
switch (_value) {
case 1:
return "PORTRAIT_PRIMARY";
case 2:
return "PORTRAIT_SECONDARY";
case 3:
return "LANDSCAPE_PRIMARY";
case 4:
return "LANDSCAPE_SECONDARY";
case 5:
return "ANY";
case 6:
return "LANDSCAPE";
case 7:
return "PORTRAIT";
case 8:
return "NATURAL";
case 0:
default:
return "DEFAULT";
}
}
/// The default screen orientation is the set of orientations to which the screen is locked when /// The default screen orientation is the set of orientations to which the screen is locked when
/// there is no current orientation lock. /// there is no current orientation lock.
static const DEFAULT = const TrustedWebActivityScreenOrientation._internal(0); static const DEFAULT = const TrustedWebActivityScreenOrientation_._internal(0);
/// Portrait-primary is an orientation where the screen width is less than or equal to the /// Portrait-primary is an orientation where the screen width is less than or equal to the
/// screen height. If the device's natural orientation is portrait, then it is in /// screen height. If the device's natural orientation is portrait, then it is in
/// portrait-primary when held in that position. /// portrait-primary when held in that position.
static const PORTRAIT_PRIMARY = static const PORTRAIT_PRIMARY =
const TrustedWebActivityScreenOrientation._internal(1); const TrustedWebActivityScreenOrientation_._internal(1);
/// Portrait-secondary is an orientation where the screen width is less than or equal to the /// Portrait-secondary is an orientation where the screen width is less than or equal to the
/// screen height. If the device's natural orientation is portrait, then it is in /// screen height. If the device's natural orientation is portrait, then it is in
/// portrait-secondary when rotated 180° from its natural position. /// portrait-secondary when rotated 180° from its natural position.
static const PORTRAIT_SECONDARY = static const PORTRAIT_SECONDARY =
const TrustedWebActivityScreenOrientation._internal(2); const TrustedWebActivityScreenOrientation_._internal(2);
/// Landscape-primary is an orientation where the screen width is greater than the screen height. /// Landscape-primary is an orientation where the screen width is greater than the screen height.
/// If the device's natural orientation is landscape, then it is in landscape-primary when held /// If the device's natural orientation is landscape, then it is in landscape-primary when held
/// in that position. /// in that position.
static const LANDSCAPE_PRIMARY = static const LANDSCAPE_PRIMARY =
const TrustedWebActivityScreenOrientation._internal(3); const TrustedWebActivityScreenOrientation_._internal(3);
/// Landscape-secondary is an orientation where the screen width is greater than the /// Landscape-secondary is an orientation where the screen width is greater than the
/// screen height. If the device's natural orientation is landscape, it is in /// screen height. If the device's natural orientation is landscape, it is in
/// landscape-secondary when rotated 180° from its natural orientation. /// landscape-secondary when rotated 180° from its natural orientation.
static const LANDSCAPE_SECONDARY = static const LANDSCAPE_SECONDARY =
const TrustedWebActivityScreenOrientation._internal(4); const TrustedWebActivityScreenOrientation_._internal(4);
/// Any is an orientation that means the screen can be locked to any one of portrait-primary, /// Any is an orientation that means the screen can be locked to any one of portrait-primary,
/// portrait-secondary, landscape-primary and landscape-secondary. /// portrait-secondary, landscape-primary and landscape-secondary.
static const ANY = const TrustedWebActivityScreenOrientation._internal(5); static const ANY = const TrustedWebActivityScreenOrientation_._internal(5);
/// Landscape is an orientation where the screen width is greater than the screen height and /// Landscape is an orientation where the screen width is greater than the screen height and
/// depending on platform convention locking the screen to landscape can represent /// depending on platform convention locking the screen to landscape can represent
/// landscape-primary, landscape-secondary or both. /// landscape-primary, landscape-secondary or both.
static const LANDSCAPE = static const LANDSCAPE =
const TrustedWebActivityScreenOrientation._internal(6); const TrustedWebActivityScreenOrientation_._internal(6);
/// Portrait is an orientation where the screen width is less than or equal to the screen height /// Portrait is an orientation where the screen width is less than or equal to the screen height
/// and depending on platform convention locking the screen to portrait can represent /// and depending on platform convention locking the screen to portrait can represent
/// portrait-primary, portrait-secondary or both. /// portrait-primary, portrait-secondary or both.
static const PORTRAIT = static const PORTRAIT =
const TrustedWebActivityScreenOrientation._internal(7); const TrustedWebActivityScreenOrientation_._internal(7);
/// Natural is an orientation that refers to either portrait-primary or landscape-primary /// Natural is an orientation that refers to either portrait-primary or landscape-primary
/// depending on the device's usual orientation. This orientation is usually provided by /// depending on the device's usual orientation. This orientation is usually provided by
/// the underlying operating system. /// the underlying operating system.
static const NATURAL = const TrustedWebActivityScreenOrientation._internal(8); static const NATURAL = const TrustedWebActivityScreenOrientation_._internal(8);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }

View File

@ -0,0 +1,143 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'trusted_web_activity_screen_orientation.dart';
// **************************************************************************
// ExchangeableEnumGenerator
// **************************************************************************
///Class representing Screen Orientation Lock type value of a Trusted Web Activity:
///https://www.w3.org/TR/screen-orientation/#screenorientation-interface
class TrustedWebActivityScreenOrientation {
final int _value;
final int _nativeValue;
const TrustedWebActivityScreenOrientation._internal(
this._value, this._nativeValue);
// ignore: unused_element
factory TrustedWebActivityScreenOrientation._internalMultiPlatform(
int value, Function nativeValue) =>
TrustedWebActivityScreenOrientation._internal(value, nativeValue());
/// The default screen orientation is the set of orientations to which the screen is locked when
/// there is no current orientation lock.
static const DEFAULT = TrustedWebActivityScreenOrientation._internal(0, 0);
/// Portrait-primary is an orientation where the screen width is less than or equal to the
/// screen height. If the device's natural orientation is portrait, then it is in
/// portrait-primary when held in that position.
static const PORTRAIT_PRIMARY =
TrustedWebActivityScreenOrientation._internal(1, 1);
/// Portrait-secondary is an orientation where the screen width is less than or equal to the
/// screen height. If the device's natural orientation is portrait, then it is in
/// portrait-secondary when rotated 180° from its natural position.
static const PORTRAIT_SECONDARY =
TrustedWebActivityScreenOrientation._internal(2, 2);
/// Landscape-primary is an orientation where the screen width is greater than the screen height.
/// If the device's natural orientation is landscape, then it is in landscape-primary when held
/// in that position.
static const LANDSCAPE_PRIMARY =
TrustedWebActivityScreenOrientation._internal(3, 3);
/// Landscape-secondary is an orientation where the screen width is greater than the
/// screen height. If the device's natural orientation is landscape, it is in
/// landscape-secondary when rotated 180° from its natural orientation.
static const LANDSCAPE_SECONDARY =
TrustedWebActivityScreenOrientation._internal(4, 4);
/// Any is an orientation that means the screen can be locked to any one of portrait-primary,
/// portrait-secondary, landscape-primary and landscape-secondary.
static const ANY = TrustedWebActivityScreenOrientation._internal(5, 5);
/// Landscape is an orientation where the screen width is greater than the screen height and
/// depending on platform convention locking the screen to landscape can represent
/// landscape-primary, landscape-secondary or both.
static const LANDSCAPE = TrustedWebActivityScreenOrientation._internal(6, 6);
/// Portrait is an orientation where the screen width is less than or equal to the screen height
/// and depending on platform convention locking the screen to portrait can represent
/// portrait-primary, portrait-secondary or both.
static const PORTRAIT = TrustedWebActivityScreenOrientation._internal(7, 7);
/// Natural is an orientation that refers to either portrait-primary or landscape-primary
/// depending on the device's usual orientation. This orientation is usually provided by
/// the underlying operating system.
static const NATURAL = TrustedWebActivityScreenOrientation._internal(8, 8);
///Set of all values of [TrustedWebActivityScreenOrientation].
static final Set<TrustedWebActivityScreenOrientation> values = [
TrustedWebActivityScreenOrientation.DEFAULT,
TrustedWebActivityScreenOrientation.PORTRAIT_PRIMARY,
TrustedWebActivityScreenOrientation.PORTRAIT_SECONDARY,
TrustedWebActivityScreenOrientation.LANDSCAPE_PRIMARY,
TrustedWebActivityScreenOrientation.LANDSCAPE_SECONDARY,
TrustedWebActivityScreenOrientation.ANY,
TrustedWebActivityScreenOrientation.LANDSCAPE,
TrustedWebActivityScreenOrientation.PORTRAIT,
TrustedWebActivityScreenOrientation.NATURAL,
].toSet();
///Gets a possible [TrustedWebActivityScreenOrientation] instance from [int] value.
static TrustedWebActivityScreenOrientation? fromValue(int? value) {
if (value != null) {
try {
return TrustedWebActivityScreenOrientation.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets a possible [TrustedWebActivityScreenOrientation] instance from a native value.
static TrustedWebActivityScreenOrientation? fromNativeValue(int? value) {
if (value != null) {
try {
return TrustedWebActivityScreenOrientation.values
.firstWhere((element) => element.toNativeValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [int] value.
int toValue() => _value;
///Gets [int] native value.
int toNativeValue() => _nativeValue;
@override
int get hashCode => _value.hashCode;
@override
bool operator ==(value) => value == _value;
@override
String toString() {
switch (_value) {
case 0:
return 'DEFAULT';
case 1:
return 'PORTRAIT_PRIMARY';
case 2:
return 'PORTRAIT_SECONDARY';
case 3:
return 'LANDSCAPE_PRIMARY';
case 4:
return 'LANDSCAPE_SECONDARY';
case 5:
return 'ANY';
case 6:
return 'LANDSCAPE';
case 7:
return 'PORTRAIT';
case 8:
return 'NATURAL';
}
return _value.toString();
}
}

View File

@ -26,7 +26,7 @@ class URLProtectionSpace {
SslCertificate? sslCertificate; SslCertificate? sslCertificate;
///The SSL Error associated. ///The SSL Error associated.
dynamic sslError; SslError? sslError;
///Use [authenticationMethod] instead. ///Use [authenticationMethod] instead.
@Deprecated('Use authenticationMethod instead') @Deprecated('Use authenticationMethod instead')
@ -63,7 +63,7 @@ class URLProtectionSpace {
///Use [proxyType] instead. ///Use [proxyType] instead.
@Deprecated('Use proxyType instead') @Deprecated('Use proxyType instead')
dynamic iosProxyType; IOSNSURLProtectionSpaceProxyType? iosProxyType;
///The receiver's proxy type. ///The receiver's proxy type.
///This value is `null` if the receiver does not represent a proxy protection space. ///This value is `null` if the receiver does not represent a proxy protection space.
@ -71,7 +71,7 @@ class URLProtectionSpace {
/// ///
///**Supported Platforms/Implementations**: ///**Supported Platforms/Implementations**:
///- iOS ([Official API - URLProtectionSpace.proxyType](https://developer.apple.com/documentation/foundation/urlprotectionspace/1411924-proxytype)) ///- iOS ([Official API - URLProtectionSpace.proxyType](https://developer.apple.com/documentation/foundation/urlprotectionspace/1411924-proxytype))
dynamic proxyType; URLProtectionSpaceProxyType? proxyType;
URLProtectionSpace( URLProtectionSpace(
{required this.host, {required this.host,
this.protocol, this.protocol,
@ -97,7 +97,9 @@ class URLProtectionSpace {
distinguishedNames = distinguishedNames ?? iosDistinguishedNames; distinguishedNames = distinguishedNames ?? iosDistinguishedNames;
receivesCredentialSecurely = receivesCredentialSecurely =
receivesCredentialSecurely ?? iosReceivesCredentialSecurely; receivesCredentialSecurely ?? iosReceivesCredentialSecurely;
proxyType = proxyType ?? iosProxyType; proxyType = proxyType ??
URLProtectionSpaceProxyType.fromNativeValue(
iosProxyType?.toNativeValue());
} }
///Gets a possible [URLProtectionSpace] instance from a [Map] value. ///Gets a possible [URLProtectionSpace] instance from a [Map] value.
@ -112,7 +114,7 @@ class URLProtectionSpace {
port: map['port'], port: map['port'],
sslCertificate: SslCertificate.fromMap( sslCertificate: SslCertificate.fromMap(
map['sslCertificate']?.cast<String, dynamic>()), map['sslCertificate']?.cast<String, dynamic>()),
sslError: map['sslError'], sslError: SslError.fromMap(map['sslError']?.cast<String, dynamic>()),
iosAuthenticationMethod: iosAuthenticationMethod:
IOSNSURLProtectionSpaceAuthenticationMethod.fromNativeValue( IOSNSURLProtectionSpaceAuthenticationMethod.fromNativeValue(
map['authenticationMethod']), map['authenticationMethod']),
@ -125,8 +127,9 @@ class URLProtectionSpace {
_distinguishedNamesDeserializer(map['distinguishedNames']), _distinguishedNamesDeserializer(map['distinguishedNames']),
iosReceivesCredentialSecurely: map['receivesCredentialSecurely'], iosReceivesCredentialSecurely: map['receivesCredentialSecurely'],
receivesCredentialSecurely: map['receivesCredentialSecurely'], receivesCredentialSecurely: map['receivesCredentialSecurely'],
iosProxyType: map['proxyType'], iosProxyType:
proxyType: map['proxyType'], IOSNSURLProtectionSpaceProxyType.fromNativeValue(map['proxyType']),
proxyType: URLProtectionSpaceProxyType.fromNativeValue(map['proxyType']),
); );
return instance; return instance;
} }
@ -139,11 +142,11 @@ class URLProtectionSpace {
"realm": realm, "realm": realm,
"port": port, "port": port,
"sslCertificate": sslCertificate?.toMap(), "sslCertificate": sslCertificate?.toMap(),
"sslError": sslError, "sslError": sslError?.toMap(),
"authenticationMethod": authenticationMethod?.toNativeValue(), "authenticationMethod": authenticationMethod?.toNativeValue(),
"distinguishedNames": distinguishedNames?.map((e) => e.toMap()).toList(), "distinguishedNames": distinguishedNames?.map((e) => e.toMap()).toList(),
"receivesCredentialSecurely": receivesCredentialSecurely, "receivesCredentialSecurely": receivesCredentialSecurely,
"proxyType": proxyType, "proxyType": proxyType?.toNativeValue(),
}; };
} }

View File

@ -1,65 +1,21 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'url_protection_space.dart'; import 'url_protection_space.dart';
import 'url_credential.dart'; import 'url_credential.dart';
import '../http_auth_credentials_database.dart'; import '../http_auth_credentials_database.dart';
part 'url_protection_space_http_auth_credentials.g.dart';
///Class that represents a [URLProtectionSpace] with all of its [URLCredential]s. ///Class that represents a [URLProtectionSpace] with all of its [URLCredential]s.
///It used by [HttpAuthCredentialDatabase.getAllAuthCredentials]. ///It used by [HttpAuthCredentialDatabase.getAllAuthCredentials].
class URLProtectionSpaceHttpAuthCredentials { @ExchangeableObject()
class URLProtectionSpaceHttpAuthCredentials_ {
///The protection space. ///The protection space.
URLProtectionSpace? protectionSpace; URLProtectionSpace_? protectionSpace;
///The list of all its http authentication credentials. ///The list of all its http authentication credentials.
List<URLCredential>? credentials; List<URLCredential_>? credentials;
URLProtectionSpaceHttpAuthCredentials( URLProtectionSpaceHttpAuthCredentials_(
{this.protectionSpace, this.credentials}); {this.protectionSpace, this.credentials});
///Gets a possible [URLProtectionSpaceHttpAuthCredentials] instance from a [Map] value.
static URLProtectionSpaceHttpAuthCredentials? fromMap(
Map<String, dynamic>? map) {
if (map == null) {
return null;
}
List<URLCredential>? credentials;
if (map["credentials"] != null) {
credentials = <URLCredential>[];
(map["credentials"].cast<Map<String, dynamic>>()
as List<Map<String, dynamic>>)
.forEach((element) {
var credential = URLCredential.fromMap(element);
if (credential != null) {
credentials!.add(credential);
}
});
}
return URLProtectionSpaceHttpAuthCredentials(
protectionSpace: map["protectionSpace"] != null
? URLProtectionSpace.fromMap(
map["protectionSpace"]?.cast<String, dynamic>())
: null,
credentials: credentials,
);
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {
"protectionSpace": protectionSpace?.toMap(),
"credentials": credentials != null
? credentials!.map((credential) => credential.toMap()).toList()
: null
};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return this.toMap();
}
@override
String toString() {
return toMap().toString();
}
} }

View File

@ -0,0 +1,52 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'url_protection_space_http_auth_credentials.dart';
// **************************************************************************
// ExchangeableObjectGenerator
// **************************************************************************
///Class that represents a [URLProtectionSpace] with all of its [URLCredential]s.
///It used by [HttpAuthCredentialDatabase.getAllAuthCredentials].
class URLProtectionSpaceHttpAuthCredentials {
///The protection space.
URLProtectionSpace? protectionSpace;
///The list of all its http authentication credentials.
List<URLCredential>? credentials;
URLProtectionSpaceHttpAuthCredentials(
{this.protectionSpace, this.credentials});
///Gets a possible [URLProtectionSpaceHttpAuthCredentials] instance from a [Map] value.
static URLProtectionSpaceHttpAuthCredentials? fromMap(
Map<String, dynamic>? map) {
if (map == null) {
return null;
}
final instance = URLProtectionSpaceHttpAuthCredentials(
protectionSpace: URLProtectionSpace.fromMap(
map['protectionSpace']?.cast<String, dynamic>()),
credentials: map['credentials']
?.map((e) => URLCredential.fromMap(e?.cast<String, dynamic>())!),
);
return instance;
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {
"protectionSpace": protectionSpace?.toMap(),
"credentials": credentials?.map((e) => e.toMap()).toList(),
};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return toMap();
}
@override
String toString() {
return 'URLProtectionSpaceHttpAuthCredentials{protectionSpace: $protectionSpace, credentials: $credentials}';
}
}

View File

@ -1,119 +1,61 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'url_protection_space_proxy_type.g.dart';
///Class that represents the supported proxy types. ///Class that represents the supported proxy types.
class URLProtectionSpaceProxyType { @ExchangeableEnum()
class URLProtectionSpaceProxyType_ {
// ignore: unused_field
final String _value; final String _value;
const URLProtectionSpaceProxyType_._internal(this._value);
const URLProtectionSpaceProxyType._internal(this._value);
///Set of all values of [URLProtectionSpaceProxyType].
static final Set<URLProtectionSpaceProxyType> values = [
URLProtectionSpaceProxyType.NSUR_PROTECTION_SPACE_HTTP_PROXY,
URLProtectionSpaceProxyType.NSURL_PROTECTION_SPACE_HTTPS_PROXY,
URLProtectionSpaceProxyType.NSURL_PROTECTION_SPACE_FTP_PROXY,
URLProtectionSpaceProxyType.NSURL_PROTECTION_SPACE_SOCKS_PROXY,
].toSet();
///Gets a possible [URLProtectionSpaceProxyType] instance from a [String] value.
static URLProtectionSpaceProxyType? fromValue(String? value) {
if (value != null) {
try {
return URLProtectionSpaceProxyType.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [String] value.
String toValue() => _value;
@override
String toString() => _value;
///The proxy type for HTTP proxies. ///The proxy type for HTTP proxies.
static const NSUR_PROTECTION_SPACE_HTTP_PROXY = static const URL_PROTECTION_SPACE_HTTP_PROXY =
const URLProtectionSpaceProxyType._internal( const URLProtectionSpaceProxyType_._internal(
"NSURLProtectionSpaceHTTPProxy"); "NSURLProtectionSpaceHTTPProxy");
///The proxy type for HTTPS proxies. ///The proxy type for HTTPS proxies.
static const NSURL_PROTECTION_SPACE_HTTPS_PROXY = static const URL_PROTECTION_SPACE_HTTPS_PROXY =
const URLProtectionSpaceProxyType._internal( const URLProtectionSpaceProxyType_._internal(
"NSURLProtectionSpaceHTTPSProxy"); "NSURLProtectionSpaceHTTPSProxy");
///The proxy type for FTP proxies. ///The proxy type for FTP proxies.
static const NSURL_PROTECTION_SPACE_FTP_PROXY = static const URL_PROTECTION_SPACE_FTP_PROXY =
const URLProtectionSpaceProxyType._internal( const URLProtectionSpaceProxyType_._internal(
"NSURLProtectionSpaceFTPProxy"); "NSURLProtectionSpaceFTPProxy");
///The proxy type for SOCKS proxies. ///The proxy type for SOCKS proxies.
static const NSURL_PROTECTION_SPACE_SOCKS_PROXY = static const URL_PROTECTION_SPACE_SOCKS_PROXY =
const URLProtectionSpaceProxyType._internal( const URLProtectionSpaceProxyType_._internal(
"NSURLProtectionSpaceSOCKSProxy"); "NSURLProtectionSpaceSOCKSProxy");
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///An iOS-specific Class that represents the supported proxy types. ///An iOS-specific Class that represents the supported proxy types.
///Use [URLProtectionSpaceProxyType] instead. ///Use [URLProtectionSpaceProxyType] instead.
@Deprecated("Use URLProtectionSpaceProxyType instead") @Deprecated("Use URLProtectionSpaceProxyType instead")
class IOSNSURLProtectionSpaceProxyType { @ExchangeableEnum()
class IOSNSURLProtectionSpaceProxyType_ {
// ignore: unused_field
final String _value; final String _value;
const IOSNSURLProtectionSpaceProxyType_._internal(this._value);
const IOSNSURLProtectionSpaceProxyType._internal(this._value);
///Set of all values of [IOSNSURLProtectionSpaceProxyType].
static final Set<IOSNSURLProtectionSpaceProxyType> values = [
IOSNSURLProtectionSpaceProxyType.NSUR_PROTECTION_SPACE_HTTP_PROXY,
IOSNSURLProtectionSpaceProxyType.NSURL_PROTECTION_SPACE_HTTPS_PROXY,
IOSNSURLProtectionSpaceProxyType.NSURL_PROTECTION_SPACE_FTP_PROXY,
IOSNSURLProtectionSpaceProxyType.NSURL_PROTECTION_SPACE_SOCKS_PROXY,
].toSet();
///Gets a possible [IOSNSURLProtectionSpaceProxyType] instance from a [String] value.
static IOSNSURLProtectionSpaceProxyType? fromValue(String? value) {
if (value != null) {
try {
return IOSNSURLProtectionSpaceProxyType.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [String] value.
String toValue() => _value;
@override
String toString() => _value;
///The proxy type for HTTP proxies. ///The proxy type for HTTP proxies.
static const NSUR_PROTECTION_SPACE_HTTP_PROXY = static const NSUR_PROTECTION_SPACE_HTTP_PROXY =
const IOSNSURLProtectionSpaceProxyType._internal( const IOSNSURLProtectionSpaceProxyType_._internal(
"NSURLProtectionSpaceHTTPProxy"); "NSURLProtectionSpaceHTTPProxy");
///The proxy type for HTTPS proxies. ///The proxy type for HTTPS proxies.
static const NSURL_PROTECTION_SPACE_HTTPS_PROXY = static const NSURL_PROTECTION_SPACE_HTTPS_PROXY =
const IOSNSURLProtectionSpaceProxyType._internal( const IOSNSURLProtectionSpaceProxyType_._internal(
"NSURLProtectionSpaceHTTPSProxy"); "NSURLProtectionSpaceHTTPSProxy");
///The proxy type for FTP proxies. ///The proxy type for FTP proxies.
static const NSURL_PROTECTION_SPACE_FTP_PROXY = static const NSURL_PROTECTION_SPACE_FTP_PROXY =
const IOSNSURLProtectionSpaceProxyType._internal( const IOSNSURLProtectionSpaceProxyType_._internal(
"NSURLProtectionSpaceFTPProxy"); "NSURLProtectionSpaceFTPProxy");
///The proxy type for SOCKS proxies. ///The proxy type for SOCKS proxies.
static const NSURL_PROTECTION_SPACE_SOCKS_PROXY = static const NSURL_PROTECTION_SPACE_SOCKS_PROXY =
const IOSNSURLProtectionSpaceProxyType._internal( const IOSNSURLProtectionSpaceProxyType_._internal(
"NSURLProtectionSpaceSOCKSProxy"); "NSURLProtectionSpaceSOCKSProxy");
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }

View File

@ -0,0 +1,174 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'url_protection_space_proxy_type.dart';
// **************************************************************************
// ExchangeableEnumGenerator
// **************************************************************************
///Class that represents the supported proxy types.
class URLProtectionSpaceProxyType {
final String _value;
final String _nativeValue;
const URLProtectionSpaceProxyType._internal(this._value, this._nativeValue);
// ignore: unused_element
factory URLProtectionSpaceProxyType._internalMultiPlatform(
String value, Function nativeValue) =>
URLProtectionSpaceProxyType._internal(value, nativeValue());
///The proxy type for HTTP proxies.
static const URL_PROTECTION_SPACE_HTTP_PROXY =
URLProtectionSpaceProxyType._internal(
'NSURLProtectionSpaceHTTPProxy', 'NSURLProtectionSpaceHTTPProxy');
///The proxy type for HTTPS proxies.
static const URL_PROTECTION_SPACE_HTTPS_PROXY =
URLProtectionSpaceProxyType._internal(
'NSURLProtectionSpaceHTTPSProxy', 'NSURLProtectionSpaceHTTPSProxy');
///The proxy type for FTP proxies.
static const URL_PROTECTION_SPACE_FTP_PROXY =
URLProtectionSpaceProxyType._internal(
'NSURLProtectionSpaceFTPProxy', 'NSURLProtectionSpaceFTPProxy');
///The proxy type for SOCKS proxies.
static const URL_PROTECTION_SPACE_SOCKS_PROXY =
URLProtectionSpaceProxyType._internal(
'NSURLProtectionSpaceSOCKSProxy', 'NSURLProtectionSpaceSOCKSProxy');
///Set of all values of [URLProtectionSpaceProxyType].
static final Set<URLProtectionSpaceProxyType> values = [
URLProtectionSpaceProxyType.URL_PROTECTION_SPACE_HTTP_PROXY,
URLProtectionSpaceProxyType.URL_PROTECTION_SPACE_HTTPS_PROXY,
URLProtectionSpaceProxyType.URL_PROTECTION_SPACE_FTP_PROXY,
URLProtectionSpaceProxyType.URL_PROTECTION_SPACE_SOCKS_PROXY,
].toSet();
///Gets a possible [URLProtectionSpaceProxyType] instance from [String] value.
static URLProtectionSpaceProxyType? fromValue(String? value) {
if (value != null) {
try {
return URLProtectionSpaceProxyType.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets a possible [URLProtectionSpaceProxyType] instance from a native value.
static URLProtectionSpaceProxyType? fromNativeValue(String? value) {
if (value != null) {
try {
return URLProtectionSpaceProxyType.values
.firstWhere((element) => element.toNativeValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [String] value.
String toValue() => _value;
///Gets [String] native value.
String toNativeValue() => _nativeValue;
@override
int get hashCode => _value.hashCode;
@override
bool operator ==(value) => value == _value;
@override
String toString() {
return _value;
}
}
///An iOS-specific Class that represents the supported proxy types.
///Use [URLProtectionSpaceProxyType] instead.
@Deprecated('Use URLProtectionSpaceProxyType instead')
class IOSNSURLProtectionSpaceProxyType {
final String _value;
final String _nativeValue;
const IOSNSURLProtectionSpaceProxyType._internal(
this._value, this._nativeValue);
// ignore: unused_element
factory IOSNSURLProtectionSpaceProxyType._internalMultiPlatform(
String value, Function nativeValue) =>
IOSNSURLProtectionSpaceProxyType._internal(value, nativeValue());
///The proxy type for HTTP proxies.
static const NSUR_PROTECTION_SPACE_HTTP_PROXY =
IOSNSURLProtectionSpaceProxyType._internal(
'NSURLProtectionSpaceHTTPProxy', 'NSURLProtectionSpaceHTTPProxy');
///The proxy type for HTTPS proxies.
static const NSURL_PROTECTION_SPACE_HTTPS_PROXY =
IOSNSURLProtectionSpaceProxyType._internal(
'NSURLProtectionSpaceHTTPSProxy', 'NSURLProtectionSpaceHTTPSProxy');
///The proxy type for FTP proxies.
static const NSURL_PROTECTION_SPACE_FTP_PROXY =
IOSNSURLProtectionSpaceProxyType._internal(
'NSURLProtectionSpaceFTPProxy', 'NSURLProtectionSpaceFTPProxy');
///The proxy type for SOCKS proxies.
static const NSURL_PROTECTION_SPACE_SOCKS_PROXY =
IOSNSURLProtectionSpaceProxyType._internal(
'NSURLProtectionSpaceSOCKSProxy', 'NSURLProtectionSpaceSOCKSProxy');
///Set of all values of [IOSNSURLProtectionSpaceProxyType].
static final Set<IOSNSURLProtectionSpaceProxyType> values = [
IOSNSURLProtectionSpaceProxyType.NSUR_PROTECTION_SPACE_HTTP_PROXY,
IOSNSURLProtectionSpaceProxyType.NSURL_PROTECTION_SPACE_HTTPS_PROXY,
IOSNSURLProtectionSpaceProxyType.NSURL_PROTECTION_SPACE_FTP_PROXY,
IOSNSURLProtectionSpaceProxyType.NSURL_PROTECTION_SPACE_SOCKS_PROXY,
].toSet();
///Gets a possible [IOSNSURLProtectionSpaceProxyType] instance from [String] value.
static IOSNSURLProtectionSpaceProxyType? fromValue(String? value) {
if (value != null) {
try {
return IOSNSURLProtectionSpaceProxyType.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets a possible [IOSNSURLProtectionSpaceProxyType] instance from a native value.
static IOSNSURLProtectionSpaceProxyType? fromNativeValue(String? value) {
if (value != null) {
try {
return IOSNSURLProtectionSpaceProxyType.values
.firstWhere((element) => element.toNativeValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [String] value.
String toValue() => _value;
///Gets [String] native value.
String toNativeValue() => _nativeValue;
@override
int get hashCode => _value.hashCode;
@override
bool operator ==(value) => value == _value;
@override
String toString() {
return _value;
}
}

View File

@ -10,7 +10,7 @@ part 'url_request.g.dart';
///A URL load request that is independent of protocol or URL scheme. ///A URL load request that is independent of protocol or URL scheme.
@ExchangeableObject() @ExchangeableObject()
class URLRequest_ { class URLRequest_ {
///The URL of the request. Setting this to `null` will load `about:blank`. ///The URL of the request. Setting this to `null` will load `about:blank`.
Uri? url; Uri? url;
///The HTTP request method. ///The HTTP request method.

View File

@ -8,7 +8,7 @@ part of 'url_request.dart';
///A URL load request that is independent of protocol or URL scheme. ///A URL load request that is independent of protocol or URL scheme.
class URLRequest { class URLRequest {
///The URL of the request. Setting this to `null` will load `about:blank`. ///The URL of the request. Setting this to `null` will load `about:blank`.
Uri? url; Uri? url;
///The HTTP request method. ///The HTTP request method.

View File

@ -1,56 +1,20 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'user_preferred_content_mode.g.dart';
///Class that represents the content mode to prefer when loading and rendering a webpage. ///Class that represents the content mode to prefer when loading and rendering a webpage.
class UserPreferredContentMode { @ExchangeableEnum()
class UserPreferredContentMode_ {
// ignore: unused_field
final int _value; final int _value;
const UserPreferredContentMode_._internal(this._value);
const UserPreferredContentMode._internal(this._value);
///Set of all values of [UserPreferredContentMode].
static final Set<UserPreferredContentMode> values = [
UserPreferredContentMode.RECOMMENDED,
UserPreferredContentMode.MOBILE,
UserPreferredContentMode.DESKTOP,
].toSet();
///Gets a possible [UserPreferredContentMode] instance from an [int] value.
static UserPreferredContentMode? fromValue(int? value) {
if (value != null) {
try {
return UserPreferredContentMode.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [int] value.
int toValue() => _value;
@override
String toString() {
switch (_value) {
case 1:
return "MOBILE";
case 2:
return "DESKTOP";
case 0:
default:
return "RECOMMENDED";
}
}
///The recommended content mode for the current platform. ///The recommended content mode for the current platform.
static const RECOMMENDED = const UserPreferredContentMode._internal(0); static const RECOMMENDED = const UserPreferredContentMode_._internal(0);
///Represents content targeting mobile browsers. ///Represents content targeting mobile browsers.
static const MOBILE = const UserPreferredContentMode._internal(1); static const MOBILE = const UserPreferredContentMode_._internal(1);
///Represents content targeting desktop browsers. ///Represents content targeting desktop browsers.
static const DESKTOP = const UserPreferredContentMode._internal(2); static const DESKTOP = const UserPreferredContentMode_._internal(2);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }

View File

@ -0,0 +1,85 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'user_preferred_content_mode.dart';
// **************************************************************************
// ExchangeableEnumGenerator
// **************************************************************************
///Class that represents the content mode to prefer when loading and rendering a webpage.
class UserPreferredContentMode {
final int _value;
final int _nativeValue;
const UserPreferredContentMode._internal(this._value, this._nativeValue);
// ignore: unused_element
factory UserPreferredContentMode._internalMultiPlatform(
int value, Function nativeValue) =>
UserPreferredContentMode._internal(value, nativeValue());
///The recommended content mode for the current platform.
static const RECOMMENDED = UserPreferredContentMode._internal(0, 0);
///Represents content targeting mobile browsers.
static const MOBILE = UserPreferredContentMode._internal(1, 1);
///Represents content targeting desktop browsers.
static const DESKTOP = UserPreferredContentMode._internal(2, 2);
///Set of all values of [UserPreferredContentMode].
static final Set<UserPreferredContentMode> values = [
UserPreferredContentMode.RECOMMENDED,
UserPreferredContentMode.MOBILE,
UserPreferredContentMode.DESKTOP,
].toSet();
///Gets a possible [UserPreferredContentMode] instance from [int] value.
static UserPreferredContentMode? fromValue(int? value) {
if (value != null) {
try {
return UserPreferredContentMode.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets a possible [UserPreferredContentMode] instance from a native value.
static UserPreferredContentMode? fromNativeValue(int? value) {
if (value != null) {
try {
return UserPreferredContentMode.values
.firstWhere((element) => element.toNativeValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [int] value.
int toValue() => _value;
///Gets [int] native value.
int toNativeValue() => _nativeValue;
@override
int get hashCode => _value.hashCode;
@override
bool operator ==(value) => value == _value;
@override
String toString() {
switch (_value) {
case 0:
return 'RECOMMENDED';
case 1:
return 'MOBILE';
case 2:
return 'DESKTOP';
}
return _value.toString();
}
}

View File

@ -1,9 +1,14 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../in_app_webview/webview.dart'; import '../in_app_webview/webview.dart';
import 'user_script_injection_time.dart'; import 'user_script_injection_time.dart';
import 'content_world.dart'; import 'content_world.dart';
part 'user_script.g.dart';
///Class that represents a script that the [WebView] injects into the web page. ///Class that represents a script that the [WebView] injects into the web page.
class UserScript { @ExchangeableObject()
class UserScript_ {
///The scripts group name. ///The scripts group name.
String? groupName; String? groupName;
@ -11,7 +16,7 @@ class UserScript {
String source; String source;
///The time at which to inject the script into the [WebView]. ///The time at which to inject the script into the [WebView].
UserScriptInjectionTime injectionTime; UserScriptInjectionTime_ injectionTime;
///Use [forMainFrameOnly] instead. ///Use [forMainFrameOnly] instead.
@Deprecated("Use forMainFrameOnly instead") @Deprecated("Use forMainFrameOnly instead")
@ -28,7 +33,8 @@ class UserScript {
///For more information about content worlds, see [ContentWorld]. ///For more information about content worlds, see [ContentWorld].
late ContentWorld contentWorld; late ContentWorld contentWorld;
UserScript( @ExchangeableObjectConstructor()
UserScript_(
{this.groupName, {this.groupName,
required this.source, required this.source,
required this.injectionTime, required this.injectionTime,
@ -42,26 +48,4 @@ class UserScript {
? this.iosForMainFrameOnly! ? this.iosForMainFrameOnly!
: this.forMainFrameOnly; : this.forMainFrameOnly;
} }
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {
"groupName": groupName,
"source": source,
"injectionTime": injectionTime.toValue(),
"iosForMainFrameOnly": forMainFrameOnly,
"forMainFrameOnly": forMainFrameOnly,
"contentWorld": contentWorld.toMap()
};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return this.toMap();
}
@override
String toString() {
return toMap().toString();
}
} }

View File

@ -0,0 +1,84 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'user_script.dart';
// **************************************************************************
// ExchangeableObjectGenerator
// **************************************************************************
///Class that represents a script that the [WebView] injects into the web page.
class UserScript {
///The scripts group name.
String? groupName;
///The scripts source code.
String source;
///The time at which to inject the script into the [WebView].
UserScriptInjectionTime injectionTime;
///Use [forMainFrameOnly] instead.
@Deprecated('Use forMainFrameOnly instead')
bool? iosForMainFrameOnly;
///A Boolean value that indicates whether to inject the script into the main frame.
///Specify true to inject the script only into the main frame, or false to inject it into all frames.
///The default value is `true`.
///
///**NOTE**: available only on iOS.
bool forMainFrameOnly;
///A scope of execution in which to evaluate the script to prevent conflicts between different scripts.
///For more information about content worlds, see [ContentWorld].
late ContentWorld contentWorld;
UserScript(
{this.groupName,
required this.source,
required this.injectionTime,
@Deprecated("Use forMainFrameOnly instead") this.iosForMainFrameOnly,
this.forMainFrameOnly = true,
ContentWorld? contentWorld}) {
this.contentWorld = contentWorld ?? ContentWorld.PAGE;
this.forMainFrameOnly = this.iosForMainFrameOnly != null
? this.iosForMainFrameOnly!
: this.forMainFrameOnly;
}
///Gets a possible [UserScript] instance from a [Map] value.
static UserScript? fromMap(Map<String, dynamic>? map) {
if (map == null) {
return null;
}
final instance = UserScript(
groupName: map['groupName'],
source: map['source'],
injectionTime:
UserScriptInjectionTime.fromNativeValue(map['injectionTime'])!,
iosForMainFrameOnly: map['forMainFrameOnly'],
);
instance.forMainFrameOnly = map['forMainFrameOnly'];
instance.contentWorld = map['contentWorld'];
return instance;
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {
"groupName": groupName,
"source": source,
"injectionTime": injectionTime.toNativeValue(),
"forMainFrameOnly": forMainFrameOnly,
"contentWorld": contentWorld.toMap(),
};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return toMap();
}
@override
String toString() {
return 'UserScript{groupName: $groupName, source: $source, injectionTime: $injectionTime, forMainFrameOnly: $forMainFrameOnly, contentWorld: $contentWorld}';
}
}

View File

@ -1,57 +1,24 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../in_app_webview/webview.dart'; import '../in_app_webview/webview.dart';
import 'user_script.dart'; import 'user_script.dart';
part 'user_script_injection_time.g.dart';
///Class that represents contains the constants for the times at which to inject script content into a [WebView] used by an [UserScript]. ///Class that represents contains the constants for the times at which to inject script content into a [WebView] used by an [UserScript].
class UserScriptInjectionTime { @ExchangeableEnum()
class UserScriptInjectionTime_ {
// ignore: unused_field
final int _value; final int _value;
const UserScriptInjectionTime_._internal(this._value);
const UserScriptInjectionTime._internal(this._value);
///Set of all values of [UserScriptInjectionTime].
static final Set<UserScriptInjectionTime> values = [
UserScriptInjectionTime.AT_DOCUMENT_START,
UserScriptInjectionTime.AT_DOCUMENT_END,
].toSet();
///Gets a possible [UserScriptInjectionTime] instance from an [int] value.
static UserScriptInjectionTime? fromValue(int? value) {
if (value != null) {
try {
return UserScriptInjectionTime.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [int] value.
int toValue() => _value;
@override
String toString() {
switch (_value) {
case 1:
return "AT_DOCUMENT_END";
case 0:
default:
return "AT_DOCUMENT_START";
}
}
///**NOTE for iOS**: A constant to inject the script after the creation of the webpages document element, but before loading any other content. ///**NOTE for iOS**: A constant to inject the script after the creation of the webpages document element, but before loading any other content.
/// ///
///**NOTE for Android**: A constant to try to inject the script as soon as the page starts loading. ///**NOTE for Android**: A constant to try to inject the script as soon as the page starts loading.
static const AT_DOCUMENT_START = const UserScriptInjectionTime._internal(0); static const AT_DOCUMENT_START = const UserScriptInjectionTime_._internal(0);
///**NOTE for iOS**: A constant to inject the script after the document finishes loading, but before loading any other subresources. ///**NOTE for iOS**: A constant to inject the script after the document finishes loading, but before loading any other subresources.
/// ///
///**NOTE for Android**: A constant to inject the script as soon as the page finishes loading. ///**NOTE for Android**: A constant to inject the script as soon as the page finishes loading.
static const AT_DOCUMENT_END = const UserScriptInjectionTime._internal(1); static const AT_DOCUMENT_END = const UserScriptInjectionTime_._internal(1);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }

View File

@ -0,0 +1,83 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'user_script_injection_time.dart';
// **************************************************************************
// ExchangeableEnumGenerator
// **************************************************************************
///Class that represents contains the constants for the times at which to inject script content into a [WebView] used by an [UserScript].
class UserScriptInjectionTime {
final int _value;
final int _nativeValue;
const UserScriptInjectionTime._internal(this._value, this._nativeValue);
// ignore: unused_element
factory UserScriptInjectionTime._internalMultiPlatform(
int value, Function nativeValue) =>
UserScriptInjectionTime._internal(value, nativeValue());
///**NOTE for iOS**: A constant to inject the script after the creation of the webpages document element, but before loading any other content.
///
///**NOTE for Android**: A constant to try to inject the script as soon as the page starts loading.
static const AT_DOCUMENT_START = UserScriptInjectionTime._internal(0, 0);
///**NOTE for iOS**: A constant to inject the script after the document finishes loading, but before loading any other subresources.
///
///**NOTE for Android**: A constant to inject the script as soon as the page finishes loading.
static const AT_DOCUMENT_END = UserScriptInjectionTime._internal(1, 1);
///Set of all values of [UserScriptInjectionTime].
static final Set<UserScriptInjectionTime> values = [
UserScriptInjectionTime.AT_DOCUMENT_START,
UserScriptInjectionTime.AT_DOCUMENT_END,
].toSet();
///Gets a possible [UserScriptInjectionTime] instance from [int] value.
static UserScriptInjectionTime? fromValue(int? value) {
if (value != null) {
try {
return UserScriptInjectionTime.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets a possible [UserScriptInjectionTime] instance from a native value.
static UserScriptInjectionTime? fromNativeValue(int? value) {
if (value != null) {
try {
return UserScriptInjectionTime.values
.firstWhere((element) => element.toNativeValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [int] value.
int toValue() => _value;
///Gets [int] native value.
int toNativeValue() => _nativeValue;
@override
int get hashCode => _value.hashCode;
@override
bool operator ==(value) => value == _value;
@override
String toString() {
switch (_value) {
case 0:
return 'AT_DOCUMENT_START';
case 1:
return 'AT_DOCUMENT_END';
}
return _value.toString();
}
}

View File

@ -1,121 +1,45 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'vertical_scrollbar_position.g.dart';
///Class used to configure the position of the vertical scroll bar. ///Class used to configure the position of the vertical scroll bar.
class VerticalScrollbarPosition { @ExchangeableEnum()
class VerticalScrollbarPosition_ {
// ignore: unused_field
final int _value; final int _value;
const VerticalScrollbarPosition_._internal(this._value);
const VerticalScrollbarPosition._internal(this._value);
///Set of all values of [VerticalScrollbarPosition].
static final Set<VerticalScrollbarPosition> values = [
VerticalScrollbarPosition.SCROLLBAR_POSITION_DEFAULT,
VerticalScrollbarPosition.SCROLLBAR_POSITION_LEFT,
VerticalScrollbarPosition.SCROLLBAR_POSITION_RIGHT,
].toSet();
///Gets a possible [VerticalScrollbarPosition] instance from an [int] value.
static VerticalScrollbarPosition? fromValue(int? value) {
if (value != null) {
try {
return VerticalScrollbarPosition.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [int] value.
int toValue() => _value;
@override
String toString() {
switch (_value) {
case 1:
return "SCROLLBAR_POSITION_LEFT";
case 2:
return "SCROLLBAR_POSITION_RIGHT";
case 0:
default:
return "SCROLLBAR_POSITION_DEFAULT";
}
}
///Position the scroll bar at the default position as determined by the system. ///Position the scroll bar at the default position as determined by the system.
static const SCROLLBAR_POSITION_DEFAULT = static const SCROLLBAR_POSITION_DEFAULT =
const VerticalScrollbarPosition._internal(0); const VerticalScrollbarPosition_._internal(0);
///Position the scroll bar along the left edge. ///Position the scroll bar along the left edge.
static const SCROLLBAR_POSITION_LEFT = static const SCROLLBAR_POSITION_LEFT =
const VerticalScrollbarPosition._internal(1); const VerticalScrollbarPosition_._internal(1);
///Position the scroll bar along the right edge. ///Position the scroll bar along the right edge.
static const SCROLLBAR_POSITION_RIGHT = static const SCROLLBAR_POSITION_RIGHT =
const VerticalScrollbarPosition._internal(2); const VerticalScrollbarPosition_._internal(2);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///An Android-specific class used to configure the position of the vertical scroll bar. ///An Android-specific class used to configure the position of the vertical scroll bar.
///Use [VerticalScrollbarPosition] instead. ///Use [VerticalScrollbarPosition] instead.
@Deprecated("Use VerticalScrollbarPosition instead") @Deprecated("Use VerticalScrollbarPosition instead")
class AndroidVerticalScrollbarPosition { @ExchangeableEnum()
class AndroidVerticalScrollbarPosition_ {
// ignore: unused_field
final int _value; final int _value;
const AndroidVerticalScrollbarPosition_._internal(this._value);
const AndroidVerticalScrollbarPosition._internal(this._value);
///Set of all values of [AndroidVerticalScrollbarPosition].
static final Set<AndroidVerticalScrollbarPosition> values = [
AndroidVerticalScrollbarPosition.SCROLLBAR_POSITION_DEFAULT,
AndroidVerticalScrollbarPosition.SCROLLBAR_POSITION_LEFT,
AndroidVerticalScrollbarPosition.SCROLLBAR_POSITION_RIGHT,
].toSet();
///Gets a possible [AndroidVerticalScrollbarPosition] instance from an [int] value.
static AndroidVerticalScrollbarPosition? fromValue(int? value) {
if (value != null) {
try {
return AndroidVerticalScrollbarPosition.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [int] value.
int toValue() => _value;
@override
String toString() {
switch (_value) {
case 1:
return "SCROLLBAR_POSITION_LEFT";
case 2:
return "SCROLLBAR_POSITION_RIGHT";
case 0:
default:
return "SCROLLBAR_POSITION_DEFAULT";
}
}
///Position the scroll bar at the default position as determined by the system. ///Position the scroll bar at the default position as determined by the system.
static const SCROLLBAR_POSITION_DEFAULT = static const SCROLLBAR_POSITION_DEFAULT =
const AndroidVerticalScrollbarPosition._internal(0); const AndroidVerticalScrollbarPosition_._internal(0);
///Position the scroll bar along the left edge. ///Position the scroll bar along the left edge.
static const SCROLLBAR_POSITION_LEFT = static const SCROLLBAR_POSITION_LEFT =
const AndroidVerticalScrollbarPosition._internal(1); const AndroidVerticalScrollbarPosition_._internal(1);
///Position the scroll bar along the right edge. ///Position the scroll bar along the right edge.
static const SCROLLBAR_POSITION_RIGHT = static const SCROLLBAR_POSITION_RIGHT =
const AndroidVerticalScrollbarPosition._internal(2); const AndroidVerticalScrollbarPosition_._internal(2);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }

View File

@ -0,0 +1,172 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'vertical_scrollbar_position.dart';
// **************************************************************************
// ExchangeableEnumGenerator
// **************************************************************************
///Class used to configure the position of the vertical scroll bar.
class VerticalScrollbarPosition {
final int _value;
final int _nativeValue;
const VerticalScrollbarPosition._internal(this._value, this._nativeValue);
// ignore: unused_element
factory VerticalScrollbarPosition._internalMultiPlatform(
int value, Function nativeValue) =>
VerticalScrollbarPosition._internal(value, nativeValue());
///Position the scroll bar at the default position as determined by the system.
static const SCROLLBAR_POSITION_DEFAULT =
VerticalScrollbarPosition._internal(0, 0);
///Position the scroll bar along the left edge.
static const SCROLLBAR_POSITION_LEFT =
VerticalScrollbarPosition._internal(1, 1);
///Position the scroll bar along the right edge.
static const SCROLLBAR_POSITION_RIGHT =
VerticalScrollbarPosition._internal(2, 2);
///Set of all values of [VerticalScrollbarPosition].
static final Set<VerticalScrollbarPosition> values = [
VerticalScrollbarPosition.SCROLLBAR_POSITION_DEFAULT,
VerticalScrollbarPosition.SCROLLBAR_POSITION_LEFT,
VerticalScrollbarPosition.SCROLLBAR_POSITION_RIGHT,
].toSet();
///Gets a possible [VerticalScrollbarPosition] instance from [int] value.
static VerticalScrollbarPosition? fromValue(int? value) {
if (value != null) {
try {
return VerticalScrollbarPosition.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets a possible [VerticalScrollbarPosition] instance from a native value.
static VerticalScrollbarPosition? fromNativeValue(int? value) {
if (value != null) {
try {
return VerticalScrollbarPosition.values
.firstWhere((element) => element.toNativeValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [int] value.
int toValue() => _value;
///Gets [int] native value.
int toNativeValue() => _nativeValue;
@override
int get hashCode => _value.hashCode;
@override
bool operator ==(value) => value == _value;
@override
String toString() {
switch (_value) {
case 0:
return 'SCROLLBAR_POSITION_DEFAULT';
case 1:
return 'SCROLLBAR_POSITION_LEFT';
case 2:
return 'SCROLLBAR_POSITION_RIGHT';
}
return _value.toString();
}
}
///An Android-specific class used to configure the position of the vertical scroll bar.
///Use [VerticalScrollbarPosition] instead.
@Deprecated('Use VerticalScrollbarPosition instead')
class AndroidVerticalScrollbarPosition {
final int _value;
final int _nativeValue;
const AndroidVerticalScrollbarPosition._internal(
this._value, this._nativeValue);
// ignore: unused_element
factory AndroidVerticalScrollbarPosition._internalMultiPlatform(
int value, Function nativeValue) =>
AndroidVerticalScrollbarPosition._internal(value, nativeValue());
///Position the scroll bar at the default position as determined by the system.
static const SCROLLBAR_POSITION_DEFAULT =
AndroidVerticalScrollbarPosition._internal(0, 0);
///Position the scroll bar along the left edge.
static const SCROLLBAR_POSITION_LEFT =
AndroidVerticalScrollbarPosition._internal(1, 1);
///Position the scroll bar along the right edge.
static const SCROLLBAR_POSITION_RIGHT =
AndroidVerticalScrollbarPosition._internal(2, 2);
///Set of all values of [AndroidVerticalScrollbarPosition].
static final Set<AndroidVerticalScrollbarPosition> values = [
AndroidVerticalScrollbarPosition.SCROLLBAR_POSITION_DEFAULT,
AndroidVerticalScrollbarPosition.SCROLLBAR_POSITION_LEFT,
AndroidVerticalScrollbarPosition.SCROLLBAR_POSITION_RIGHT,
].toSet();
///Gets a possible [AndroidVerticalScrollbarPosition] instance from [int] value.
static AndroidVerticalScrollbarPosition? fromValue(int? value) {
if (value != null) {
try {
return AndroidVerticalScrollbarPosition.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets a possible [AndroidVerticalScrollbarPosition] instance from a native value.
static AndroidVerticalScrollbarPosition? fromNativeValue(int? value) {
if (value != null) {
try {
return AndroidVerticalScrollbarPosition.values
.firstWhere((element) => element.toNativeValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [int] value.
int toValue() => _value;
///Gets [int] native value.
int toNativeValue() => _nativeValue;
@override
int get hashCode => _value.hashCode;
@override
bool operator ==(value) => value == _value;
@override
String toString() {
switch (_value) {
case 0:
return 'SCROLLBAR_POSITION_DEFAULT';
case 1:
return 'SCROLLBAR_POSITION_LEFT';
case 2:
return 'SCROLLBAR_POSITION_RIGHT';
}
return _value.toString();
}
}

View File

@ -1,40 +1,17 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'web_archive_format.g.dart';
///Class that represents the known Web Archive formats used when saving a web page. ///Class that represents the known Web Archive formats used when saving a web page.
class WebArchiveFormat { @ExchangeableEnum()
class WebArchiveFormat_ {
// ignore: unused_field
final String _value; final String _value;
const WebArchiveFormat_._internal(this._value);
const WebArchiveFormat._internal(this._value);
///Set of all values of [WebArchiveFormat].
static final Set<WebArchiveFormat> values =
[WebArchiveFormat.MHT, WebArchiveFormat.WEBARCHIVE].toSet();
///Gets a possible [WebArchiveFormat] instance from a [String] value.
static WebArchiveFormat? fromValue(String? value) {
if (value != null) {
try {
return WebArchiveFormat.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [String] value.
String toValue() => _value;
@override
String toString() => _value;
///Web Archive format used only by Android. ///Web Archive format used only by Android.
static const MHT = const WebArchiveFormat._internal("mht"); static const MHT = const WebArchiveFormat_._internal("mht");
///Web Archive format used only by iOS. ///Web Archive format used only by iOS.
static const WEBARCHIVE = const WebArchiveFormat._internal("webarchive"); static const WEBARCHIVE = const WebArchiveFormat_._internal("webarchive");
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }

View File

@ -0,0 +1,74 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'web_archive_format.dart';
// **************************************************************************
// ExchangeableEnumGenerator
// **************************************************************************
///Class that represents the known Web Archive formats used when saving a web page.
class WebArchiveFormat {
final String _value;
final String _nativeValue;
const WebArchiveFormat._internal(this._value, this._nativeValue);
// ignore: unused_element
factory WebArchiveFormat._internalMultiPlatform(
String value, Function nativeValue) =>
WebArchiveFormat._internal(value, nativeValue());
///Web Archive format used only by Android.
static const MHT = WebArchiveFormat._internal('mht', 'mht');
///Web Archive format used only by iOS.
static const WEBARCHIVE =
WebArchiveFormat._internal('webarchive', 'webarchive');
///Set of all values of [WebArchiveFormat].
static final Set<WebArchiveFormat> values = [
WebArchiveFormat.MHT,
WebArchiveFormat.WEBARCHIVE,
].toSet();
///Gets a possible [WebArchiveFormat] instance from [String] value.
static WebArchiveFormat? fromValue(String? value) {
if (value != null) {
try {
return WebArchiveFormat.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets a possible [WebArchiveFormat] instance from a native value.
static WebArchiveFormat? fromNativeValue(String? value) {
if (value != null) {
try {
return WebArchiveFormat.values
.firstWhere((element) => element.toNativeValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [String] value.
String toValue() => _value;
///Gets [String] native value.
String toNativeValue() => _nativeValue;
@override
int get hashCode => _value.hashCode;
@override
bool operator ==(value) => value == _value;
@override
String toString() {
return _value;
}
}

View File

@ -1,57 +1,20 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'web_authentication_session_error.g.dart';
///Class that represents the error code for a web authentication session error. ///Class that represents the error code for a web authentication session error.
class WebAuthenticationSessionError { @ExchangeableEnum()
class WebAuthenticationSessionError_ {
// ignore: unused_field
final int _value; final int _value;
const WebAuthenticationSessionError_._internal(this._value);
const WebAuthenticationSessionError._internal(this._value);
///Set of all values of [WebAuthenticationSessionError].
static final Set<WebAuthenticationSessionError> values = [
WebAuthenticationSessionError.CANCELED_LOGIN,
WebAuthenticationSessionError.PRESENTATION_CONTEXT_NOT_PROVIDED,
WebAuthenticationSessionError.PRESENTATION_CONTEXT_INVALID
].toSet();
///Gets a possible [WebAuthenticationSessionError] instance from an [int] value.
static WebAuthenticationSessionError? fromValue(int? value) {
if (value != null) {
try {
return WebAuthenticationSessionError.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [int] value.
int toValue() => _value;
@override
String toString() {
switch (_value) {
case 1:
return "CANCELED_LOGIN";
case 2:
return "PRESENTATION_CONTEXT_NOT_PROVIDED";
case 3:
return "PRESENTATION_CONTEXT_INVALID";
default:
return "UNKNOWN";
}
}
///The login has been canceled. ///The login has been canceled.
static final CANCELED_LOGIN = WebAuthenticationSessionError._internal(1); static const CANCELED_LOGIN = WebAuthenticationSessionError_._internal(1);
///A context wasnt provided. ///A context wasnt provided.
static final PRESENTATION_CONTEXT_NOT_PROVIDED = WebAuthenticationSessionError._internal(2); static const PRESENTATION_CONTEXT_NOT_PROVIDED = WebAuthenticationSessionError_._internal(2);
///The context was invalid. ///The context was invalid.
static final PRESENTATION_CONTEXT_INVALID = WebAuthenticationSessionError._internal(3); static const PRESENTATION_CONTEXT_INVALID = WebAuthenticationSessionError_._internal(3);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }

View File

@ -0,0 +1,87 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'web_authentication_session_error.dart';
// **************************************************************************
// ExchangeableEnumGenerator
// **************************************************************************
///Class that represents the error code for a web authentication session error.
class WebAuthenticationSessionError {
final int _value;
final int _nativeValue;
const WebAuthenticationSessionError._internal(this._value, this._nativeValue);
// ignore: unused_element
factory WebAuthenticationSessionError._internalMultiPlatform(
int value, Function nativeValue) =>
WebAuthenticationSessionError._internal(value, nativeValue());
///The login has been canceled.
static const CANCELED_LOGIN = WebAuthenticationSessionError._internal(1, 1);
///A context wasnt provided.
static const PRESENTATION_CONTEXT_NOT_PROVIDED =
WebAuthenticationSessionError._internal(2, 2);
///The context was invalid.
static const PRESENTATION_CONTEXT_INVALID =
WebAuthenticationSessionError._internal(3, 3);
///Set of all values of [WebAuthenticationSessionError].
static final Set<WebAuthenticationSessionError> values = [
WebAuthenticationSessionError.CANCELED_LOGIN,
WebAuthenticationSessionError.PRESENTATION_CONTEXT_NOT_PROVIDED,
WebAuthenticationSessionError.PRESENTATION_CONTEXT_INVALID,
].toSet();
///Gets a possible [WebAuthenticationSessionError] instance from [int] value.
static WebAuthenticationSessionError? fromValue(int? value) {
if (value != null) {
try {
return WebAuthenticationSessionError.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets a possible [WebAuthenticationSessionError] instance from a native value.
static WebAuthenticationSessionError? fromNativeValue(int? value) {
if (value != null) {
try {
return WebAuthenticationSessionError.values
.firstWhere((element) => element.toNativeValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [int] value.
int toValue() => _value;
///Gets [int] native value.
int toNativeValue() => _nativeValue;
@override
int get hashCode => _value.hashCode;
@override
bool operator ==(value) => value == _value;
@override
String toString() {
switch (_value) {
case 1:
return 'CANCELED_LOGIN';
case 2:
return 'PRESENTATION_CONTEXT_NOT_PROVIDED';
case 3:
return 'PRESENTATION_CONTEXT_INVALID';
}
return _value.toString();
}
}

View File

@ -1,61 +1,21 @@
import 'dart:collection'; import 'dart:collection';
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../in_app_webview/webview.dart'; import '../in_app_webview/webview.dart';
import 'web_history_item.dart'; import 'web_history_item.dart';
part 'web_history.g.dart';
///This class contains a snapshot of the current back/forward list for a [WebView]. ///This class contains a snapshot of the current back/forward list for a [WebView].
class WebHistory { @ExchangeableObject()
class WebHistory_ {
///List of all [WebHistoryItem]s. ///List of all [WebHistoryItem]s.
List<WebHistoryItem>? list; List<WebHistoryItem_>? list;
///Index of the current [WebHistoryItem]. ///Index of the current [WebHistoryItem].
int? currentIndex; int? currentIndex;
WebHistory({this.list, this.currentIndex}); WebHistory_({this.list, this.currentIndex});
///Gets a possible [WebHistory] instance from a [Map] value.
static WebHistory? fromMap(Map<String, dynamic>? map) {
if (map == null) {
return null;
}
List<LinkedHashMap<dynamic, dynamic>>? historyListMap =
map["history"]?.cast<LinkedHashMap<dynamic, dynamic>>();
int currentIndex = map["currentIndex"];
List<WebHistoryItem> historyList = <WebHistoryItem>[];
if (historyListMap != null) {
for (var i = 0; i < historyListMap.length; i++) {
var historyItem = historyListMap[i];
historyList.add(WebHistoryItem(
originalUrl: historyItem["originalUrl"] != null
? Uri.parse(historyItem["originalUrl"])
: null,
title: historyItem["title"],
url: historyItem["url"] != null
? Uri.parse(historyItem["url"])
: null,
index: i,
offset: i - currentIndex));
}
}
return WebHistory(list: historyList, currentIndex: currentIndex);
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {"list": list, "currentIndex": currentIndex};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return this.toMap();
}
@override
String toString() {
return toMap().toString();
}
} }

View File

@ -0,0 +1,48 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'web_history.dart';
// **************************************************************************
// ExchangeableObjectGenerator
// **************************************************************************
///This class contains a snapshot of the current back/forward list for a [WebView].
class WebHistory {
///List of all [WebHistoryItem]s.
List<WebHistoryItem>? list;
///Index of the current [WebHistoryItem].
int? currentIndex;
WebHistory({this.list, this.currentIndex});
///Gets a possible [WebHistory] instance from a [Map] value.
static WebHistory? fromMap(Map<String, dynamic>? map) {
if (map == null) {
return null;
}
final instance = WebHistory(
list: map['list']
?.map((e) => WebHistoryItem.fromMap(e?.cast<String, dynamic>())!),
currentIndex: map['currentIndex'],
);
return instance;
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {
"list": list?.map((e) => e.toMap()).toList(),
"currentIndex": currentIndex,
};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return toMap();
}
@override
String toString() {
return 'WebHistory{list: $list, currentIndex: $currentIndex}';
}
}

View File

@ -1,10 +1,15 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../in_app_webview/webview.dart'; import '../in_app_webview/webview.dart';
import 'web_history.dart'; import 'web_history.dart';
part 'web_history_item.g.dart';
///A convenience class for accessing fields in an entry in the back/forward list of a [WebView]. ///A convenience class for accessing fields in an entry in the back/forward list of a [WebView].
///Each [WebHistoryItem] is a snapshot of the requested history item. ///Each [WebHistoryItem] is a snapshot of the requested history item.
class WebHistoryItem { @ExchangeableObject()
class WebHistoryItem_ {
///Original url of this history item. ///Original url of this history item.
Uri? originalUrl; Uri? originalUrl;
@ -20,27 +25,6 @@ class WebHistoryItem {
///Position offset respect to the currentIndex of the back-forward [WebHistory.list]. ///Position offset respect to the currentIndex of the back-forward [WebHistory.list].
int? offset; int? offset;
WebHistoryItem( WebHistoryItem_(
{this.originalUrl, this.title, this.url, this.index, this.offset}); {this.originalUrl, this.title, this.url, this.index, this.offset});
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {
"originalUrl": originalUrl?.toString(),
"title": title,
"url": url?.toString(),
"index": index,
"offset": offset
};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return this.toMap();
}
@override
String toString() {
return toMap().toString();
}
} }

View File

@ -0,0 +1,65 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'web_history_item.dart';
// **************************************************************************
// ExchangeableObjectGenerator
// **************************************************************************
///A convenience class for accessing fields in an entry in the back/forward list of a [WebView].
///Each [WebHistoryItem] is a snapshot of the requested history item.
class WebHistoryItem {
///Original url of this history item.
Uri? originalUrl;
///Document title of this history item.
String? title;
///Url of this history item.
Uri? url;
///0-based position index in the back-forward [WebHistory.list].
int? index;
///Position offset respect to the currentIndex of the back-forward [WebHistory.list].
int? offset;
WebHistoryItem(
{this.originalUrl, this.title, this.url, this.index, this.offset});
///Gets a possible [WebHistoryItem] instance from a [Map] value.
static WebHistoryItem? fromMap(Map<String, dynamic>? map) {
if (map == null) {
return null;
}
final instance = WebHistoryItem(
originalUrl:
map['originalUrl'] != null ? Uri.parse(map['originalUrl']) : null,
title: map['title'],
url: map['url'] != null ? Uri.parse(map['url']) : null,
index: map['index'],
offset: map['offset'],
);
return instance;
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {
"originalUrl": originalUrl?.toString(),
"title": title,
"url": url?.toString(),
"index": index,
"offset": offset,
};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return toMap();
}
@override
String toString() {
return 'WebHistoryItem{originalUrl: $originalUrl, title: $title, url: $url, index: $index, offset: $offset}';
}
}

View File

@ -1,42 +1,17 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'web_resource_error_type.dart'; import 'web_resource_error_type.dart';
part 'web_resource_error.g.dart';
///Encapsulates information about errors occurred during loading of web resources. ///Encapsulates information about errors occurred during loading of web resources.
class WebResourceError { @ExchangeableObject()
class WebResourceError_ {
///The type of the error. ///The type of the error.
WebResourceErrorType type; WebResourceErrorType_ type;
///The string describing the error. ///The string describing the error.
String description; String description;
WebResourceError({required this.type, required this.description}); WebResourceError_({required this.type, required this.description});
///Gets a possible [WebResourceError] instance from a [Map] value.
static WebResourceError? fromMap(Map<String, dynamic>? map) {
if (map == null) {
return null;
}
return WebResourceError(
type: WebResourceErrorType.fromNativeValue(map["errorCode"])!,
description: map["description"]
);
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {
"type": type,
"description": description
};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return this.toMap();
}
@override
String toString() {
return toMap().toString();
}
} }

View File

@ -0,0 +1,47 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'web_resource_error.dart';
// **************************************************************************
// ExchangeableObjectGenerator
// **************************************************************************
///Encapsulates information about errors occurred during loading of web resources.
class WebResourceError {
///The type of the error.
WebResourceErrorType type;
///The string describing the error.
String description;
WebResourceError({required this.type, required this.description});
///Gets a possible [WebResourceError] instance from a [Map] value.
static WebResourceError? fromMap(Map<String, dynamic>? map) {
if (map == null) {
return null;
}
final instance = WebResourceError(
type: WebResourceErrorType.fromNativeValue(map['type'])!,
description: map['description'],
);
return instance;
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {
"type": type.toNativeValue(),
"description": description,
};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return toMap();
}
@override
String toString() {
return 'WebResourceError{type: $type, description: $description}';
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,12 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../in_app_webview/webview.dart'; import '../in_app_webview/webview.dart';
part 'web_resource_request.g.dart';
///Class representing a resource request of the [WebView]. ///Class representing a resource request of the [WebView].
class WebResourceRequest { @ExchangeableObject()
class WebResourceRequest_ {
///The URL for which the resource request was made. ///The URL for which the resource request was made.
Uri url; Uri url;
@ -33,48 +38,11 @@ class WebResourceRequest {
///**NOTE**: available on Android 21+. For Android < 21 it will be always `false`. ///**NOTE**: available on Android 21+. For Android < 21 it will be always `false`.
bool? isRedirect; bool? isRedirect;
WebResourceRequest( WebResourceRequest_(
{required this.url, {required this.url,
this.headers, this.headers,
required this.method, this.method,
required this.hasGesture, this.hasGesture,
required this.isForMainFrame, this.isForMainFrame,
required this.isRedirect}); this.isRedirect});
///Gets a possible [WebResourceRequest] instance from a [Map] value.
static WebResourceRequest? fromMap(Map<String, dynamic>? map) {
if (map == null) {
return null;
}
return WebResourceRequest(
url: Uri.parse(map["url"]),
headers: map["headers"]?.cast<String, String>(),
method: map["method"],
hasGesture: map["hasGesture"],
isForMainFrame: map["isForMainFrame"],
isRedirect: map["isRedirect"]);
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {
"url": url.toString(),
"headers": headers,
"method": method,
"hasGesture": hasGesture,
"isForMainFrame": isForMainFrame,
"isRedirect": isRedirect
};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return this.toMap();
}
@override
String toString() {
return toMap().toString();
}
} }

View File

@ -0,0 +1,86 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'web_resource_request.dart';
// **************************************************************************
// ExchangeableObjectGenerator
// **************************************************************************
///Class representing a resource request of the [WebView].
class WebResourceRequest {
///The URL for which the resource request was made.
Uri url;
///The headers associated with the request.
///
///**NOTE**: available on Android 21+. For Android < 21 it will be always `null`.
Map<String, String>? headers;
///The method associated with the request, for example `GET`.
///
///**NOTE**: available on Android 21+. For Android < 21 it will be always "GET".
String? method;
///Gets whether a gesture (such as a click) was associated with the request.
///For security reasons in certain situations this method may return `false` even though
///the sequence of events which caused the request to be created was initiated by a user
///gesture.
///
///**NOTE**: available on Android 21+. For Android < 21 it will be always `false`.
bool? hasGesture;
///Whether the request was made in order to fetch the main frame's document.
///
///**NOTE**: available on Android 21+. For Android < 21 it will be always `true`.
bool? isForMainFrame;
///Whether the request was a result of a server-side redirect.
///
///**NOTE**: available on Android 21+. For Android < 21 it will be always `false`.
bool? isRedirect;
WebResourceRequest(
{required this.url,
this.headers,
this.method,
this.hasGesture,
this.isForMainFrame,
this.isRedirect});
///Gets a possible [WebResourceRequest] instance from a [Map] value.
static WebResourceRequest? fromMap(Map<String, dynamic>? map) {
if (map == null) {
return null;
}
final instance = WebResourceRequest(
url: Uri.parse(map['url']),
headers: map['headers'],
method: map['method'],
hasGesture: map['hasGesture'],
isForMainFrame: map['isForMainFrame'],
isRedirect: map['isRedirect'],
);
return instance;
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {
"url": url.toString(),
"headers": headers,
"method": method,
"hasGesture": hasGesture,
"isForMainFrame": isForMainFrame,
"isRedirect": isRedirect,
};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return toMap();
}
@override
String toString() {
return 'WebResourceRequest{url: $url, headers: $headers, method: $method, hasGesture: $hasGesture, isForMainFrame: $isForMainFrame, isRedirect: $isRedirect}';
}
}

View File

@ -1,9 +1,14 @@
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../in_app_webview/webview.dart'; import '../in_app_webview/webview.dart';
part 'web_resource_response.g.dart';
///Class representing a resource response of the [WebView]. ///Class representing a resource response of the [WebView].
class WebResourceResponse { @ExchangeableObject()
class WebResourceResponse_ {
///The resource response's MIME type, for example `text/html`. ///The resource response's MIME type, for example `text/html`.
String contentType; String contentType;
@ -30,48 +35,11 @@ class WebResourceResponse {
///**NOTE**: available on Android 21+. For Android < 21 it won't be used. ///**NOTE**: available on Android 21+. For Android < 21 it won't be used.
String? reasonPhrase; String? reasonPhrase;
WebResourceResponse( WebResourceResponse_(
{this.contentType = "", {this.contentType = "",
this.contentEncoding = "utf-8", this.contentEncoding = "utf-8",
this.data, this.data,
this.headers, this.headers,
this.statusCode, this.statusCode,
this.reasonPhrase}); this.reasonPhrase});
///Gets a possible [WebResourceResponse] instance from a [Map] value.
static WebResourceResponse? fromMap(Map<String, dynamic>? map) {
if (map == null) {
return null;
}
return WebResourceResponse(
contentType: map["contentType"],
contentEncoding: map["contentEncoding"],
data: map["data"],
headers: map["headers"]?.cast<String, String>(),
statusCode: map["statusCode"],
reasonPhrase: map["reasonPhrase"]);
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {
"contentType": contentType,
"contentEncoding": contentEncoding,
"data": data,
"headers": headers,
"statusCode": statusCode,
"reasonPhrase": reasonPhrase
};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return this.toMap();
}
@override
String toString() {
return toMap().toString();
}
} }

View File

@ -0,0 +1,81 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'web_resource_response.dart';
// **************************************************************************
// ExchangeableObjectGenerator
// **************************************************************************
///Class representing a resource response of the [WebView].
class WebResourceResponse {
///The resource response's MIME type, for example `text/html`.
String contentType;
///The resource response's encoding. The default value is `utf-8`.
String contentEncoding;
///The data provided by the resource response.
Uint8List? data;
///The headers for the resource response. If [headers] isn't `null`, then you need to set also [statusCode] and [reasonPhrase].
///
///**NOTE**: available on Android 21+. For Android < 21 it won't be used.
Map<String, String>? headers;
///The status code needs to be in the ranges [100, 299], [400, 599]. Causing a redirect by specifying a 3xx code is not supported.
///If statusCode is set, then you need to set also [headers] and [reasonPhrase]. This value cannot be `null`.
///
///**NOTE**: available on Android 21+. For Android < 21 it won't be used.
int? statusCode;
///The phrase describing the status code, for example `"OK"`. Must be non-empty.
///If reasonPhrase is set, then you need to set also [headers] and [reasonPhrase]. This value cannot be `null`.
///
///**NOTE**: available on Android 21+. For Android < 21 it won't be used.
String? reasonPhrase;
WebResourceResponse(
{this.contentType = "",
this.contentEncoding = "utf-8",
this.data,
this.headers,
this.statusCode,
this.reasonPhrase});
///Gets a possible [WebResourceResponse] instance from a [Map] value.
static WebResourceResponse? fromMap(Map<String, dynamic>? map) {
if (map == null) {
return null;
}
final instance = WebResourceResponse(
data: map['data'],
headers: map['headers'],
statusCode: map['statusCode'],
reasonPhrase: map['reasonPhrase'],
);
instance.contentType = map['contentType'];
instance.contentEncoding = map['contentEncoding'];
return instance;
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {
"contentType": contentType,
"contentEncoding": contentEncoding,
"data": data,
"headers": headers,
"statusCode": statusCode,
"reasonPhrase": reasonPhrase,
};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return toMap();
}
@override
String toString() {
return 'WebResourceResponse{contentType: $contentType, contentEncoding: $contentEncoding, data: $data, headers: $headers, statusCode: $statusCode, reasonPhrase: $reasonPhrase}';
}
}

View File

@ -1,9 +1,14 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../web_storage/web_storage_manager.dart'; import '../web_storage/web_storage_manager.dart';
import '../web_storage/android/web_storage_manager.dart'; import '../web_storage/android/web_storage_manager.dart';
part 'web_storage_origin.g.dart';
///Class that encapsulates information about the amount of storage currently used by an origin for the JavaScript storage APIs. ///Class that encapsulates information about the amount of storage currently used by an origin for the JavaScript storage APIs.
///An origin comprises the host, scheme and port of a URI. See [WebStorageManager] for details. ///An origin comprises the host, scheme and port of a URI. See [WebStorageManager] for details.
class WebStorageOrigin { @ExchangeableObject()
class WebStorageOrigin_ {
///The string representation of this origin. ///The string representation of this origin.
String? origin; String? origin;
@ -13,29 +18,15 @@ class WebStorageOrigin {
///The total amount of storage currently being used by this origin, for all JavaScript storage APIs, in bytes. ///The total amount of storage currently being used by this origin, for all JavaScript storage APIs, in bytes.
int? usage; int? usage;
WebStorageOrigin({this.origin, this.quota, this.usage}); WebStorageOrigin_({this.origin, this.quota, this.usage});
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {"origin": origin, "quota": quota, "usage": usage};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return this.toMap();
}
@override
String toString() {
return toMap().toString();
}
} }
///Class that encapsulates information about the amount of storage currently used by an origin for the JavaScript storage APIs. ///Class that encapsulates information about the amount of storage currently used by an origin for the JavaScript storage APIs.
///An origin comprises the host, scheme and port of a URI. See [AndroidWebStorageManager] for details. ///An origin comprises the host, scheme and port of a URI. See [AndroidWebStorageManager] for details.
///Use [WebStorageOrigin] instead. ///Use [WebStorageOrigin] instead.
@Deprecated("Use WebStorageOrigin instead") @Deprecated("Use WebStorageOrigin instead")
class AndroidWebStorageOrigin { @ExchangeableObject()
class AndroidWebStorageOrigin_ {
///The string representation of this origin. ///The string representation of this origin.
String? origin; String? origin;
@ -45,20 +36,5 @@ class AndroidWebStorageOrigin {
///The total amount of storage currently being used by this origin, for all JavaScript storage APIs, in bytes. ///The total amount of storage currently being used by this origin, for all JavaScript storage APIs, in bytes.
int? usage; int? usage;
AndroidWebStorageOrigin({this.origin, this.quota, this.usage}); AndroidWebStorageOrigin_({this.origin, this.quota, this.usage});
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {"origin": origin, "quota": quota, "usage": usage};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return this.toMap();
}
@override
String toString() {
return toMap().toString();
}
} }

View File

@ -0,0 +1,101 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'web_storage_origin.dart';
// **************************************************************************
// ExchangeableObjectGenerator
// **************************************************************************
///Class that encapsulates information about the amount of storage currently used by an origin for the JavaScript storage APIs.
///An origin comprises the host, scheme and port of a URI. See [WebStorageManager] for details.
class WebStorageOrigin {
///The string representation of this origin.
String? origin;
///The quota for this origin, for the Web SQL Database API, in bytes.
int? quota;
///The total amount of storage currently being used by this origin, for all JavaScript storage APIs, in bytes.
int? usage;
WebStorageOrigin({this.origin, this.quota, this.usage});
///Gets a possible [WebStorageOrigin] instance from a [Map] value.
static WebStorageOrigin? fromMap(Map<String, dynamic>? map) {
if (map == null) {
return null;
}
final instance = WebStorageOrigin(
origin: map['origin'],
quota: map['quota'],
usage: map['usage'],
);
return instance;
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {
"origin": origin,
"quota": quota,
"usage": usage,
};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return toMap();
}
@override
String toString() {
return 'WebStorageOrigin{origin: $origin, quota: $quota, usage: $usage}';
}
}
///Class that encapsulates information about the amount of storage currently used by an origin for the JavaScript storage APIs.
///An origin comprises the host, scheme and port of a URI. See [AndroidWebStorageManager] for details.
///Use [WebStorageOrigin] instead.
@Deprecated('Use WebStorageOrigin instead')
class AndroidWebStorageOrigin {
///The string representation of this origin.
String? origin;
///The quota for this origin, for the Web SQL Database API, in bytes.
int? quota;
///The total amount of storage currently being used by this origin, for all JavaScript storage APIs, in bytes.
int? usage;
AndroidWebStorageOrigin({this.origin, this.quota, this.usage});
///Gets a possible [AndroidWebStorageOrigin] instance from a [Map] value.
static AndroidWebStorageOrigin? fromMap(Map<String, dynamic>? map) {
if (map == null) {
return null;
}
final instance = AndroidWebStorageOrigin(
origin: map['origin'],
quota: map['quota'],
usage: map['usage'],
);
return instance;
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {
"origin": origin,
"quota": quota,
"usage": usage,
};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return toMap();
}
@override
String toString() {
return 'AndroidWebStorageOrigin{origin: $origin, quota: $quota, usage: $usage}';
}
}

View File

@ -1,47 +1,22 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../web_storage/web_storage.dart'; import '../web_storage/web_storage.dart';
part 'web_storage_type.g.dart';
///Class that represents the type of Web Storage: `localStorage` or `sessionStorage`. ///Class that represents the type of Web Storage: `localStorage` or `sessionStorage`.
///Used by the [Storage] class. ///Used by the [Storage] class.
class WebStorageType { @ExchangeableEnum()
class WebStorageType_ {
// ignore: unused_field
final String _value; final String _value;
const WebStorageType_._internal(this._value);
const WebStorageType._internal(this._value);
///Set of all values of [WebStorageType].
static final Set<WebStorageType> values = [
WebStorageType.LOCAL_STORAGE,
WebStorageType.SESSION_STORAGE,
].toSet();
///Gets a possible [WebStorageType] instance from a [String] value.
static WebStorageType? fromValue(String? value) {
if (value != null) {
try {
return WebStorageType.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [String] value.
String toValue() => _value;
@override
String toString() => _value;
///`window.localStorage`: same as [SESSION_STORAGE], but persists even when the browser is closed and reopened. ///`window.localStorage`: same as [SESSION_STORAGE], but persists even when the browser is closed and reopened.
static const LOCAL_STORAGE = const WebStorageType._internal("localStorage"); static const LOCAL_STORAGE = const WebStorageType_._internal("localStorage");
///`window.sessionStorage`: maintains a separate storage area for each given origin that's available for the duration ///`window.sessionStorage`: maintains a separate storage area for each given origin that's available for the duration
///of the page session (as long as the browser is open, including page reloads and restores). ///of the page session (as long as the browser is open, including page reloads and restores).
static const SESSION_STORAGE = static const SESSION_STORAGE =
const WebStorageType._internal("sessionStorage"); const WebStorageType_._internal("sessionStorage");
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }

View File

@ -0,0 +1,77 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'web_storage_type.dart';
// **************************************************************************
// ExchangeableEnumGenerator
// **************************************************************************
///Class that represents the type of Web Storage: `localStorage` or `sessionStorage`.
///Used by the [Storage] class.
class WebStorageType {
final String _value;
final String _nativeValue;
const WebStorageType._internal(this._value, this._nativeValue);
// ignore: unused_element
factory WebStorageType._internalMultiPlatform(
String value, Function nativeValue) =>
WebStorageType._internal(value, nativeValue());
///`window.localStorage`: same as [SESSION_STORAGE], but persists even when the browser is closed and reopened.
static const LOCAL_STORAGE =
WebStorageType._internal('localStorage', 'localStorage');
///`window.sessionStorage`: maintains a separate storage area for each given origin that's available for the duration
///of the page session (as long as the browser is open, including page reloads and restores).
static const SESSION_STORAGE =
WebStorageType._internal('sessionStorage', 'sessionStorage');
///Set of all values of [WebStorageType].
static final Set<WebStorageType> values = [
WebStorageType.LOCAL_STORAGE,
WebStorageType.SESSION_STORAGE,
].toSet();
///Gets a possible [WebStorageType] instance from [String] value.
static WebStorageType? fromValue(String? value) {
if (value != null) {
try {
return WebStorageType.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets a possible [WebStorageType] instance from a native value.
static WebStorageType? fromNativeValue(String? value) {
if (value != null) {
try {
return WebStorageType.values
.firstWhere((element) => element.toNativeValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [String] value.
String toValue() => _value;
///Gets [String] native value.
String toNativeValue() => _nativeValue;
@override
int get hashCode => _value.hashCode;
@override
bool operator ==(value) => value == _value;
@override
String toString() {
return _value;
}
}

View File

@ -1,36 +1,19 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import 'website_data_type.dart'; import 'website_data_type.dart';
part 'website_data_record.g.dart';
///Class that represents website data, grouped by domain name using the public suffix list. ///Class that represents website data, grouped by domain name using the public suffix list.
class WebsiteDataRecord { @ExchangeableObject()
class WebsiteDataRecord_ {
///The display name for the data record. This is usually the domain name. ///The display name for the data record. This is usually the domain name.
String? displayName; String? displayName;
///The various types of website data that exist for this data record. ///The various types of website data that exist for this data record.
Set<WebsiteDataType>? dataTypes; Set<WebsiteDataType_>? dataTypes;
WebsiteDataRecord({this.displayName, this.dataTypes}); WebsiteDataRecord_({this.displayName, this.dataTypes});
///Converts instance to a map.
Map<String, dynamic> toMap() {
List<String> dataTypesString = [];
if (dataTypes != null) {
for (var dataType in dataTypes!) {
dataTypesString.add(dataType.toValue());
}
}
return {"displayName": displayName, "dataTypes": dataTypesString};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return this.toMap();
}
@override
String toString() {
return toMap().toString();
}
} }
///Class that represents website data, grouped by domain name using the public suffix list. ///Class that represents website data, grouped by domain name using the public suffix list.
@ -39,34 +22,13 @@ class WebsiteDataRecord {
/// ///
///Use [WebsiteDataRecord] instead. ///Use [WebsiteDataRecord] instead.
@Deprecated("Use WebsiteDataRecord instead") @Deprecated("Use WebsiteDataRecord instead")
class IOSWKWebsiteDataRecord { @ExchangeableObject()
class IOSWKWebsiteDataRecord_ {
///The display name for the data record. This is usually the domain name. ///The display name for the data record. This is usually the domain name.
String? displayName; String? displayName;
///The various types of website data that exist for this data record. ///The various types of website data that exist for this data record.
Set<IOSWKWebsiteDataType>? dataTypes; Set<IOSWKWebsiteDataType_>? dataTypes;
IOSWKWebsiteDataRecord({this.displayName, this.dataTypes}); IOSWKWebsiteDataRecord_({this.displayName, this.dataTypes});
///Converts instance to a map.
Map<String, dynamic> toMap() {
List<String> dataTypesString = [];
if (dataTypes != null) {
for (var dataType in dataTypes!) {
dataTypesString.add(dataType.toValue());
}
}
return {"displayName": displayName, "dataTypes": dataTypesString};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return this.toMap();
}
@override
String toString() {
return toMap().toString();
}
} }

View File

@ -0,0 +1,96 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'website_data_record.dart';
// **************************************************************************
// ExchangeableObjectGenerator
// **************************************************************************
///Class that represents website data, grouped by domain name using the public suffix list.
class WebsiteDataRecord {
///The display name for the data record. This is usually the domain name.
String? displayName;
///The various types of website data that exist for this data record.
Set<WebsiteDataType>? dataTypes;
WebsiteDataRecord({this.displayName, this.dataTypes});
///Gets a possible [WebsiteDataRecord] instance from a [Map] value.
static WebsiteDataRecord? fromMap(Map<String, dynamic>? map) {
if (map == null) {
return null;
}
final instance = WebsiteDataRecord(
displayName: map['displayName'],
dataTypes: map['dataTypes']
?.map((e) => WebsiteDataType.fromNativeValue(e)!)
.toSet(),
);
return instance;
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {
"displayName": displayName,
"dataTypes": dataTypes?.map((e) => e.toNativeValue()).toList(),
};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return toMap();
}
@override
String toString() {
return 'WebsiteDataRecord{displayName: $displayName, dataTypes: $dataTypes}';
}
}
///Class that represents website data, grouped by domain name using the public suffix list.
///
///**NOTE**: available on iOS 9.0+.
///
///Use [WebsiteDataRecord] instead.
@Deprecated('Use WebsiteDataRecord instead')
class IOSWKWebsiteDataRecord {
///The display name for the data record. This is usually the domain name.
String? displayName;
///The various types of website data that exist for this data record.
Set<IOSWKWebsiteDataType>? dataTypes;
IOSWKWebsiteDataRecord({this.displayName, this.dataTypes});
///Gets a possible [IOSWKWebsiteDataRecord] instance from a [Map] value.
static IOSWKWebsiteDataRecord? fromMap(Map<String, dynamic>? map) {
if (map == null) {
return null;
}
final instance = IOSWKWebsiteDataRecord(
displayName: map['displayName'],
dataTypes: map['dataTypes']
?.map((e) => IOSWKWebsiteDataType.fromNativeValue(e)!)
.toSet(),
);
return instance;
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {
"displayName": displayName,
"dataTypes": dataTypes?.map((e) => e.toNativeValue()).toList(),
};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return toMap();
}
@override
String toString() {
return 'IOSWKWebsiteDataRecord{displayName: $displayName, dataTypes: $dataTypes}';
}
}

View File

@ -1,107 +1,75 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
part 'website_data_type.g.dart';
///Class that represents a website data type. ///Class that represents a website data type.
class WebsiteDataType { @ExchangeableEnum()
class WebsiteDataType_ {
// ignore: unused_field
final String _value; final String _value;
const WebsiteDataType_._internal(this._value);
const WebsiteDataType._internal(this._value);
///Set of all values of [WebsiteDataType].
static final Set<WebsiteDataType> values = [
WebsiteDataType.WKWebsiteDataTypeFetchCache,
WebsiteDataType.WKWebsiteDataTypeDiskCache,
WebsiteDataType.WKWebsiteDataTypeMemoryCache,
WebsiteDataType.WKWebsiteDataTypeOfflineWebApplicationCache,
WebsiteDataType.WKWebsiteDataTypeCookies,
WebsiteDataType.WKWebsiteDataTypeSessionStorage,
WebsiteDataType.WKWebsiteDataTypeLocalStorage,
WebsiteDataType.WKWebsiteDataTypeWebSQLDatabases,
WebsiteDataType.WKWebsiteDataTypeIndexedDBDatabases,
WebsiteDataType.WKWebsiteDataTypeServiceWorkerRegistrations,
].toSet();
///Gets a possible [WebsiteDataType] instance from a [String] value.
static WebsiteDataType? fromValue(String? value) {
if (value != null) {
try {
return WebsiteDataType.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [String] value.
String toValue() => _value;
@override
String toString() => _value;
///On-disk Fetch caches. ///On-disk Fetch caches.
/// ///
///**NOTE**: available on iOS 11.3+. ///**NOTE**: available on iOS 11.3+.
static const WKWebsiteDataTypeFetchCache = static const WKWebsiteDataTypeFetchCache =
const WebsiteDataType._internal("WKWebsiteDataTypeFetchCache"); const WebsiteDataType_._internal("WKWebsiteDataTypeFetchCache");
///On-disk caches. ///On-disk caches.
static const WKWebsiteDataTypeDiskCache = static const WKWebsiteDataTypeDiskCache =
const WebsiteDataType._internal("WKWebsiteDataTypeDiskCache"); const WebsiteDataType_._internal("WKWebsiteDataTypeDiskCache");
///In-memory caches. ///In-memory caches.
static const WKWebsiteDataTypeMemoryCache = static const WKWebsiteDataTypeMemoryCache =
const WebsiteDataType._internal("WKWebsiteDataTypeMemoryCache"); const WebsiteDataType_._internal("WKWebsiteDataTypeMemoryCache");
///HTML offline web application caches. ///HTML offline web application caches.
static const WKWebsiteDataTypeOfflineWebApplicationCache = static const WKWebsiteDataTypeOfflineWebApplicationCache =
const WebsiteDataType._internal( const WebsiteDataType_._internal(
"WKWebsiteDataTypeOfflineWebApplicationCache"); "WKWebsiteDataTypeOfflineWebApplicationCache");
///Cookies. ///Cookies.
static const WKWebsiteDataTypeCookies = static const WKWebsiteDataTypeCookies =
const WebsiteDataType._internal("WKWebsiteDataTypeCookies"); const WebsiteDataType_._internal("WKWebsiteDataTypeCookies");
///HTML session storage. ///HTML session storage.
static const WKWebsiteDataTypeSessionStorage = static const WKWebsiteDataTypeSessionStorage =
const WebsiteDataType._internal("WKWebsiteDataTypeSessionStorage"); const WebsiteDataType_._internal("WKWebsiteDataTypeSessionStorage");
///HTML local storage. ///HTML local storage.
static const WKWebsiteDataTypeLocalStorage = static const WKWebsiteDataTypeLocalStorage =
const WebsiteDataType._internal("WKWebsiteDataTypeLocalStorage"); const WebsiteDataType_._internal("WKWebsiteDataTypeLocalStorage");
///WebSQL databases. ///WebSQL databases.
static const WKWebsiteDataTypeWebSQLDatabases = static const WKWebsiteDataTypeWebSQLDatabases =
const WebsiteDataType._internal("WKWebsiteDataTypeWebSQLDatabases"); const WebsiteDataType_._internal("WKWebsiteDataTypeWebSQLDatabases");
///IndexedDB databases. ///IndexedDB databases.
static const WKWebsiteDataTypeIndexedDBDatabases = static const WKWebsiteDataTypeIndexedDBDatabases =
const WebsiteDataType._internal("WKWebsiteDataTypeIndexedDBDatabases"); const WebsiteDataType_._internal("WKWebsiteDataTypeIndexedDBDatabases");
///Service worker registrations. ///Service worker registrations.
/// ///
///**NOTE**: available on iOS 11.3+. ///**NOTE**: available on iOS 11.3+.
static const WKWebsiteDataTypeServiceWorkerRegistrations = static const WKWebsiteDataTypeServiceWorkerRegistrations =
const WebsiteDataType._internal( const WebsiteDataType_._internal(
"WKWebsiteDataTypeServiceWorkerRegistrations"); "WKWebsiteDataTypeServiceWorkerRegistrations");
///Returns a set of all available website data types. ///Returns a set of all available website data types.
@ExchangeableEnumCustomValue()
// ignore: non_constant_identifier_names // ignore: non_constant_identifier_names
static final Set<WebsiteDataType> ALL = [ static final Set<WebsiteDataType_> ALL = [
WebsiteDataType.WKWebsiteDataTypeFetchCache, WebsiteDataType_.WKWebsiteDataTypeFetchCache,
WebsiteDataType.WKWebsiteDataTypeDiskCache, WebsiteDataType_.WKWebsiteDataTypeDiskCache,
WebsiteDataType.WKWebsiteDataTypeMemoryCache, WebsiteDataType_.WKWebsiteDataTypeMemoryCache,
WebsiteDataType.WKWebsiteDataTypeOfflineWebApplicationCache, WebsiteDataType_.WKWebsiteDataTypeOfflineWebApplicationCache,
WebsiteDataType.WKWebsiteDataTypeCookies, WebsiteDataType_.WKWebsiteDataTypeCookies,
WebsiteDataType.WKWebsiteDataTypeSessionStorage, WebsiteDataType_.WKWebsiteDataTypeSessionStorage,
WebsiteDataType.WKWebsiteDataTypeLocalStorage, WebsiteDataType_.WKWebsiteDataTypeLocalStorage,
WebsiteDataType.WKWebsiteDataTypeWebSQLDatabases, WebsiteDataType_.WKWebsiteDataTypeWebSQLDatabases,
WebsiteDataType.WKWebsiteDataTypeIndexedDBDatabases, WebsiteDataType_.WKWebsiteDataTypeIndexedDBDatabases,
WebsiteDataType.WKWebsiteDataTypeServiceWorkerRegistrations WebsiteDataType_.WKWebsiteDataTypeServiceWorkerRegistrations
].toSet(); ].toSet();
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///Class that represents a website data type. ///Class that represents a website data type.
@ -110,108 +78,72 @@ class WebsiteDataType {
/// ///
///Use [WebsiteDataType] instead. ///Use [WebsiteDataType] instead.
@Deprecated("Use WebsiteDataType instead") @Deprecated("Use WebsiteDataType instead")
class IOSWKWebsiteDataType { @ExchangeableEnum()
class IOSWKWebsiteDataType_ {
// ignore: unused_field
final String _value; final String _value;
const IOSWKWebsiteDataType_._internal(this._value);
const IOSWKWebsiteDataType._internal(this._value);
///Set of all values of [IOSWKWebsiteDataType].
static final Set<IOSWKWebsiteDataType> values = [
IOSWKWebsiteDataType.WKWebsiteDataTypeFetchCache,
IOSWKWebsiteDataType.WKWebsiteDataTypeDiskCache,
IOSWKWebsiteDataType.WKWebsiteDataTypeMemoryCache,
IOSWKWebsiteDataType.WKWebsiteDataTypeOfflineWebApplicationCache,
IOSWKWebsiteDataType.WKWebsiteDataTypeCookies,
IOSWKWebsiteDataType.WKWebsiteDataTypeSessionStorage,
IOSWKWebsiteDataType.WKWebsiteDataTypeLocalStorage,
IOSWKWebsiteDataType.WKWebsiteDataTypeWebSQLDatabases,
IOSWKWebsiteDataType.WKWebsiteDataTypeIndexedDBDatabases,
IOSWKWebsiteDataType.WKWebsiteDataTypeServiceWorkerRegistrations,
].toSet();
///Gets a possible [IOSWKWebsiteDataType] instance from a [String] value.
static IOSWKWebsiteDataType? fromValue(String? value) {
if (value != null) {
try {
return IOSWKWebsiteDataType.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [String] value.
String toValue() => _value;
@override
String toString() => _value;
///On-disk Fetch caches. ///On-disk Fetch caches.
/// ///
///**NOTE**: available on iOS 11.3+. ///**NOTE**: available on iOS 11.3+.
static const WKWebsiteDataTypeFetchCache = static const WKWebsiteDataTypeFetchCache =
const IOSWKWebsiteDataType._internal("WKWebsiteDataTypeFetchCache"); const IOSWKWebsiteDataType_._internal("WKWebsiteDataTypeFetchCache");
///On-disk caches. ///On-disk caches.
static const WKWebsiteDataTypeDiskCache = static const WKWebsiteDataTypeDiskCache =
const IOSWKWebsiteDataType._internal("WKWebsiteDataTypeDiskCache"); const IOSWKWebsiteDataType_._internal("WKWebsiteDataTypeDiskCache");
///In-memory caches. ///In-memory caches.
static const WKWebsiteDataTypeMemoryCache = static const WKWebsiteDataTypeMemoryCache =
const IOSWKWebsiteDataType._internal("WKWebsiteDataTypeMemoryCache"); const IOSWKWebsiteDataType_._internal("WKWebsiteDataTypeMemoryCache");
///HTML offline web application caches. ///HTML offline web application caches.
static const WKWebsiteDataTypeOfflineWebApplicationCache = static const WKWebsiteDataTypeOfflineWebApplicationCache =
const IOSWKWebsiteDataType._internal( const IOSWKWebsiteDataType_._internal(
"WKWebsiteDataTypeOfflineWebApplicationCache"); "WKWebsiteDataTypeOfflineWebApplicationCache");
///Cookies. ///Cookies.
static const WKWebsiteDataTypeCookies = static const WKWebsiteDataTypeCookies =
const IOSWKWebsiteDataType._internal("WKWebsiteDataTypeCookies"); const IOSWKWebsiteDataType_._internal("WKWebsiteDataTypeCookies");
///HTML session storage. ///HTML session storage.
static const WKWebsiteDataTypeSessionStorage = static const WKWebsiteDataTypeSessionStorage =
const IOSWKWebsiteDataType._internal("WKWebsiteDataTypeSessionStorage"); const IOSWKWebsiteDataType_._internal("WKWebsiteDataTypeSessionStorage");
///HTML local storage. ///HTML local storage.
static const WKWebsiteDataTypeLocalStorage = static const WKWebsiteDataTypeLocalStorage =
const IOSWKWebsiteDataType._internal("WKWebsiteDataTypeLocalStorage"); const IOSWKWebsiteDataType_._internal("WKWebsiteDataTypeLocalStorage");
///WebSQL databases. ///WebSQL databases.
static const WKWebsiteDataTypeWebSQLDatabases = static const WKWebsiteDataTypeWebSQLDatabases =
const IOSWKWebsiteDataType._internal("WKWebsiteDataTypeWebSQLDatabases"); const IOSWKWebsiteDataType_._internal("WKWebsiteDataTypeWebSQLDatabases");
///IndexedDB databases. ///IndexedDB databases.
static const WKWebsiteDataTypeIndexedDBDatabases = static const WKWebsiteDataTypeIndexedDBDatabases =
const IOSWKWebsiteDataType._internal( const IOSWKWebsiteDataType_._internal(
"WKWebsiteDataTypeIndexedDBDatabases"); "WKWebsiteDataTypeIndexedDBDatabases");
///Service worker registrations. ///Service worker registrations.
/// ///
///**NOTE**: available on iOS 11.3+. ///**NOTE**: available on iOS 11.3+.
static const WKWebsiteDataTypeServiceWorkerRegistrations = static const WKWebsiteDataTypeServiceWorkerRegistrations =
const IOSWKWebsiteDataType._internal( const IOSWKWebsiteDataType_._internal(
"WKWebsiteDataTypeServiceWorkerRegistrations"); "WKWebsiteDataTypeServiceWorkerRegistrations");
///Returns a set of all available website data types. ///Returns a set of all available website data types.
@ExchangeableEnumCustomValue()
// ignore: non_constant_identifier_names // ignore: non_constant_identifier_names
static final Set<IOSWKWebsiteDataType> ALL = [ static final Set<IOSWKWebsiteDataType_> ALL = [
IOSWKWebsiteDataType.WKWebsiteDataTypeFetchCache, IOSWKWebsiteDataType_.WKWebsiteDataTypeFetchCache,
IOSWKWebsiteDataType.WKWebsiteDataTypeDiskCache, IOSWKWebsiteDataType_.WKWebsiteDataTypeDiskCache,
IOSWKWebsiteDataType.WKWebsiteDataTypeMemoryCache, IOSWKWebsiteDataType_.WKWebsiteDataTypeMemoryCache,
IOSWKWebsiteDataType.WKWebsiteDataTypeOfflineWebApplicationCache, IOSWKWebsiteDataType_.WKWebsiteDataTypeOfflineWebApplicationCache,
IOSWKWebsiteDataType.WKWebsiteDataTypeCookies, IOSWKWebsiteDataType_.WKWebsiteDataTypeCookies,
IOSWKWebsiteDataType.WKWebsiteDataTypeSessionStorage, IOSWKWebsiteDataType_.WKWebsiteDataTypeSessionStorage,
IOSWKWebsiteDataType.WKWebsiteDataTypeLocalStorage, IOSWKWebsiteDataType_.WKWebsiteDataTypeLocalStorage,
IOSWKWebsiteDataType.WKWebsiteDataTypeWebSQLDatabases, IOSWKWebsiteDataType_.WKWebsiteDataTypeWebSQLDatabases,
IOSWKWebsiteDataType.WKWebsiteDataTypeIndexedDBDatabases, IOSWKWebsiteDataType_.WKWebsiteDataTypeIndexedDBDatabases,
IOSWKWebsiteDataType.WKWebsiteDataTypeServiceWorkerRegistrations IOSWKWebsiteDataType_.WKWebsiteDataTypeServiceWorkerRegistrations
].toSet(); ].toSet();
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }

View File

@ -0,0 +1,273 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'website_data_type.dart';
// **************************************************************************
// ExchangeableEnumGenerator
// **************************************************************************
///Class that represents a website data type.
class WebsiteDataType {
final String _value;
final String _nativeValue;
const WebsiteDataType._internal(this._value, this._nativeValue);
// ignore: unused_element
factory WebsiteDataType._internalMultiPlatform(
String value, Function nativeValue) =>
WebsiteDataType._internal(value, nativeValue());
///On-disk Fetch caches.
///
///**NOTE**: available on iOS 11.3+.
static const WKWebsiteDataTypeFetchCache = WebsiteDataType._internal(
'WKWebsiteDataTypeFetchCache', 'WKWebsiteDataTypeFetchCache');
///On-disk caches.
static const WKWebsiteDataTypeDiskCache = WebsiteDataType._internal(
'WKWebsiteDataTypeDiskCache', 'WKWebsiteDataTypeDiskCache');
///In-memory caches.
static const WKWebsiteDataTypeMemoryCache = WebsiteDataType._internal(
'WKWebsiteDataTypeMemoryCache', 'WKWebsiteDataTypeMemoryCache');
///HTML offline web application caches.
static const WKWebsiteDataTypeOfflineWebApplicationCache =
WebsiteDataType._internal('WKWebsiteDataTypeOfflineWebApplicationCache',
'WKWebsiteDataTypeOfflineWebApplicationCache');
///Cookies.
static const WKWebsiteDataTypeCookies = WebsiteDataType._internal(
'WKWebsiteDataTypeCookies', 'WKWebsiteDataTypeCookies');
///HTML session storage.
static const WKWebsiteDataTypeSessionStorage = WebsiteDataType._internal(
'WKWebsiteDataTypeSessionStorage', 'WKWebsiteDataTypeSessionStorage');
///HTML local storage.
static const WKWebsiteDataTypeLocalStorage = WebsiteDataType._internal(
'WKWebsiteDataTypeLocalStorage', 'WKWebsiteDataTypeLocalStorage');
///WebSQL databases.
static const WKWebsiteDataTypeWebSQLDatabases = WebsiteDataType._internal(
'WKWebsiteDataTypeWebSQLDatabases', 'WKWebsiteDataTypeWebSQLDatabases');
///IndexedDB databases.
static const WKWebsiteDataTypeIndexedDBDatabases = WebsiteDataType._internal(
'WKWebsiteDataTypeIndexedDBDatabases',
'WKWebsiteDataTypeIndexedDBDatabases');
///Service worker registrations.
///
///**NOTE**: available on iOS 11.3+.
static const WKWebsiteDataTypeServiceWorkerRegistrations =
WebsiteDataType._internal('WKWebsiteDataTypeServiceWorkerRegistrations',
'WKWebsiteDataTypeServiceWorkerRegistrations');
///Returns a set of all available website data types.
static final ALL = [
WebsiteDataType.WKWebsiteDataTypeFetchCache,
WebsiteDataType.WKWebsiteDataTypeDiskCache,
WebsiteDataType.WKWebsiteDataTypeMemoryCache,
WebsiteDataType.WKWebsiteDataTypeOfflineWebApplicationCache,
WebsiteDataType.WKWebsiteDataTypeCookies,
WebsiteDataType.WKWebsiteDataTypeSessionStorage,
WebsiteDataType.WKWebsiteDataTypeLocalStorage,
WebsiteDataType.WKWebsiteDataTypeWebSQLDatabases,
WebsiteDataType.WKWebsiteDataTypeIndexedDBDatabases,
WebsiteDataType.WKWebsiteDataTypeServiceWorkerRegistrations
].toSet();
///Set of all values of [WebsiteDataType].
static final Set<WebsiteDataType> values = [
WebsiteDataType.WKWebsiteDataTypeFetchCache,
WebsiteDataType.WKWebsiteDataTypeDiskCache,
WebsiteDataType.WKWebsiteDataTypeMemoryCache,
WebsiteDataType.WKWebsiteDataTypeOfflineWebApplicationCache,
WebsiteDataType.WKWebsiteDataTypeCookies,
WebsiteDataType.WKWebsiteDataTypeSessionStorage,
WebsiteDataType.WKWebsiteDataTypeLocalStorage,
WebsiteDataType.WKWebsiteDataTypeWebSQLDatabases,
WebsiteDataType.WKWebsiteDataTypeIndexedDBDatabases,
WebsiteDataType.WKWebsiteDataTypeServiceWorkerRegistrations,
].toSet();
///Gets a possible [WebsiteDataType] instance from [String] value.
static WebsiteDataType? fromValue(String? value) {
if (value != null) {
try {
return WebsiteDataType.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets a possible [WebsiteDataType] instance from a native value.
static WebsiteDataType? fromNativeValue(String? value) {
if (value != null) {
try {
return WebsiteDataType.values
.firstWhere((element) => element.toNativeValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [String] value.
String toValue() => _value;
///Gets [String] native value.
String toNativeValue() => _nativeValue;
@override
int get hashCode => _value.hashCode;
@override
bool operator ==(value) => value == _value;
@override
String toString() {
return _value;
}
}
///Class that represents a website data type.
///
///**NOTE**: available on iOS 9.0+.
///
///Use [WebsiteDataType] instead.
@Deprecated('Use WebsiteDataType instead')
class IOSWKWebsiteDataType {
final String _value;
final String _nativeValue;
const IOSWKWebsiteDataType._internal(this._value, this._nativeValue);
// ignore: unused_element
factory IOSWKWebsiteDataType._internalMultiPlatform(
String value, Function nativeValue) =>
IOSWKWebsiteDataType._internal(value, nativeValue());
///On-disk Fetch caches.
///
///**NOTE**: available on iOS 11.3+.
static const WKWebsiteDataTypeFetchCache = IOSWKWebsiteDataType._internal(
'WKWebsiteDataTypeFetchCache', 'WKWebsiteDataTypeFetchCache');
///On-disk caches.
static const WKWebsiteDataTypeDiskCache = IOSWKWebsiteDataType._internal(
'WKWebsiteDataTypeDiskCache', 'WKWebsiteDataTypeDiskCache');
///In-memory caches.
static const WKWebsiteDataTypeMemoryCache = IOSWKWebsiteDataType._internal(
'WKWebsiteDataTypeMemoryCache', 'WKWebsiteDataTypeMemoryCache');
///HTML offline web application caches.
static const WKWebsiteDataTypeOfflineWebApplicationCache =
IOSWKWebsiteDataType._internal(
'WKWebsiteDataTypeOfflineWebApplicationCache',
'WKWebsiteDataTypeOfflineWebApplicationCache');
///Cookies.
static const WKWebsiteDataTypeCookies = IOSWKWebsiteDataType._internal(
'WKWebsiteDataTypeCookies', 'WKWebsiteDataTypeCookies');
///HTML session storage.
static const WKWebsiteDataTypeSessionStorage = IOSWKWebsiteDataType._internal(
'WKWebsiteDataTypeSessionStorage', 'WKWebsiteDataTypeSessionStorage');
///HTML local storage.
static const WKWebsiteDataTypeLocalStorage = IOSWKWebsiteDataType._internal(
'WKWebsiteDataTypeLocalStorage', 'WKWebsiteDataTypeLocalStorage');
///WebSQL databases.
static const WKWebsiteDataTypeWebSQLDatabases =
IOSWKWebsiteDataType._internal('WKWebsiteDataTypeWebSQLDatabases',
'WKWebsiteDataTypeWebSQLDatabases');
///IndexedDB databases.
static const WKWebsiteDataTypeIndexedDBDatabases =
IOSWKWebsiteDataType._internal('WKWebsiteDataTypeIndexedDBDatabases',
'WKWebsiteDataTypeIndexedDBDatabases');
///Service worker registrations.
///
///**NOTE**: available on iOS 11.3+.
static const WKWebsiteDataTypeServiceWorkerRegistrations =
IOSWKWebsiteDataType._internal(
'WKWebsiteDataTypeServiceWorkerRegistrations',
'WKWebsiteDataTypeServiceWorkerRegistrations');
///Returns a set of all available website data types.
static final ALL = [
IOSWKWebsiteDataType.WKWebsiteDataTypeFetchCache,
IOSWKWebsiteDataType.WKWebsiteDataTypeDiskCache,
IOSWKWebsiteDataType.WKWebsiteDataTypeMemoryCache,
IOSWKWebsiteDataType.WKWebsiteDataTypeOfflineWebApplicationCache,
IOSWKWebsiteDataType.WKWebsiteDataTypeCookies,
IOSWKWebsiteDataType.WKWebsiteDataTypeSessionStorage,
IOSWKWebsiteDataType.WKWebsiteDataTypeLocalStorage,
IOSWKWebsiteDataType.WKWebsiteDataTypeWebSQLDatabases,
IOSWKWebsiteDataType.WKWebsiteDataTypeIndexedDBDatabases,
IOSWKWebsiteDataType.WKWebsiteDataTypeServiceWorkerRegistrations
].toSet();
///Set of all values of [IOSWKWebsiteDataType].
static final Set<IOSWKWebsiteDataType> values = [
IOSWKWebsiteDataType.WKWebsiteDataTypeFetchCache,
IOSWKWebsiteDataType.WKWebsiteDataTypeDiskCache,
IOSWKWebsiteDataType.WKWebsiteDataTypeMemoryCache,
IOSWKWebsiteDataType.WKWebsiteDataTypeOfflineWebApplicationCache,
IOSWKWebsiteDataType.WKWebsiteDataTypeCookies,
IOSWKWebsiteDataType.WKWebsiteDataTypeSessionStorage,
IOSWKWebsiteDataType.WKWebsiteDataTypeLocalStorage,
IOSWKWebsiteDataType.WKWebsiteDataTypeWebSQLDatabases,
IOSWKWebsiteDataType.WKWebsiteDataTypeIndexedDBDatabases,
IOSWKWebsiteDataType.WKWebsiteDataTypeServiceWorkerRegistrations,
].toSet();
///Gets a possible [IOSWKWebsiteDataType] instance from [String] value.
static IOSWKWebsiteDataType? fromValue(String? value) {
if (value != null) {
try {
return IOSWKWebsiteDataType.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets a possible [IOSWKWebsiteDataType] instance from a native value.
static IOSWKWebsiteDataType? fromNativeValue(String? value) {
if (value != null) {
try {
return IOSWKWebsiteDataType.values
.firstWhere((element) => element.toNativeValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [String] value.
String toValue() => _value;
///Gets [String] native value.
String toNativeValue() => _nativeValue;
@override
int get hashCode => _value.hashCode;
@override
bool operator ==(value) => value == _value;
@override
String toString() {
return _value;
}
}

View File

@ -1,45 +1,16 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../in_app_webview/webview.dart'; import '../in_app_webview/webview.dart';
part 'webview_implementation.g.dart';
///Class that represents the [WebView] native implementation to be used. ///Class that represents the [WebView] native implementation to be used.
class WebViewImplementation { @ExchangeableEnum()
class WebViewImplementation_ {
// ignore: unused_field
final int _value; final int _value;
const WebViewImplementation_._internal(this._value);
const WebViewImplementation._internal(this._value); ///Default native implementation, such as `WKWebView` for iOS and `android.webkit.WebView` for Android.
static const NATIVE = const WebViewImplementation_._internal(0);
///Set of all values of [WebViewImplementation].
static final Set<WebViewImplementation> values =
[WebViewImplementation.NATIVE].toSet();
///Gets a possible [WebViewImplementation] instance from an [int] value.
static WebViewImplementation? fromValue(int? value) {
if (value != null) {
try {
return WebViewImplementation.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [int] value.
int toValue() => _value;
@override
String toString() {
switch (_value) {
case 0:
default:
return "NATIVE";
}
}
///Default native implementation, such as `WKWebView` for iOS and `android.webkit.WebView` for Android.
static const NATIVE = const WebViewImplementation._internal(0);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }

View File

@ -0,0 +1,73 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'webview_implementation.dart';
// **************************************************************************
// ExchangeableEnumGenerator
// **************************************************************************
///Class that represents the [WebView] native implementation to be used.
class WebViewImplementation {
final int _value;
final int _nativeValue;
const WebViewImplementation._internal(this._value, this._nativeValue);
// ignore: unused_element
factory WebViewImplementation._internalMultiPlatform(
int value, Function nativeValue) =>
WebViewImplementation._internal(value, nativeValue());
///Default native implementation, such as `WKWebView` for iOS and `android.webkit.WebView` for Android.
static const NATIVE = WebViewImplementation._internal(0, 0);
///Set of all values of [WebViewImplementation].
static final Set<WebViewImplementation> values = [
WebViewImplementation.NATIVE,
].toSet();
///Gets a possible [WebViewImplementation] instance from [int] value.
static WebViewImplementation? fromValue(int? value) {
if (value != null) {
try {
return WebViewImplementation.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets a possible [WebViewImplementation] instance from a native value.
static WebViewImplementation? fromNativeValue(int? value) {
if (value != null) {
try {
return WebViewImplementation.values
.firstWhere((element) => element.toNativeValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [int] value.
int toValue() => _value;
///Gets [int] native value.
int toNativeValue() => _nativeValue;
@override
int get hashCode => _value.hashCode;
@override
bool operator ==(value) => value == _value;
@override
String toString() {
switch (_value) {
case 0:
return 'NATIVE';
}
return _value.toString();
}
}

View File

@ -1,71 +1,31 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../in_app_webview/webview.dart'; import '../in_app_webview/webview.dart';
part 'webview_package_info.g.dart';
///Class that represents a [WebView] package info. ///Class that represents a [WebView] package info.
class WebViewPackageInfo { @ExchangeableObject()
class WebViewPackageInfo_ {
///The version name of this WebView package. ///The version name of this WebView package.
String? versionName; String? versionName;
///The name of this WebView package. ///The name of this WebView package.
String? packageName; String? packageName;
WebViewPackageInfo({this.versionName, this.packageName}); WebViewPackageInfo_({this.versionName, this.packageName});
///Gets a possible [WebViewPackageInfo] instance from a [Map] value.
static WebViewPackageInfo? fromMap(Map<String, dynamic>? map) {
return map != null
? WebViewPackageInfo(
versionName: map["versionName"], packageName: map["packageName"])
: null;
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {"versionName": versionName, "packageName": packageName};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return this.toMap();
}
@override
String toString() {
return toMap().toString();
}
} }
///Class that represents an Android [WebView] package info. ///Class that represents an Android [WebView] package info.
///Use [WebViewPackageInfo] instead. ///Use [WebViewPackageInfo] instead.
@Deprecated("Use WebViewPackageInfo instead") @Deprecated("Use WebViewPackageInfo instead")
class AndroidWebViewPackageInfo { @ExchangeableObject()
class AndroidWebViewPackageInfo_ {
///The version name of this WebView package. ///The version name of this WebView package.
String? versionName; String? versionName;
///The name of this WebView package. ///The name of this WebView package.
String? packageName; String? packageName;
AndroidWebViewPackageInfo({this.versionName, this.packageName}); AndroidWebViewPackageInfo_({this.versionName, this.packageName});
///Gets a possible [AndroidWebViewPackageInfo] instance from a [Map] value.
static AndroidWebViewPackageInfo? fromMap(Map<String, dynamic>? map) {
return map != null
? AndroidWebViewPackageInfo(
versionName: map["versionName"], packageName: map["packageName"])
: null;
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {"versionName": versionName, "packageName": packageName};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return this.toMap();
}
@override
String toString() {
return toMap().toString();
}
} }

View File

@ -0,0 +1,89 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'webview_package_info.dart';
// **************************************************************************
// ExchangeableObjectGenerator
// **************************************************************************
///Class that represents a [WebView] package info.
class WebViewPackageInfo {
///The version name of this WebView package.
String? versionName;
///The name of this WebView package.
String? packageName;
WebViewPackageInfo({this.versionName, this.packageName});
///Gets a possible [WebViewPackageInfo] instance from a [Map] value.
static WebViewPackageInfo? fromMap(Map<String, dynamic>? map) {
if (map == null) {
return null;
}
final instance = WebViewPackageInfo(
versionName: map['versionName'],
packageName: map['packageName'],
);
return instance;
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {
"versionName": versionName,
"packageName": packageName,
};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return toMap();
}
@override
String toString() {
return 'WebViewPackageInfo{versionName: $versionName, packageName: $packageName}';
}
}
///Class that represents an Android [WebView] package info.
///Use [WebViewPackageInfo] instead.
@Deprecated('Use WebViewPackageInfo instead')
class AndroidWebViewPackageInfo {
///The version name of this WebView package.
String? versionName;
///The name of this WebView package.
String? packageName;
AndroidWebViewPackageInfo({this.versionName, this.packageName});
///Gets a possible [AndroidWebViewPackageInfo] instance from a [Map] value.
static AndroidWebViewPackageInfo? fromMap(Map<String, dynamic>? map) {
if (map == null) {
return null;
}
final instance = AndroidWebViewPackageInfo(
versionName: map['versionName'],
packageName: map['packageName'],
);
return instance;
}
///Converts instance to a map.
Map<String, dynamic> toMap() {
return {
"versionName": versionName,
"packageName": packageName,
};
}
///Converts instance to a map.
Map<String, dynamic> toJson() {
return toMap();
}
@override
String toString() {
return 'AndroidWebViewPackageInfo{versionName: $versionName, packageName: $packageName}';
}
}

View File

@ -1,24 +1,20 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../in_app_webview/webview.dart'; import '../in_app_webview/webview.dart';
part 'webview_render_process_action.g.dart';
///Class that represents the action to take used by the [WebView.onRenderProcessUnresponsive] and [WebView.onRenderProcessResponsive] event ///Class that represents the action to take used by the [WebView.onRenderProcessUnresponsive] and [WebView.onRenderProcessResponsive] event
///to terminate the Android [WebViewRenderProcess](https://developer.android.com/reference/android/webkit/WebViewRenderProcess). ///to terminate the Android [WebViewRenderProcess](https://developer.android.com/reference/android/webkit/WebViewRenderProcess).
class WebViewRenderProcessAction { @ExchangeableEnum()
class WebViewRenderProcessAction_ {
// ignore: unused_field
final int _value; final int _value;
const WebViewRenderProcessAction_._internal(this._value);
const WebViewRenderProcessAction._internal(this._value);
///Gets [int] value. ///Gets [int] value.
int toValue() => _value; int toValue() => _value;
///Cause this renderer to terminate. ///Cause this renderer to terminate.
static const TERMINATE = const WebViewRenderProcessAction._internal(0); static const TERMINATE = const WebViewRenderProcessAction_._internal(0);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
Map<String, dynamic> toMap() {
return {"action": _value};
}
} }

View File

@ -0,0 +1,74 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'webview_render_process_action.dart';
// **************************************************************************
// ExchangeableEnumGenerator
// **************************************************************************
///Class that represents the action to take used by the [WebView.onRenderProcessUnresponsive] and [WebView.onRenderProcessResponsive] event
///to terminate the Android [WebViewRenderProcess](https://developer.android.com/reference/android/webkit/WebViewRenderProcess).
class WebViewRenderProcessAction {
final int _value;
final int _nativeValue;
const WebViewRenderProcessAction._internal(this._value, this._nativeValue);
// ignore: unused_element
factory WebViewRenderProcessAction._internalMultiPlatform(
int value, Function nativeValue) =>
WebViewRenderProcessAction._internal(value, nativeValue());
///Cause this renderer to terminate.
static const TERMINATE = WebViewRenderProcessAction._internal(0, 0);
///Set of all values of [WebViewRenderProcessAction].
static final Set<WebViewRenderProcessAction> values = [
WebViewRenderProcessAction.TERMINATE,
].toSet();
///Gets a possible [WebViewRenderProcessAction] instance from [int] value.
static WebViewRenderProcessAction? fromValue(int? value) {
if (value != null) {
try {
return WebViewRenderProcessAction.values
.firstWhere((element) => element.toValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets a possible [WebViewRenderProcessAction] instance from a native value.
static WebViewRenderProcessAction? fromNativeValue(int? value) {
if (value != null) {
try {
return WebViewRenderProcessAction.values
.firstWhere((element) => element.toNativeValue() == value);
} catch (e) {
return null;
}
}
return null;
}
///Gets [int] value.
int toValue() => _value;
///Gets [int] native value.
int toNativeValue() => _nativeValue;
@override
int get hashCode => _value.hashCode;
@override
bool operator ==(value) => value == _value;
@override
String toString() {
switch (_value) {
case 0:
return 'TERMINATE';
}
return _value.toString();
}
}

View File

@ -23,7 +23,7 @@ class IOSWebStorageManager {
List<IOSWKWebsiteDataRecord> recordList = []; List<IOSWKWebsiteDataRecord> recordList = [];
List<String> dataTypesList = []; List<String> dataTypesList = [];
for (var dataType in dataTypes) { for (var dataType in dataTypes) {
dataTypesList.add(dataType.toValue()); dataTypesList.add(dataType.toNativeValue());
} }
Map<String, dynamic> args = <String, dynamic>{}; Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("dataTypes", () => dataTypesList); args.putIfAbsent("dataTypes", () => dataTypesList);
@ -55,7 +55,7 @@ class IOSWebStorageManager {
required List<IOSWKWebsiteDataRecord> dataRecords}) async { required List<IOSWKWebsiteDataRecord> dataRecords}) async {
List<String> dataTypesList = []; List<String> dataTypesList = [];
for (var dataType in dataTypes) { for (var dataType in dataTypes) {
dataTypesList.add(dataType.toValue()); dataTypesList.add(dataType.toNativeValue());
} }
List<Map<String, dynamic>> recordList = []; List<Map<String, dynamic>> recordList = [];
@ -79,7 +79,7 @@ class IOSWebStorageManager {
required DateTime date}) async { required DateTime date}) async {
List<String> dataTypesList = []; List<String> dataTypesList = [];
for (var dataType in dataTypes) { for (var dataType in dataTypes) {
dataTypesList.add(dataType.toValue()); dataTypesList.add(dataType.toNativeValue());
} }
var timestamp = date.millisecondsSinceEpoch; var timestamp = date.millisecondsSinceEpoch;

26
package.json Normal file
View File

@ -0,0 +1,26 @@
{
"name": "flutter_inappwebview",
"version": "1.0.0",
"directories": {
"example": "example",
"lib": "lib",
"test": "test"
},
"private": true,
"scripts": {
"build": "flutter pub run build_runner build --delete-conflicting-outputs",
"watch": "flutter pub run build_runner watch --delete-conflicting-outputs",
"publish:dry": "npm run build && flutter pub publish --dry-run",
"publish": "npm run build && flutter pub publish"
},
"repository": {
"type": "git",
"url": "git+https://github.com/pichillilorenzo/flutter_inappwebview.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/pichillilorenzo/flutter_inappwebview/issues"
},
"homepage": "https://github.com/pichillilorenzo/flutter_inappwebview#readme"
}

View File

@ -22,7 +22,7 @@ dev_dependencies:
flutter_driver: flutter_driver:
sdk: flutter sdk: flutter
lints: ^1.0.1 lints: ^1.0.1
build_runner: build_runner: ^2.2.1
generators: generators:
path: dev_packages/generators path: dev_packages/generators

View File

@ -1 +1 @@
B83E5BFA72399E6B B83E5BFA72399E73

Binary file not shown.

View File

@ -0,0 +1,20 @@
var fs = require('fs');
var https = require('https');
var options = {
hostname: 'localhost',
port: 4433,
path: '/',
method: 'GET',
key: fs.readFileSync('client1-key.pem'),
cert: fs.readFileSync('client1-crt.pem'),
// pfx: fs.readFileSync('certificate.pfx'),
ca: fs.readFileSync('ca-crt.pem') };
var req = https.request(options, function(res) {
res.on('data', function(data) {
process.stdout.write(data);
});
});
req.end();
req.on('error', function(e) {
console.error(e);
});

56
test_node_server/client1-crt.pem Executable file → Normal file
View File

@ -1,32 +1,32 @@
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIIFijCCA3KgAwIBAgIJALg+W/pyOZ5qMA0GCSqGSIb3DQEBBQUAMIGBMQswCQYD MIIFjDCCA3SgAwIBAgIJALg+W/pyOZ5yMA0GCSqGSIb3DQEBBQUAMIGBMQswCQYD
VQQGEwJVUzELMAkGA1UECAwCTUExDzANBgNVBAcMBkJvc3RvbjETMBEGA1UECgwK VQQGEwJVUzELMAkGA1UECAwCTUExDzANBgNVBAcMBkJvc3RvbjETMBEGA1UECgwK
RXhhbXBsZSBDbzEQMA4GA1UECwwHdGVjaG9wczELMAkGA1UEAwwCY2ExIDAeBgkq RXhhbXBsZSBDbzEQMA4GA1UECwwHdGVjaG9wczELMAkGA1UEAwwCY2ExIDAeBgkq
hkiG9w0BCQEWEWNlcnRzQGV4YW1wbGUuY29tMB4XDTE5MTAzMDIzMzcwOVoXDTIy hkiG9w0BCQEWEWNlcnRzQGV4YW1wbGUuY29tMCAXDTIyMTAwMzExNTAwMloYDzIw
MDcyNTIzMzcwOVowgYYxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJNQTEPMA0GA1UE NTAwMjE3MTE1MDAyWjCBhjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAk1BMQ8wDQYD
BwwGQm9zdG9uMRMwEQYDVQQKDApFeGFtcGxlIENvMRAwDgYDVQQLDAd0ZWNob3Bz VQQHDAZCb3N0b24xEzARBgNVBAoMCkV4YW1wbGUgQ28xEDAOBgNVBAsMB3RlY2hv
MRAwDgYDVQQDDAdjbGllbnQxMSAwHgYJKoZIhvcNAQkBFhFjZXJ0c0BleGFtcGxl cHMxEDAOBgNVBAMMB2NsaWVudDExIDAeBgkqhkiG9w0BCQEWEWNlcnRzQGV4YW1w
LmNvbTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAPWhU8of86y3Lols bGUuY29tMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA9aFTyh/zrLcu
0cU40+cbCcAhOEsdDiouVKX9cpnYoP5IIsTOiQHjAcMYekTMNXxLcGGa8FWO1bDW iWzRxTjT5xsJwCE4Sx0OKi5Upf1ymdig/kgixM6JAeMBwxh6RMw1fEtwYZrwVY7V
6WjvzNi0s2xqYMThP5h7m5XK4PR6NjLnE8I0kyfYjvx4vN/AXNWJXgNDJ+dkm3O0 sNbpaO/M2LSzbGpgxOE/mHublcrg9Ho2MucTwjSTJ9iO/Hi838Bc1YleA0Mn52Sb
ceXzMzswuLqrhEv7UpkJm37znimOBtP7JSFmoz5mT+/s3Aojzop1Le1VSPVANIbu c7Rx5fMzOzC4uquES/tSmQmbfvOeKY4G0/slIWajPmZP7+zcCiPOinUt7VVI9UA0
PgdsIdoNMR8oJrKai0PourJKuvOV5qiNm0123+lq9x4R+zoY2AIB34o9RJfcuUZs hu4+B2wh2g0xHygmspqLQ+i6skq685XmqI2bTXbf6Wr3HhH7OhjYAgHfij1El9y5
+IqDt+SyL3MHwuP8OMmYyU6yerfWLZ2Ywsg01uDGQMaHfPH1S8d8Hiq4Vwfi9RWE Rmz4ioO35LIvcwfC4/w4yZjJTrJ6t9YtnZjCyDTW4MZAxod88fVLx3weKrhXB+L1
kvifb4eQDBzVN3x1Hn/1cEghaLneDiRRwRiFZFs/WKvafxMOY4M30gpuSStHzIt/ FYSS+J9vh5AMHNU3fHUef/VwSCFoud4OJFHBGIVkWz9Yq9p/Ew5jgzfSCm5JK0fM
wE+N8vC8KNW2TyyPAkCq6L8BjOlJ7EX0eilbSroMz/SeTO8+t4+N9vJ5/4e4dSSQ i3/AT43y8Lwo1bZPLI8CQKrovwGM6UnsRfR6KVtKugzP9J5M7z63j4328nn/h7h1
zo3Sdw3K8sdK7zoBToWGW26yCSEvnSBjNyWvNKLWsHM1wKxbN85sDYdeyn7pvjHe JJDOjdJ3Dcryx0rvOgFOhYZbbrIJIS+dIGM3Ja80otawczXArFs3zmwNh17Kfum+
K1g0eQF/WGbEyHCTws3tDCo/wfpbZNtkW1w8zlBAmpbZdNZDs4769pZ/tb9wctUk Md4rWDR5AX9YZsTIcJPCze0MKj/B+ltk22RbXDzOUECaltl01kOzjvr2ln+1v3By
TasbXlXedMmmw2eOZ3d/hj0REFpbl/34ClQSTnlVQJKv/7CwqzJWDUd5uWzaHPtr 1SRNqxteVd50yabDZ45nd3+GPREQWluX/fgKVBJOeVVAkq//sLCrMlYNR3m5bNoc
hzUOJDKoDBEvfL+yAEJNMM8maGcpAgMBAAEwDQYJKoZIhvcNAQEFBQADggIBAGhm +2uHNQ4kMqgMES98v7IAQk0wzyZoZykCAwEAATANBgkqhkiG9w0BAQUFAAOCAgEA
496UQQKPqXUXl52lPUhchjCxecfukVrLf2GR3H8r9W6s46pu60MGZBip7TQowXGN maEJnJAPmFi3FBDQdhnbyaJ41RqNjZKAQCmszWzDruPbw9G3RTBB2ziKsCq4uZzd
v4uZKABxOkI7VoRUhndsO8KiR39DlmE/SocSrEyfe6cblMaMr7c6oTojcYiXHLbi +YTtB2Bw0/7BcsCvdCdHjAg3X2kCrCE87t/WZC9fmAGRIsP2rZlvpCOg1K1yDzEN
Wy52O5TX1iqMBNyrvPAfDjOubkaUF0iuyh1Vzn5OuHvWfmC5uOONHIUCukeyg+hg Fwn3/MO9VMA954sHli/t4x+X7m7nwpoOPOpcgxRZGUbqGFbSG7Aih/aWojHLrXdG
wxYH5vYduhYiqmdAPNHrqrGRqOfbwG6KTMaqH6xihupJsgcxwVpzbdWWxPU37tZE 0mDhy9JyTPcyRNMfFwVn/fpzw3M9bVrUxMKjWH9Yllse+UiCaTixmEyJcLdnssaO
sI1RVS26Z6XuA2j1uQ4BzRUbGlXqvESYV9jSkKYvNfMqVDL+g2h9xumlPtTIiP6b k1VvAPv+j1IXtpe+4QOXenYlPCf/usbxBCXe3d1i1yovtWlZJnRY8HfMAbDQYbr0
GZIN4zel7WhaOdftnz5w4AdaPt3sYXxTda95973TNe072tgR/lJsvobW1szSo0k8 ky04+9+kaqwZBcKYdCIpQ+Bim9/nb+NIvQXkknDQ7G6mf4cl8/wbvkGr52kEUktC
m2AbWeepzeKftYanCydRz5MnlOX8mf3HaL0QqreQwxaiF40mOUVcMPJfY2pK25qU uRXTrBwiLWAhI0CfbAOcOBgS+COtzeZGCN+QG0+dV+0tQzGEt3wDizvdmsZJb3xq
pVK9E3oA1ufc7+8Hnx4KsE9DO/1VyCrpBq0LwUKjmhYTLChsuH0Gpj+/pqioWNKB 8bFCHDYO2s4QiR2EmkPSvyHJ9D70hCYUYyZNJWeVx+zAQAs1Rr3NmeaLrw9ri9Cb
c6Mt+APzGG8jqWrwMlsixK2U6G22zASpFBWuFhQIShkL819zgpRB67XPQUgKkbQT O0l274CaBxF5omP/wivzmIqsLR7ZfpdHrNpu8D6qKdstYN26IsET7vzNpYEpdN0m
4wF9cR4xwHvz8NsFHyXGFkI3U9yGGOVXWMOQ+ZhLyWGkwg096mVro/AtGveAs0sr RSs3PoP2M0prXxjZrmZVRMWLn56e2Ipl5s2ERNmjkrdY2pbPHxEqejbIox5zspNF
QWfJbuZM/gWlaojLGqtatDEc+tfRZ7g+nxU+PhQq 62eVeGs/3N7YdviQeVGUsbnXAJC5XiLkBjwYKpEJydI=
-----END CERTIFICATE----- -----END CERTIFICATE-----

56
test_node_server/client2-crt.pem Executable file → Normal file
View File

@ -1,32 +1,32 @@
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIIFijCCA3KgAwIBAgIJALg+W/pyOZ5rMA0GCSqGSIb3DQEBBQUAMIGBMQswCQYD MIIFjDCCA3SgAwIBAgIJALg+W/pyOZ5zMA0GCSqGSIb3DQEBBQUAMIGBMQswCQYD
VQQGEwJVUzELMAkGA1UECAwCTUExDzANBgNVBAcMBkJvc3RvbjETMBEGA1UECgwK VQQGEwJVUzELMAkGA1UECAwCTUExDzANBgNVBAcMBkJvc3RvbjETMBEGA1UECgwK
RXhhbXBsZSBDbzEQMA4GA1UECwwHdGVjaG9wczELMAkGA1UEAwwCY2ExIDAeBgkq RXhhbXBsZSBDbzEQMA4GA1UECwwHdGVjaG9wczELMAkGA1UEAwwCY2ExIDAeBgkq
hkiG9w0BCQEWEWNlcnRzQGV4YW1wbGUuY29tMB4XDTE5MTAzMDIzMzcxNFoXDTIy hkiG9w0BCQEWEWNlcnRzQGV4YW1wbGUuY29tMCAXDTIyMTAwMzExNTAwNloYDzIw
MDcyNTIzMzcxNFowgYYxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJNQTEPMA0GA1UE NTAwMjE3MTE1MDA2WjCBhjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAk1BMQ8wDQYD
BwwGQm9zdG9uMRMwEQYDVQQKDApFeGFtcGxlIENvMRAwDgYDVQQLDAd0ZWNob3Bz VQQHDAZCb3N0b24xEzARBgNVBAoMCkV4YW1wbGUgQ28xEDAOBgNVBAsMB3RlY2hv
MRAwDgYDVQQDDAdjbGllbnQyMSAwHgYJKoZIhvcNAQkBFhFjZXJ0c0BleGFtcGxl cHMxEDAOBgNVBAMMB2NsaWVudDIxIDAeBgkqhkiG9w0BCQEWEWNlcnRzQGV4YW1w
LmNvbTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAO2ARFzN+hQgmnEj bGUuY29tMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA7YBEXM36FCCa
OXHcOVjCPH6g/UNXwUNjtEUBg+EDTGliOC8If6ObFjW4tfIjwgGdhKt++92LRxDe cSM5cdw5WMI8fqD9Q1fBQ2O0RQGD4QNMaWI4Lwh/o5sWNbi18iPCAZ2Eq3773YtH
BauM8al7QK8yZhw7I7waqm0C4tIw4MdAlcRxZ0gEG7l5i9jU55yPpUcxZ1VE0VuH EN4Fq4zxqXtArzJmHDsjvBqqbQLi0jDgx0CVxHFnSAQbuXmL2NTnnI+lRzFnVUTR
ADgAosZtjltsBv03tq2Cf11jTEcaly4ze/8vDaAyl+M4u9FrflPnYoPmCiMBTz1j W4cAOACixm2OW2wG/Te2rYJ/XWNMRxqXLjN7/y8NoDKX4zi70Wt+U+dig+YKIwFP
1mdVtGsg2nGk+MA5RX9bMwWZq5bT9j2RG7PDMoc139SieQx4/5aVqIH628K7X0xE PWPWZ1W0ayDacaT4wDlFf1szBZmrltP2PZEbs8MyhzXf1KJ5DHj/lpWogfrbwrtf
/YydLh7vARM15Fn8tJy4yj/fgkU+3AWN8nWoOwceLNEB/yorBs1tjjSWEt3NIP7d TET9jJ0uHu8BEzXkWfy0nLjKP9+CRT7cBY3ydag7Bx4s0QH/KisGzW2ONJYS3c0g
kcyHYmZ7XyUMSzlfdSVY+OoM1z63MoSCTwZJzZ5fI4ca+NtoxYny4unyM1q7QKwA /t2RzIdiZntfJQxLOV91JVj46gzXPrcyhIJPBknNnl8jhxr422jFifLi6fIzWrtA
CisynJvGD5aI5bRgpjujlpw5IEuGqBZRjkLB0heOrPUlGEKkvaH2r9w/rGo8w4Is rAAKKzKcm8YPlojltGCmO6OWnDkgS4aoFlGOQsHSF46s9SUYQqS9ofav3D+sajzD
ebz3OHBeVpB2AqbifMa+3cwZ9/IpRWUKUdnoqye5ySx1RHWmz3fjwerTDPzHWxJ8 gix5vPc4cF5WkHYCpuJ8xr7dzBn38ilFZQpR2eirJ7nJLHVEdabPd+PB6tMM/Mdb
YH8HORvuwUm+j/hXFvB3D8S754X+OEA8bgu/7dfIE1C330WDvVAP6EngCZKAI8W2 Enxgfwc5G+7BSb6P+FcW8HcPxLvnhf44QDxuC7/t18gTULffRYO9UA/oSeAJkoAj
6u2SYXKPviqXciap5B4K4QHyUsiVruBIvymwTnz1+sharbRBOll7ZZKbBK1UNaCn xbbq7ZJhco++KpdyJqnkHgrhAfJSyJWu4Ei/KbBOfPX6yFqttEE6WXtlkpsErVQ1
XO0Vt7NM5EbNEhjBlrArPGxIT0bFAgMBAAEwDQYJKoZIhvcNAQEFBQADggIBAD7W oKdc7RW3s0zkRs0SGMGWsCs8bEhPRsUCAwEAATANBgkqhkiG9w0BAQUFAAOCAgEA
3rD2n/PRT6U1TyInliTZ11+leG40+P+fhlXoajN8vwooCnoDZWQNXRYODekzC6t3 tW5aG5vAtjJyiof/eEQSTSDD9M2tp2+NPqXTNXvbE8MzqWd+6e6MQWV13eTnTYUo
9jJWvbQyZnSL/jE81ixjN/CrHnrv1AmH63B3wgAaSYFja7UdfBE3rpb+ZsEZyjdu qz66wlvCqlpedDu5eH2/BVewRFzk1wlPWFMZLFsPqWkoFNP4CfJjruQ+moyzO+Cy
54C1zsizwR85ZWUWoj22v3lzvmf0+FuqW9FxVREtZytePncfw40wFrQO9NX5QXo8 KhXDPzI1rLsBmNQhUrG0nI1nfhmzeh0Vspj1mmIDP/0OjrPG5qsVZfDgFk352hLs
6ljZ18T7tNoeCv+C188SSbGNUDbC7VwTRCGACErbjAwX3ooQ5I2p3U3ipvTrXsnT YdRK8Vbhggubj6N7uvRe2RdEtrYbboro6rtZV49b8EBtI2ILWsRR7G6KI/QOJBwf
IYGeXwFqx7UjMtCYVJj8el+HlU1PZeyKZH/6j4HdseEZOvz8M/PSN8XjpStnhKQt 9PsEQ3ZbmR9nWsVwR/snB+C3OQrHUVTGihcSiLikwomu4EbIYl2/oHcfJqr2b/Nb
+dFmclEo68wU1KRnzUu38VynnKjSjeAZpws4eRqBr8rUeT8e52KbN07MLZ9q6GV7 l1n+bht1xkwPY5bwW45FvdKK1iKCNkJ+BwB89g+aBQGjh+ZyCMicLUjPxIxA5WEj
V9MBERSIKNu7+PHIllvJCt3C3K0DGcq6ItNs5wOgtkXNI2RqovvtU2g6z1KdKthl ei6S7NKtoCXG1wCrd58L2+8IKCXutCrH6XI26Lg2uSwaOiOwV6SlQ4JA8gEaMDMy
bVap4eh8WdVfYgFjTdiMFbLkFgZubNucyNXkKMPo79cnT1Wp1I3ZjNHuv7vtpXQD zfBI4i1ddePpjqMt56sKWaibgEFHE4jtzAs+lxNLY1XowTnk9upW3x1TfIO6wGKO
WxfGZSsMM/ekgnR36wZFEqqt40bgie4RQJliIu1fWCVB6Y9kMb00dJ7otc8bIcVF g5hKS2mRX5XIFic8MyniV4L1IMpn89Qf4e7UlgUyZ3ehDwpzfiK96wk1qCtTbiSG
EZdTCbgdGvn91T9yN7yMXxoPmHq7WX6TG1hWVKLUAaiFAlJqFOg23fFj+6XlBD/G SNN8nE5lC70CaxLF1igd2KCHLkS/2TeM2UMe0wU0jzNAwvVnJQ3jBy13JYThINnd
/rGliGxn+1rvUywSv7oKVgTpbmwR65Fky2hDZWh5 CBE+ZCYnvUtlUne4LnWtLf0zW3xboUHFtjllhFgs2OU=
-----END CERTIFICATE----- -----END CERTIFICATE-----

View File

@ -1,13 +1,22 @@
// Example of the server https is taken from here: https://engineering.circle.com/https-authorized-certs-with-node-js-315e548354a2 // Example of the server https is taken from here: https://engineering.circle.com/https-authorized-certs-with-node-js-315e548354a2
// Renew certificates:
// - openssl x509 -req -extfile server.cnf -days 9999 -passin "pass:password" -in server-csr.pem -CA ca-crt.pem -CAkey ca-key.pem -CAcreateserial -out server-crt.pem
// - openssl x509 -req -extfile client1.cnf -days 9999 -passin "pass:password" -in client1-csr.pem -CA ca-crt.pem -CAkey ca-key.pem -CAcreateserial -out client1-crt.pem
// - openssl x509 -req -extfile client2.cnf -days 9999 -passin "pass:password" -in client2-csr.pem -CA ca-crt.pem -CAkey ca-key.pem -CAcreateserial -out client2-crt.pem
// Verify certificates:
// - openssl verify -CAfile ca-crt.pem server-crt.pem
// - openssl verify -CAfile ca-crt.pem client1-crt.pem
// - openssl verify -CAfile ca-crt.pem client2-crt.pem
// Conversion of client1-crt.pem to certificate.pfx: https://stackoverflow.com/a/38408666/4637638 // Conversion of client1-crt.pem to certificate.pfx: https://stackoverflow.com/a/38408666/4637638
const express = require('express'); // - openssl pkcs12 -export -out certificate.pfx -inkey client1-key.pem -in client1-crt.pem -certfile ca-crt.pem
const http = require('http'); // - Overwrite certificate.pfx to example/test_assets/certificate.pfx
const https = require('https'); const express = require('express')
const cors = require('cors'); const https = require('https')
const auth = require('basic-auth'); const cors = require('cors')
const app = express(); const auth = require('basic-auth')
const appHttps = express(); const app = express()
const appAuthBasic = express(); const appHttps = express()
const appAuthBasic = express()
const fs = require('fs') const fs = require('fs')
const path = require('path') const path = require('path')
const bodyParser = require('body-parser'); const bodyParser = require('body-parser');
@ -198,21 +207,3 @@ app.get("/test-download-file", (req, res) => {
}) })
app.listen(8082) app.listen(8082)
// Proxy server
http.createServer(function (req, res) {
res.setHeader('Content-type', 'text/html');
res.write(`
<html>
<head>
</head>
<body>
<h1>Proxy Works</h1>
<p id="url">${req.url}</p>
<p id="method">${req.method}</p>
<p id="headers">${JSON.stringify(req.headers)}</p>
</body>
</html>
`);
res.end();
}).listen(8083);

190
test_node_server/package-lock.json generated Normal file → Executable file
View File

@ -1,5 +1,5 @@
{ {
"name": "test_node_server", "name": "node_auth_basic",
"version": "1.0.0", "version": "1.0.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
@ -11,6 +11,21 @@
"requires": { "requires": {
"mime-types": "~2.1.34", "mime-types": "~2.1.34",
"negotiator": "0.6.3" "negotiator": "0.6.3"
},
"dependencies": {
"mime-db": {
"version": "1.52.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="
},
"mime-types": {
"version": "2.1.35",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
"requires": {
"mime-db": "1.52.0"
}
}
} }
}, },
"array-flatten": { "array-flatten": {
@ -174,10 +189,98 @@
"vary": "~1.1.2" "vary": "~1.1.2"
}, },
"dependencies": { "dependencies": {
"body-parser": {
"version": "1.20.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz",
"integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==",
"requires": {
"bytes": "3.1.2",
"content-type": "~1.0.4",
"debug": "2.6.9",
"depd": "2.0.0",
"destroy": "1.2.0",
"http-errors": "2.0.0",
"iconv-lite": "0.4.24",
"on-finished": "2.4.1",
"qs": "6.10.3",
"raw-body": "2.5.1",
"type-is": "~1.6.18",
"unpipe": "1.0.0"
}
},
"bytes": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
"integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg=="
},
"depd": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw=="
},
"http-errors": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
"integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
"requires": {
"depd": "2.0.0",
"inherits": "2.0.4",
"setprototypeof": "1.2.0",
"statuses": "2.0.1",
"toidentifier": "1.0.1"
}
},
"inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"on-finished": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
"integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
"requires": {
"ee-first": "1.1.1"
}
},
"qs": {
"version": "6.10.3",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz",
"integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==",
"requires": {
"side-channel": "^1.0.4"
}
},
"raw-body": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz",
"integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==",
"requires": {
"bytes": "3.1.2",
"http-errors": "2.0.0",
"iconv-lite": "0.4.24",
"unpipe": "1.0.0"
}
},
"safe-buffer": { "safe-buffer": {
"version": "5.2.1", "version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
},
"setprototypeof": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
"integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
},
"statuses": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
"integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ=="
},
"toidentifier": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="
} }
} }
}, },
@ -193,6 +296,21 @@
"parseurl": "~1.3.3", "parseurl": "~1.3.3",
"statuses": "2.0.1", "statuses": "2.0.1",
"unpipe": "~1.0.0" "unpipe": "~1.0.0"
},
"dependencies": {
"on-finished": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
"integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
"requires": {
"ee-first": "1.1.1"
}
},
"statuses": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
"integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ=="
}
} }
}, },
"forwarded": { "forwarded": {
@ -245,6 +363,11 @@
"toidentifier": "1.0.1" "toidentifier": "1.0.1"
} }
}, },
"https": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/https/-/https-1.0.0.tgz",
"integrity": "sha1-PDfHrhqO65ZpBKKtHpdaGUt+06Q="
},
"iconv-lite": { "iconv-lite": {
"version": "0.4.24", "version": "0.4.24",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
@ -284,16 +407,16 @@
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="
}, },
"mime-db": { "mime-db": {
"version": "1.52.0", "version": "1.44.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg=="
}, },
"mime-types": { "mime-types": {
"version": "2.1.35", "version": "2.1.27",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
"requires": { "requires": {
"mime-db": "1.52.0" "mime-db": "1.44.0"
} }
}, },
"ms": { "ms": {
@ -314,7 +437,7 @@
"depd": { "depd": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ=="
}, },
"http-errors": { "http-errors": {
"version": "1.8.1", "version": "1.8.1",
@ -336,7 +459,7 @@
"statuses": { "statuses": {
"version": "1.5.0", "version": "1.5.0",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
"integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA=="
} }
} }
}, },
@ -393,7 +516,7 @@
"random-bytes": { "random-bytes": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz",
"integrity": "sha1-T2ih3Arli9P7lYSMMDJNt11kNgs=" "integrity": "sha512-iv7LhNVO047HzYR3InF6pUcUsPQiHTM1Qal51DcGSuZFBil1aBBWG5eHPNek7bvILMaYJ/8RU1e8w1AMdHmLQQ=="
}, },
"range-parser": { "range-parser": {
"version": "1.2.1", "version": "1.2.1",
@ -441,10 +564,55 @@
"statuses": "2.0.1" "statuses": "2.0.1"
}, },
"dependencies": { "dependencies": {
"depd": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw=="
},
"http-errors": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
"integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
"requires": {
"depd": "2.0.0",
"inherits": "2.0.4",
"setprototypeof": "1.2.0",
"statuses": "2.0.1",
"toidentifier": "1.0.1"
}
},
"inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"ms": { "ms": {
"version": "2.1.3", "version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
},
"on-finished": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
"integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
"requires": {
"ee-first": "1.1.1"
}
},
"setprototypeof": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
"integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
},
"statuses": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
"integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ=="
},
"toidentifier": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="
} }
} }
}, },

View File

@ -1,19 +1,19 @@
{ {
"name": "test_node_server", "name": "node_auth_basic",
"version": "1.0.0", "version": "1.0.0",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"private": true,
"author": "", "author": "",
"license": "MIT", "license": "ISC",
"dependencies": { "dependencies": {
"basic-auth": "^2.0.1", "basic-auth": "latest",
"body-parser": "^1.19.0", "body-parser": "^1.20.0",
"cors": "^2.8.5", "cors": "^2.8.5",
"express": "^4.18.1", "express": "latest",
"multiparty": "^4.2.2" "https": "latest",
"multiparty": "^4.2.3"
} }
} }

View File

@ -1,32 +1,32 @@
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIIFjDCCA3SgAwIBAgIJALg+W/pyOZ5pMA0GCSqGSIb3DQEBBQUAMIGBMQswCQYD MIIFjjCCA3agAwIBAgIJALg+W/pyOZ5xMA0GCSqGSIb3DQEBBQUAMIGBMQswCQYD
VQQGEwJVUzELMAkGA1UECAwCTUExDzANBgNVBAcMBkJvc3RvbjETMBEGA1UECgwK VQQGEwJVUzELMAkGA1UECAwCTUExDzANBgNVBAcMBkJvc3RvbjETMBEGA1UECgwK
RXhhbXBsZSBDbzEQMA4GA1UECwwHdGVjaG9wczELMAkGA1UEAwwCY2ExIDAeBgkq RXhhbXBsZSBDbzEQMA4GA1UECwwHdGVjaG9wczELMAkGA1UEAwwCY2ExIDAeBgkq
hkiG9w0BCQEWEWNlcnRzQGV4YW1wbGUuY29tMB4XDTE5MTAzMDIzMzQxOVoXDTIy hkiG9w0BCQEWEWNlcnRzQGV4YW1wbGUuY29tMCAXDTIyMTAwMzExNDk1OVoYDzIw
MDcyNTIzMzQxOVowgYgxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJNQTEPMA0GA1UE NTAwMjE3MTE0OTU5WjCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAk1BMQ8wDQYD
BwwGQm9zdG9uMRMwEQYDVQQKDApFeGFtcGxlIENvMRAwDgYDVQQLDAd0ZWNob3Bz VQQHDAZCb3N0b24xEzARBgNVBAoMCkV4YW1wbGUgQ28xEDAOBgNVBAsMB3RlY2hv
MRIwEAYDVQQDDAlsb2NhbGhvc3QxIDAeBgkqhkiG9w0BCQEWEWNlcnRzQGV4YW1w cHMxEjAQBgNVBAMMCWxvY2FsaG9zdDEgMB4GCSqGSIb3DQEJARYRY2VydHNAZXhh
bGUuY29tMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA6+4m+blS6NcS bXBsZS5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDr7ib5uVLo
ZcftDArQhd7ekeeZzfiedonAXybjJ+GkqtigKW2hUtHldWRswx56braUAJYUsj2I 1xJlx+0MCtCF3t6R55nN+J52icBfJuMn4aSq2KApbaFS0eV1ZGzDHnputpQAlhSy
Xh9y9/vWCGUGF9ZsiPTI28bZgbfwvyGaO0K4mLPGdvOvtXgbbw3uC6hU+sbiFF88 PYheH3L3+9YIZQYX1myI9MjbxtmBt/C/IZo7QriYs8Z286+1eBtvDe4LqFT6xuIU
BgZdwnsjoP7wPHqyzJ8PQ7BM7jdflLFn1uULS+9fe/7gPRSXxvS26WC1IYK8gVqQ XzwGBl3CeyOg/vA8erLMnw9DsEzuN1+UsWfW5QtL7197/uA9FJfG9LbpYLUhgryB
JBXH2tO3ZSh8LygePjKUWQF4xsN8mttRYlahdhNIMb1ZgBnG4rFq8JOc5fUbrYIz WpAkFcfa07dlKHwvKB4+MpRZAXjGw3ya21FiVqF2E0gxvVmAGcbisWrwk5zl9Rut
s+LLMRm8zn3GIZgp4BiK900RJGxDXtVnx6ce4fdj+4OsL8NW3JzBNB66unsQ1gkz gjOz4ssxGbzOfcYhmCngGIr3TREkbENe1WfHpx7h92P7g6wvw1bcnME0Hrq6exDW
WZbAbaXN7HeUpnktuGfA+TdWrzMd8XXaMDHXj9Uh8NtjToBJ5hHkStSkHRxBnlyo CTNZlsBtpc3sd5SmeS24Z8D5N1avMx3xddowMdeP1SHw22NOgEnmEeRK1KQdHEGe
MvWXGubn+EfUC5nVBGnG/Yfb9caKlpgIHh164ScGKlFlV4W8VpoA1W0BwE/R/E/I XKgy9Zca5uf4R9QLmdUEacb9h9v1xoqWmAgeHXrhJwYqUWVXhbxWmgDVbQHAT9H8
lo5wiX5DP2uxh8bC7J1UK7guDnGDZASWsqNxtCBuCmEx9L6ePlnQbuc/AA+QLdyS T8iWjnCJfkM/a7GHxsLsnVQruC4OcYNkBJayo3G0IG4KYTH0vp4+WdBu5z8AD5At
z4wb0IGefS+et0BOJFj2/u28/A5N21swarTCxPm0rczXZfRhooM8/X6Z3Pw6E5ze 3JLPjBvQgZ59L563QE4kWPb+7bz8Dk3bWzBqtMLE+bStzNdl9GGigzz9fpnc/DoT
D1S/49V8qLwqwcwkJhnIJoqSj/cWNGVXRY2Tqu5536NvK3e5BvOPeULf0IKYDhUs nN4PVL/j1XyovCrBzCQmGcgmipKP9xY0ZVdFjZOq7nnfo28rd7kG8495Qt/QgpgO
LxwgpQ07gntS7UHBSejmmmjs92IiQiECAwEAATANBgkqhkiG9w0BAQUFAAOCAgEA FSwvHCClDTuCe1LtQcFJ6OaaaOz3YiJCIQIDAQABMA0GCSqGSIb3DQEBBQUAA4IC
JxbqWQynzigBoaR7DP6AtXzYC2RcVBQuwyBSy348ruiIeQy3Niwt5cuhFA/LVyZP AQCGAFB075uCWhHnE8h7JF/fu9siRwpuUmLCDkIT5U8ToRwRAv+uqMhosCbaScKk
QI6KQTj2Qd0elAkeSp55nG/ZWmcszAF8aWrFRNUc0U85eUcZSyKP1eRblFgf2sMg +Xq+1VhdLbt7b5NuEmlwOHv4GA7ru2pwJylLoxnmWh7i/DbTERIF8dal+TYV+VPD
HrJY0w0Ust43jk+tWNCftSHL6+uxaKc0z18vFmpHIBtpecCHYaA2mEUTTS19mzSu 3+M0KEQAlUIrza2u4iX7vZxkuHgN4/cCESFolsY6YYAhHZ2cR5Xeso/AKo1mVlvk
K816jEqDvwxUWRbC8aTLOKDS3w1OLBtwVQ8bBvKCbJv7I3AmWtGkmDdetBwEe9u4 1agUMvdRCoqvF+IRN/mvCILyE8Pueq41YN3gPC6qFLh2Mnjs6vhx03Fb4CRYWqIM
lpC/7Rmm57/UG5P8Vy7lVGyOnxQaTE1FxxNWwq02Iy4gc1UAovYYBtgsg+XfnpL6 /jRRRDMMb48j5t8EwCmu3j8tiCrfEC1XcaP8o720r7CJ5nw/O8lsQEfRDtcebSuq
TUo/9gtjl5K6OMxS/8JJjCi7U8RqiZICGTvjUvl0ahUtjs9CHtruWPbQ7tpA+IWQ +iHko9NTIztRW2U2EqDYKyxr+cojAD2xhVwQDpnXPzj1XGfKx4AoE/69tDFLng8i
k9U708R3TAILHtq1Po1cWTtezYqUokLVwQlvwWJOezuPWnz0v5VKuLX64Ot0HAjI PUWxo8Aa1TtZtcEmBzv2BCFBuqVkBPE/ZayeL5teDvyjUXVokNI3rXYeYLYqPly0
rB/VggCRRFbxseM22q3xYKGpERhvAnSjD6bAYP11MlCj/4FBflHDWgDjTvmwRW05 Qamm/fqnsd//tRgikeI+vHEUtcTCOqxmj3ELEf5PuITmtXGMUfAZZKAFU04h1Oxz
GW7rsTT+4omu/yQGRXSqFpaD1pYuoi1j0Lhtk/LCwQLE9bxPBUf0t8Ut+q5s0s0X GQzOAuz+hnXA5RzlZA6y+r9HaL9bfu3CO59ITbZ/NVOW0toYCmuXR7oHLrF42JlH
yXB1git1Aq09HZ1yJRfL//g/PWOu5lFhc8Xe4grrB3peRl2yHNiBNXQ1m1DmxCpL MxdIatr942w/9yiJKCSZFnujwrerwOFn+7Utei/XASNXjUNc2HuMd+TfPSiM/YmM
oeM+rfdX4oDVWH5oFmyFGAUOdsZ1JgvaasFq2JRKryA= pqiXXAYVskPHK9xG6w+YFhiLQ9KLOLSe7UXQZbs/NAxjXQ==
-----END CERTIFICATE----- -----END CERTIFICATE-----