From cd523c9d5361d9d003a7534e5e6587e6f9408719 Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Wed, 5 Oct 2022 13:13:20 +0200 Subject: [PATCH] complete applying internal annotations to types folder --- CHANGELOG.md | 14 +- .../webview/WebViewChannelDelegate.java | 4 +- ...ter_inappwebview_internal_annotations.dart | 2 + .../src/exchangeable_enum_custom_value.dart | 3 + .../lib/src/exchangeable_object_method.dart | 9 + .../pubspec.lock | 195 +-- .../pubspec.yaml | 2 +- .../lib/src/exchangeable_enum_generator.dart | 73 +- .../src/exchangeable_object_generator.dart | 85 +- dev_packages/generators/lib/src/util.dart | 14 +- dev_packages/generators/pubspec.lock | 95 +- dev_packages/generators/pubspec.yaml | 8 +- dev_packages/test_gen/pubspec.lock | 77 +- dev_packages/test_gen/pubspec.yaml | 2 +- example/test_assets/certificate.pfx | Bin 5629 -> 5637 bytes .../InAppWebView/WebViewChannelDelegate.swift | 2 +- lib/src/android/main.dart | 2 +- lib/src/android/webview_feature.dart | 315 ++--- lib/src/android/webview_feature.g.dart | 580 +++++++++ .../apple/in_app_webview_options.dart | 6 +- .../in_app_webview_controller.dart | 30 +- .../in_app_webview_settings.dart | 8 +- lib/src/print_job/print_job_settings.dart | 2 +- lib/src/types/content_world.dart | 2 +- .../types/layout_in_display_cutout_mode.dart | 6 + lib/src/types/meta_tag.g.dart | 4 +- lib/src/types/permission_request.g.dart | 4 +- lib/src/types/permission_response.g.dart | 4 +- .../should_allow_deprecated_tls_action.dart | 54 +- .../should_allow_deprecated_tls_action.g.dart | 157 +++ lib/src/types/ssl_error.dart | 60 +- lib/src/types/ssl_error.g.dart | 65 + lib/src/types/ssl_error_type.dart | 381 ++---- lib/src/types/ssl_error_type.g.dart | 466 +++++++ ...ted_web_activity_default_display_mode.dart | 26 +- ...d_web_activity_default_display_mode.g.dart | 36 + .../trusted_web_activity_display_mode.dart | 20 +- .../trusted_web_activity_display_mode.g.dart | 27 + ...d_web_activity_immersive_display_mode.dart | 65 +- ...web_activity_immersive_display_mode.g.dart | 73 ++ ...usted_web_activity_screen_orientation.dart | 88 +- ...ted_web_activity_screen_orientation.g.dart | 143 +++ lib/src/types/url_protection_space.g.dart | 21 +- ...rotection_space_http_auth_credentials.dart | 62 +- ...tection_space_http_auth_credentials.g.dart | 52 + .../url_protection_space_proxy_type.dart | 106 +- .../url_protection_space_proxy_type.g.dart | 174 +++ lib/src/types/url_request.dart | 2 +- lib/src/types/url_request.g.dart | 2 +- .../types/user_preferred_content_mode.dart | 58 +- .../types/user_preferred_content_mode.g.dart | 85 ++ lib/src/types/user_script.dart | 34 +- lib/src/types/user_script.g.dart | 84 ++ lib/src/types/user_script_injection_time.dart | 53 +- .../types/user_script_injection_time.g.dart | 83 ++ .../types/vertical_scrollbar_position.dart | 112 +- .../types/vertical_scrollbar_position.g.dart | 172 +++ lib/src/types/web_archive_format.dart | 43 +- lib/src/types/web_archive_format.g.dart | 74 ++ .../web_authentication_session_error.dart | 59 +- .../web_authentication_session_error.g.dart | 87 ++ lib/src/types/web_history.dart | 56 +- lib/src/types/web_history.g.dart | 48 + lib/src/types/web_history_item.dart | 30 +- lib/src/types/web_history_item.g.dart | 65 + lib/src/types/web_resource_error.dart | 41 +- lib/src/types/web_resource_error.g.dart | 47 + lib/src/types/web_resource_error_type.dart | 1089 ++++++++--------- lib/src/types/web_resource_error_type.g.dart | 1021 ++++++++++++++++ lib/src/types/web_resource_request.dart | 54 +- lib/src/types/web_resource_request.g.dart | 86 ++ lib/src/types/web_resource_response.dart | 46 +- lib/src/types/web_resource_response.g.dart | 81 ++ lib/src/types/web_storage_origin.dart | 44 +- lib/src/types/web_storage_origin.g.dart | 101 ++ lib/src/types/web_storage_type.dart | 45 +- lib/src/types/web_storage_type.g.dart | 77 ++ lib/src/types/website_data_record.dart | 62 +- lib/src/types/website_data_record.g.dart | 96 ++ lib/src/types/website_data_type.dart | 180 +-- lib/src/types/website_data_type.g.dart | 273 +++++ lib/src/types/webview_implementation.dart | 49 +- lib/src/types/webview_implementation.g.dart | 73 ++ lib/src/types/webview_package_info.dart | 60 +- lib/src/types/webview_package_info.g.dart | 89 ++ .../types/webview_render_process_action.dart | 22 +- .../webview_render_process_action.g.dart | 74 ++ .../web_storage/ios/web_storage_manager.dart | 6 +- package.json | 26 + pubspec.yaml | 2 +- test_node_server/ca-crt.srl | 2 +- test_node_server/certificate.pfx | Bin 5629 -> 5637 bytes test_node_server/client.js | 20 + test_node_server/client1-crt.pem | 56 +- test_node_server/client2-crt.pem | 56 +- test_node_server/index.js | 43 +- test_node_server/package-lock.json | 190 ++- test_node_server/package.json | 14 +- test_node_server/server-crt.pem | 56 +- 99 files changed, 6248 insertions(+), 2704 deletions(-) create mode 100644 dev_packages/flutter_inappwebview_internal_annotations/lib/src/exchangeable_enum_custom_value.dart create mode 100644 dev_packages/flutter_inappwebview_internal_annotations/lib/src/exchangeable_object_method.dart create mode 100644 lib/src/android/webview_feature.g.dart create mode 100644 lib/src/types/should_allow_deprecated_tls_action.g.dart create mode 100644 lib/src/types/ssl_error.g.dart create mode 100644 lib/src/types/ssl_error_type.g.dart create mode 100644 lib/src/types/trusted_web_activity_default_display_mode.g.dart create mode 100644 lib/src/types/trusted_web_activity_display_mode.g.dart create mode 100644 lib/src/types/trusted_web_activity_immersive_display_mode.g.dart create mode 100644 lib/src/types/trusted_web_activity_screen_orientation.g.dart create mode 100644 lib/src/types/url_protection_space_http_auth_credentials.g.dart create mode 100644 lib/src/types/url_protection_space_proxy_type.g.dart create mode 100644 lib/src/types/user_preferred_content_mode.g.dart create mode 100644 lib/src/types/user_script.g.dart create mode 100644 lib/src/types/user_script_injection_time.g.dart create mode 100644 lib/src/types/vertical_scrollbar_position.g.dart create mode 100644 lib/src/types/web_archive_format.g.dart create mode 100644 lib/src/types/web_authentication_session_error.g.dart create mode 100644 lib/src/types/web_history.g.dart create mode 100644 lib/src/types/web_history_item.g.dart create mode 100644 lib/src/types/web_resource_error.g.dart create mode 100644 lib/src/types/web_resource_error_type.g.dart create mode 100644 lib/src/types/web_resource_request.g.dart create mode 100644 lib/src/types/web_resource_response.g.dart create mode 100644 lib/src/types/web_storage_origin.g.dart create mode 100644 lib/src/types/web_storage_type.g.dart create mode 100644 lib/src/types/website_data_record.g.dart create mode 100644 lib/src/types/website_data_type.g.dart create mode 100644 lib/src/types/webview_implementation.g.dart create mode 100644 lib/src/types/webview_package_info.g.dart create mode 100644 lib/src/types/webview_render_process_action.g.dart create mode 100644 package.json create mode 100644 test_node_server/client.js mode change 100755 => 100644 test_node_server/client1-crt.pem mode change 100755 => 100644 test_node_server/client2-crt.pem mode change 100644 => 100755 test_node_server/package-lock.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 470a93c5..8e8da200 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,10 +16,10 @@ ### 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` - Removed `URLProtectionSpace.iosIsProxy` property -- `historyUrl` and `baseUrl` of `InAppWebViewInitialData` can be `null` +- `historyUrl` and `baseUrl` of `InAppWebViewInitialData` can be `null` ## 5.4.4+2 @@ -90,7 +90,7 @@ ## 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 ## 5.4.0+3 @@ -345,7 +345,7 @@ - Renamed `toolbarTop` InAppBrowser cross-platform option to `hideToolbarTop` - 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 `androidOnRequestFocus` event because it is never called +- Removed `androidOnRequestFocus` event because it is never called - Removed `initialHeaders` WebView attribute. Use `URLRequest.headers` attribute - Removed `headers` argument from `loadFile` WebView 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 `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 `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 type of `url` argument of `openWithSystemBrowser` InAppBrowser method to `Uri` -- Changed all InAppBrowser color options type from `String` to `Color` -- Changed all ChromeSafariBrowser 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` - Updated attributes of `ShouldOverrideUrlLoadingRequest`, `ServerTrustChallenge` and `ClientCertChallenge` classes - Changed type of `url` attribute to `Uri` for `JsAlertRequest`, `JsAlertConfirm`, `JsPromptRequest` classes diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/WebViewChannelDelegate.java b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/WebViewChannelDelegate.java index 66687315..3667b54c 100644 --- a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/WebViewChannelDelegate.java +++ b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/WebViewChannelDelegate.java @@ -1182,7 +1182,7 @@ public class WebViewChannelDelegate extends ChannelDelegateImpl { @Nullable @Override public Integer decodeResult(@Nullable Object obj) { - return obj != null ? (Integer) ((Map) obj).get("action") : null; + return obj instanceof Integer ? (Integer) obj : null; } } @@ -1201,7 +1201,7 @@ public class WebViewChannelDelegate extends ChannelDelegateImpl { @Nullable @Override public Integer decodeResult(@Nullable Object obj) { - return obj != null ? (Integer) ((Map) obj).get("action") : null; + return obj instanceof Integer ? (Integer) obj : null; } } diff --git a/dev_packages/flutter_inappwebview_internal_annotations/lib/flutter_inappwebview_internal_annotations.dart b/dev_packages/flutter_inappwebview_internal_annotations/lib/flutter_inappwebview_internal_annotations.dart index a605dda0..841cf81c 100644 --- a/dev_packages/flutter_inappwebview_internal_annotations/lib/flutter_inappwebview_internal_annotations.dart +++ b/dev_packages/flutter_inappwebview_internal_annotations/lib/flutter_inappwebview_internal_annotations.dart @@ -3,6 +3,8 @@ library flutter_inappwebview_internal_annotations; export 'src/exchangeable_object.dart'; export 'src/exchangeable_object_constructor.dart'; export 'src/exchangeable_object_property.dart'; +export 'src/exchangeable_object_method.dart'; export 'src/exchangeable_enum.dart'; +export 'src/exchangeable_enum_custom_value.dart'; export 'src/supported_platforms.dart'; export 'src/enum_supported_platforms.dart'; \ No newline at end of file diff --git a/dev_packages/flutter_inappwebview_internal_annotations/lib/src/exchangeable_enum_custom_value.dart b/dev_packages/flutter_inappwebview_internal_annotations/lib/src/exchangeable_enum_custom_value.dart new file mode 100644 index 00000000..309efa39 --- /dev/null +++ b/dev_packages/flutter_inappwebview_internal_annotations/lib/src/exchangeable_enum_custom_value.dart @@ -0,0 +1,3 @@ +class ExchangeableEnumCustomValue { + const ExchangeableEnumCustomValue(); +} diff --git a/dev_packages/flutter_inappwebview_internal_annotations/lib/src/exchangeable_object_method.dart b/dev_packages/flutter_inappwebview_internal_annotations/lib/src/exchangeable_object_method.dart new file mode 100644 index 00000000..d922ca6b --- /dev/null +++ b/dev_packages/flutter_inappwebview_internal_annotations/lib/src/exchangeable_object_method.dart @@ -0,0 +1,9 @@ +class ExchangeableObjectMethod { + final bool ignore; + final bool toMapMergeWith; + + const ExchangeableObjectMethod({ + this.ignore = false, + this.toMapMergeWith = false + }); +} diff --git a/dev_packages/flutter_inappwebview_internal_annotations/pubspec.lock b/dev_packages/flutter_inappwebview_internal_annotations/pubspec.lock index d1a8e316..6f6fc33f 100644 --- a/dev_packages/flutter_inappwebview_internal_annotations/pubspec.lock +++ b/dev_packages/flutter_inappwebview_internal_annotations/pubspec.lock @@ -1,20 +1,27 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + url: "https://pub.dartlang.org" + source: hosted + version: "49.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "0.33.6+1" + version: "5.1.0" args: dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "1.6.0" + version: "2.3.1" async: dependency: transitive description: @@ -28,21 +35,7 @@ packages: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" - 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" + version: "2.1.0" collection: dependency: transitive description: @@ -56,84 +49,63 @@ packages: name: convert url: "https://pub.dartlang.org" 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: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" - csslib: - dependency: transitive - description: - name: csslib - url: "https://pub.dartlang.org" - source: hosted - version: "0.17.1" + version: "3.0.2" file: dependency: transitive description: name: file url: "https://pub.dartlang.org" source: hosted - version: "5.2.1" - front_end: + version: "6.1.4" + frontend_server_client: dependency: transitive description: - name: front_end + name: frontend_server_client url: "https://pub.dartlang.org" source: hosted - version: "0.1.6+9" + version: "3.0.0" glob: dependency: transitive description: name: glob url: "https://pub.dartlang.org" source: hosted - version: "1.2.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" + version: "2.1.0" http_multi_server: dependency: transitive description: name: http_multi_server url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "3.2.1" http_parser: dependency: transitive description: name: http_parser url: "https://pub.dartlang.org" source: hosted - version: "3.1.4" - intl: - dependency: transitive - description: - name: intl - url: "https://pub.dartlang.org" - source: hosted - version: "0.17.0" + version: "4.0.1" io: dependency: transitive description: name: io url: "https://pub.dartlang.org" source: hosted - version: "0.3.5" + version: "1.0.3" js: dependency: transitive description: @@ -141,34 +113,20 @@ packages: url: "https://pub.dartlang.org" source: hosted 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: dependency: transitive description: name: logging url: "https://pub.dartlang.org" source: hosted - version: "0.11.4" + version: "1.0.2" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.3+1" + version: "0.12.12" meta: dependency: transitive description: @@ -183,48 +141,20 @@ packages: url: "https://pub.dartlang.org" source: hosted 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: dependency: transitive description: name: node_preamble url: "https://pub.dartlang.org" source: hosted - version: "1.4.13" + version: "2.0.1" package_config: dependency: transitive description: name: package_config url: "https://pub.dartlang.org" source: hosted - version: "1.9.3" - package_resolver: - dependency: transitive - description: - name: package_resolver - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.10" + version: "2.1.0" path: dependency: transitive description: @@ -232,20 +162,6 @@ packages: url: "https://pub.dartlang.org" source: hosted 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: dependency: transitive description: @@ -259,42 +175,42 @@ packages: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "1.4.4" + version: "2.1.1" shelf: dependency: transitive description: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "0.7.9" + version: "1.4.0" shelf_packages_handler: dependency: transitive description: name: shelf_packages_handler url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "3.0.1" shelf_static: dependency: transitive description: name: shelf_static url: "https://pub.dartlang.org" source: hosted - version: "0.2.9+2" + version: "1.1.1" shelf_web_socket: dependency: transitive description: name: shelf_web_socket url: "https://pub.dartlang.org" source: hosted - version: "0.2.4+1" + version: "1.0.2" source_map_stack_trace: dependency: transitive description: name: source_map_stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.1.5" + version: "2.1.0" source_maps: dependency: transitive description: @@ -322,7 +238,7 @@ packages: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "2.1.1" string_scanner: dependency: transitive description: @@ -343,7 +259,21 @@ packages: name: test url: "https://pub.dartlang.org" 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: dependency: transitive description: @@ -351,26 +281,33 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.0" - vm_service_client: + vm_service: dependency: transitive description: - name: vm_service_client + name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "0.2.6+3" + version: "9.4.0" watcher: dependency: transitive description: name: watcher url: "https://pub.dartlang.org" source: hosted - version: "0.9.7+15" + version: "1.0.1" web_socket_channel: dependency: transitive description: name: web_socket_channel url: "https://pub.dartlang.org" 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" yaml: dependency: transitive @@ -378,6 +315,6 @@ packages: name: yaml url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "3.1.1" sdks: - dart: ">=2.16.0-100.0.dev <3.0.0" + dart: ">=2.18.0 <3.0.0" diff --git a/dev_packages/flutter_inappwebview_internal_annotations/pubspec.yaml b/dev_packages/flutter_inappwebview_internal_annotations/pubspec.yaml index 8ddd6cfc..1da06c6d 100755 --- a/dev_packages/flutter_inappwebview_internal_annotations/pubspec.yaml +++ b/dev_packages/flutter_inappwebview_internal_annotations/pubspec.yaml @@ -7,4 +7,4 @@ environment: sdk: ">=2.14.0 <3.0.0" dev_dependencies: - test: 1.3.4 \ No newline at end of file + test: ^1.21.6 \ No newline at end of file diff --git a/dev_packages/generators/lib/src/exchangeable_enum_generator.dart b/dev_packages/generators/lib/src/exchangeable_enum_generator.dart index 5fdc5af3..70724983 100644 --- a/dev_packages/generators/lib/src/exchangeable_enum_generator.dart +++ b/dev_packages/generators/lib/src/exchangeable_enum_generator.dart @@ -11,6 +11,8 @@ import 'util.dart'; final _coreCheckerEnumSupportedPlatforms = const TypeChecker.fromRuntime(EnumSupportedPlatforms); final _coreCheckerDeprecated = const TypeChecker.fromRuntime(Deprecated); +final _coreCheckerEnumCustomValue = + const TypeChecker.fromRuntime(ExchangeableEnumCustomValue); class ExchangeableEnumGenerator extends GeneratorForAnnotation { @@ -21,25 +23,25 @@ class ExchangeableEnumGenerator // Visits all the children of element in no particular order. element.visitChildren(visitor); - final className = visitor.constructor.returnType.element.name; + final className = visitor.constructor.returnType.element2.name; // remove "_" to generate the correct class name final extClassName = className.replaceFirst("_", ""); final classBuffer = StringBuffer(); final classDocs = - visitor.constructor.returnType.element.documentationComment; + visitor.constructor.returnType.element2.documentationComment; if (classDocs != null) { classBuffer.writeln(classDocs); } final classSupportedDocs = Util.getSupportedDocs( _coreCheckerEnumSupportedPlatforms, - visitor.constructor.returnType.element); + visitor.constructor.returnType.element2); if (classSupportedDocs != null) { classBuffer.writeln(classSupportedDocs); } - if (visitor.constructor.returnType.element.hasDeprecated) { + if (visitor.constructor.returnType.element2.hasDeprecated) { 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 {'); @@ -66,6 +68,38 @@ class ExchangeableEnumGenerator if (fieldName == "_value" || fieldName == "_nativeValue") { 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; if (docs != null) { classBuffer.writeln(docs); @@ -145,14 +179,17 @@ class ExchangeableEnumGenerator for (final entry in visitor.fields.entries) { final fieldName = entry.key; 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('].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 = annotation.read("bitwiseOrOperator").boolValue; 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 = annotation.read("bitwiseOrOperator").boolValue; classBuffer.writeln(""" @@ -192,8 +230,13 @@ class ExchangeableEnumGenerator for (final entry in visitor.methods.entries) { final methodElement = entry.value; + if (Util.methodHasIgnore(methodElement)) { + continue; + } 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) { final docs = methodElement.documentationComment; 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(""" ///Gets [${enumValue.type}] 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(""" ///Gets [${enumNativeValue.type}] native value. ${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(""" @override int get hashCode => _value.hashCode; @@ -241,7 +287,8 @@ class ExchangeableEnumGenerator "$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('String toString() {'); if (enumValue.type.isDartCoreString) { diff --git a/dev_packages/generators/lib/src/exchangeable_object_generator.dart b/dev_packages/generators/lib/src/exchangeable_object_generator.dart index aa567f4a..e6153a46 100644 --- a/dev_packages/generators/lib/src/exchangeable_object_generator.dart +++ b/dev_packages/generators/lib/src/exchangeable_object_generator.dart @@ -13,6 +13,8 @@ final _coreCheckerObjectConstructor = const TypeChecker.fromRuntime(ExchangeableObjectConstructor); final _coreCheckerObjectProperty = const TypeChecker.fromRuntime(ExchangeableObjectProperty); +final _coreCheckerObjectMethod = + const TypeChecker.fromRuntime(ExchangeableObjectMethod); final _coreCheckerEnum = const TypeChecker.fromRuntime(ExchangeableEnum); final _coreCheckerDeprecated = const TypeChecker.fromRuntime(Deprecated); final _coreCheckerSupportedPlatforms = @@ -27,32 +29,36 @@ class ExchangeableObjectGenerator // Visits all the children of element in no particular order. element.visitChildren(visitor); - final className = visitor.constructor.returnType.element.name; + final className = visitor.constructor.returnType.element2.name; final superClass = - visitor.constructor.returnType.superclass?.element.name != 'Object' + visitor.constructor.returnType.superclass?.element2.name != 'Object' ? visitor.constructor.returnType.superclass : 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 final extClassName = className.replaceFirst("_", ""); final classBuffer = StringBuffer(); final classDocs = - visitor.constructor.returnType.element.documentationComment; + visitor.constructor.returnType.element2.documentationComment; if (classDocs != null) { classBuffer.writeln(classDocs); } final classSupportedDocs = Util.getSupportedDocs( - _coreCheckerSupportedPlatforms, visitor.constructor.returnType.element); + _coreCheckerSupportedPlatforms, visitor.constructor.returnType.element2); if (classSupportedDocs != null) { classBuffer.writeln(classSupportedDocs); } - if (visitor.constructor.returnType.element.hasDeprecated) { + if (visitor.constructor.returnType.element2.hasDeprecated) { 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) { classBuffer.writeln(' extends ${superClassName}'); } @@ -98,6 +104,9 @@ class ExchangeableObjectGenerator if (fieldElement.isStatic) { classBuffer.write("static "); } + if (fieldElement.isLate) { + classBuffer.write("late "); + } if (fieldElement.isFinal) { classBuffer.write("final "); } @@ -155,7 +164,7 @@ class ExchangeableObjectGenerator if (constructorSupportedDocs == null) { constructorSupportedDocs = Util.getSupportedDocs( _coreCheckerSupportedPlatforms, - visitor.constructor.returnType.element); + visitor.constructor.returnType.element2); } if (constructorSupportedDocs != null) { classBuffer.writeln(constructorSupportedDocs); @@ -214,12 +223,17 @@ class ExchangeableObjectGenerator .trim(); final fieldElement = visitor.fields[fieldName]; if (fieldElement != null) { - final fieldTypeElement = fieldElement.type.element; - final deprecatedFieldTypeElement = deprecatedField.type.element; + final fieldTypeElement = fieldElement.type.element2; + 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 ?? '); if (fieldTypeElement != null && deprecatedFieldTypeElement != null) { - final isNullable = Util.typeIsNullable(fieldElement.type); final deprecatedIsNullable = Util.typeIsNullable(deprecatedField.type); final hasFromMap = hasFromMapMethod(fieldTypeElement); @@ -257,8 +271,8 @@ class ExchangeableObjectGenerator classBuffer.writeln(';'); } - if (annotation.read("fromMapFactory").boolValue && - !visitor.methods.containsKey("fromMap")) { + if (annotation.read("fromMapFactory").boolValue && (!visitor.methods.containsKey("fromMap") || + Util.methodHasIgnore(visitor.methods['fromMap']!))) { classBuffer.writeln( '///Gets a possible [$extClassName] instance from a [Map] value.'); final nullable = annotation.read("nullableFromMapFactory").boolValue; @@ -272,7 +286,7 @@ class ExchangeableObjectGenerator classBuffer.writeln('final instance = $extClassName('); final fieldElements = []; if (superClass != null) { - fieldElements.addAll(superClass.element.fields); + fieldElements.addAll(superClass.element2.fields); } fieldElements.addAll(visitor.fields.values); final nonRequiredFields = []; @@ -301,7 +315,7 @@ class ExchangeableObjectGenerator ?.toFunctionValue(); if (customDeserializer != null) { final deserializerClassName = - customDeserializer.enclosingElement.name; + customDeserializer.enclosingElement3.name; if (deserializerClassName != null) { value = "$deserializerClassName.${customDeserializer.name}($value)"; @@ -334,6 +348,9 @@ class ExchangeableObjectGenerator for (final entry in visitor.methods.entries) { final methodElement = entry.value; + if (Util.methodHasIgnore(methodElement)) { + continue; + } ParsedLibraryResult parsed = methodElement.session ?.getParsedLibraryByElement(methodElement.library) as ParsedLibraryResult; @@ -353,14 +370,24 @@ class ExchangeableObjectGenerator } } - if (annotation.read("toMapMethod").boolValue && - !visitor.methods.containsKey("toMap")) { + if (annotation.read("toMapMethod").boolValue && (!visitor.methods.containsKey("toMap") || + Util.methodHasIgnore(visitor.methods['toMap']!))) { classBuffer.writeln('///Converts instance to a map.'); classBuffer.writeln('Map toMap() {'); 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 = []; if (superClass != null) { - for (final fieldElement in superClass.element.fields) { + for (final fieldElement in superClass.element2.fields) { if (!fieldElement.isPrivate && !fieldElement.hasDeprecated && !fieldElement.isStatic && @@ -390,7 +417,7 @@ class ExchangeableObjectGenerator ?.getField("serializer") ?.toFunctionValue(); if (customSerializer != null) { - final serializerClassName = customSerializer.enclosingElement.name; + final serializerClassName = customSerializer.enclosingElement3.name; if (serializerClassName != null) { mapValue = "$serializerClassName.${customSerializer.name}($mapValue)"; @@ -408,22 +435,22 @@ class ExchangeableObjectGenerator classBuffer.writeln('}'); } - if (annotation.read("toJsonMethod").boolValue && - !visitor.methods.containsKey("toJson")) { + if (annotation.read("toJsonMethod").boolValue && (!visitor.methods.containsKey("toJson") || + Util.methodHasIgnore(visitor.methods['toJson']!))) { classBuffer.writeln('///Converts instance to a map.'); classBuffer.writeln('Map toJson() {'); classBuffer.writeln('return toMap();'); classBuffer.writeln('}'); } - 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('String toString() {'); classBuffer.write('return \'$extClassName{'); final fieldNames = []; if (superClass != null) { - for (final fieldElement in superClass.element.fields) { + for (final fieldElement in superClass.element2.fields) { final fieldName = fieldElement.name; if (!fieldElement.isPrivate && !fieldElement.hasDeprecated && @@ -453,7 +480,7 @@ class ExchangeableObjectGenerator } String getFromMapValue(String value, DartType elementType) { - final fieldTypeElement = elementType.element; + final fieldTypeElement = elementType.element2; final isNullable = Util.typeIsNullable(elementType); if (elementType.getDisplayString(withNullability: false) == "Uri") { if (!isNullable) { @@ -486,9 +513,9 @@ class ExchangeableObjectGenerator final genericTypeFieldName = 'e'; return value + (isNullable ? '?' : '') + - '.forEach(($genericTypeFieldName) => ' + + '.map(($genericTypeFieldName) => ' + getFromMapValue('$genericTypeFieldName', genericType) + - ')'; + ')${elementType.isDartCoreSet ? '.toSet()' : ''}'; } else { return value; } @@ -523,7 +550,7 @@ class ExchangeableObjectGenerator } String getToMapValue(String fieldName, DartType elementType) { - final fieldTypeElement = elementType.element; + final fieldTypeElement = elementType.element2; final isNullable = Util.typeIsNullable(elementType); if (elementType.getDisplayString(withNullability: false) == "Uri") { return fieldName + (isNullable ? '?' : '') + '.toString()'; diff --git a/dev_packages/generators/lib/src/util.dart b/dev_packages/generators/lib/src/util.dart index 7be8ff41..d30c33bb 100644 --- a/dev_packages/generators/lib/src/util.dart +++ b/dev_packages/generators/lib/src/util.dart @@ -3,6 +3,10 @@ import 'package:source_gen/source_gen.dart'; import 'package:analyzer/dart/element/type.dart'; import 'package:analyzer/dart/element/nullability_suffix.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 { static bool typeIsNullable(DartType type) { @@ -10,6 +14,14 @@ abstract class Util { type.toString() == 'dynamic'; } + static bool methodHasIgnore(MethodElement method) { + return _coreCheckerObjectMethod + .firstAnnotationOf(method) + ?.getField("ignore") + ?.toBoolValue() == + true; + } + static String? getSupportedDocs(TypeChecker checker, Element element) { final platformNoteList = []; final platformSupportedList = []; @@ -64,7 +76,7 @@ abstract class Util { } static bool canHaveGenerics(DartType type) { - final element = type.element; + final element = type.element2; if (element is ClassElement) { return element.typeParameters.isNotEmpty; } diff --git a/dev_packages/generators/pubspec.lock b/dev_packages/generators/pubspec.lock index b47fe7bb..00e926d6 100644 --- a/dev_packages/generators/pubspec.lock +++ b/dev_packages/generators/pubspec.lock @@ -7,14 +7,14 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "39.0.0" + version: "49.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "4.0.0" + version: "5.1.0" args: dependency: transitive description: @@ -42,14 +42,14 @@ packages: name: build url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "2.3.1" build_config: dependency: transitive description: name: build_config url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.1.0" build_daemon: dependency: transitive description: @@ -63,21 +63,21 @@ packages: name: build_resolvers url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.0.10" build_runner: dependency: "direct dev" description: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "2.1.10" + version: "2.2.1" build_runner_core: dependency: transitive description: name: build_runner_core url: "https://pub.dartlang.org" source: hosted - version: "7.2.3" + version: "7.2.4" build_test: dependency: "direct dev" description: @@ -98,21 +98,14 @@ packages: name: built_value url: "https://pub.dartlang.org" source: hosted - version: "8.3.0" + version: "8.4.1" characters: dependency: transitive description: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" + version: "1.2.1" checked_yaml: dependency: transitive description: @@ -126,28 +119,28 @@ packages: name: code_builder url: "https://pub.dartlang.org" source: hosted - version: "4.1.0" + version: "4.3.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" convert: dependency: transitive description: name: convert url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.0.2" coverage: dependency: transitive description: name: coverage url: "https://pub.dartlang.org" source: hosted - version: "1.3.1" + version: "1.6.1" crypto: dependency: transitive description: @@ -161,21 +154,21 @@ packages: name: csslib url: "https://pub.dartlang.org" source: hosted - version: "0.17.1" + version: "0.17.2" dart_style: dependency: transitive description: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "2.2.3" + version: "2.2.4" file: dependency: transitive description: name: file url: "https://pub.dartlang.org" source: hosted - version: "6.1.2" + version: "6.1.4" fixnum: dependency: transitive description: @@ -201,14 +194,14 @@ packages: name: frontend_server_client url: "https://pub.dartlang.org" source: hosted - version: "2.1.2" + version: "2.1.3" glob: dependency: transitive description: name: glob url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.1.0" graphs: dependency: transitive description: @@ -229,14 +222,14 @@ packages: name: http_multi_server url: "https://pub.dartlang.org" source: hosted - version: "3.2.0" + version: "3.2.1" http_parser: dependency: transitive description: name: http_parser url: "https://pub.dartlang.org" source: hosted - version: "4.0.0" + version: "4.0.1" io: dependency: transitive description: @@ -257,7 +250,7 @@ packages: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.5.0" + version: "4.7.0" logging: dependency: transitive description: @@ -271,21 +264,21 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.11" + version: "0.12.12" material_color_utilities: dependency: transitive description: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.5" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.8.0" mime: dependency: transitive description: @@ -306,21 +299,21 @@ packages: name: package_config url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.1.0" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" pool: dependency: transitive description: name: pool url: "https://pub.dartlang.org" source: hosted - version: "1.5.0" + version: "1.5.1" pub_semver: dependency: transitive description: @@ -334,35 +327,35 @@ packages: name: pubspec_parse url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" shelf: dependency: transitive description: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.4.0" shelf_packages_handler: dependency: transitive description: name: shelf_packages_handler url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.0.1" shelf_static: dependency: transitive description: name: shelf_static url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" shelf_web_socket: dependency: transitive description: name: shelf_web_socket url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.2" sky_engine: dependency: transitive description: flutter @@ -374,7 +367,7 @@ packages: name: source_gen url: "https://pub.dartlang.org" source: hosted - version: "1.2.2" + version: "1.2.5" source_map_stack_trace: dependency: transitive description: @@ -395,7 +388,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.9.0" + version: "1.9.1" stack_trace: dependency: transitive description: @@ -409,7 +402,7 @@ packages: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" stream_transform: dependency: transitive description: @@ -430,28 +423,28 @@ packages: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" test: dependency: "direct dev" description: name: test url: "https://pub.dartlang.org" source: hosted - version: "1.21.1" + version: "1.21.6" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.9" + version: "0.4.14" test_core: dependency: transitive description: name: test_core url: "https://pub.dartlang.org" source: hosted - version: "0.4.13" + version: "0.4.18" timing: dependency: transitive description: @@ -465,21 +458,21 @@ packages: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.1" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" vm_service: dependency: transitive description: name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "8.3.0" + version: "9.4.0" watcher: dependency: transitive description: @@ -500,7 +493,7 @@ packages: name: webkit_inspection_protocol url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.2.0" yaml: dependency: transitive description: @@ -509,5 +502,5 @@ packages: source: hosted version: "3.1.1" sdks: - dart: ">=2.16.0 <3.0.0" + dart: ">=2.18.0 <3.0.0" flutter: ">=2.5.0" diff --git a/dev_packages/generators/pubspec.yaml b/dev_packages/generators/pubspec.yaml index ae78bc72..4f59c141 100755 --- a/dev_packages/generators/pubspec.yaml +++ b/dev_packages/generators/pubspec.yaml @@ -10,12 +10,12 @@ environment: dependencies: flutter: sdk: flutter - build: - source_gen: + build: ^2.3.1 + source_gen: ^1.2.5 flutter_inappwebview_internal_annotations: path: ../flutter_inappwebview_internal_annotations/ dev_dependencies: - build_runner: - build_test: + build_runner: ^2.2.1 + build_test: ^2.1.5 test: ^1.21.1 \ No newline at end of file diff --git a/dev_packages/test_gen/pubspec.lock b/dev_packages/test_gen/pubspec.lock index 7ae39e4f..3475a3e7 100644 --- a/dev_packages/test_gen/pubspec.lock +++ b/dev_packages/test_gen/pubspec.lock @@ -7,14 +7,14 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "39.0.0" + version: "49.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "4.0.0" + version: "5.1.0" args: dependency: transitive description: @@ -35,14 +35,14 @@ packages: name: build url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "2.3.1" build_config: dependency: transitive description: name: build_config url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.1.0" build_daemon: dependency: transitive description: @@ -56,21 +56,21 @@ packages: name: build_resolvers url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.0.10" build_runner: dependency: "direct dev" description: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "2.1.10" + version: "2.2.1" build_runner_core: dependency: transitive description: name: build_runner_core url: "https://pub.dartlang.org" source: hosted - version: "7.2.3" + version: "7.2.4" built_collection: dependency: transitive description: @@ -84,21 +84,14 @@ packages: name: built_value url: "https://pub.dartlang.org" source: hosted - version: "8.3.0" + version: "8.4.1" characters: dependency: transitive description: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" + version: "1.2.1" checked_yaml: dependency: transitive description: @@ -112,21 +105,21 @@ packages: name: code_builder url: "https://pub.dartlang.org" source: hosted - version: "4.1.0" + version: "4.3.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" convert: dependency: transitive description: name: convert url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.0.2" crypto: dependency: transitive description: @@ -140,14 +133,14 @@ packages: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "2.2.3" + version: "2.2.4" file: dependency: transitive description: name: file url: "https://pub.dartlang.org" source: hosted - version: "6.1.2" + version: "6.1.4" fixnum: dependency: transitive description: @@ -173,7 +166,7 @@ packages: name: frontend_server_client url: "https://pub.dartlang.org" source: hosted - version: "2.1.2" + version: "2.1.3" generators: dependency: "direct dev" description: @@ -187,7 +180,7 @@ packages: name: glob url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.1.0" graphs: dependency: transitive description: @@ -201,14 +194,14 @@ packages: name: http_multi_server url: "https://pub.dartlang.org" source: hosted - version: "3.2.0" + version: "3.2.1" http_parser: dependency: transitive description: name: http_parser url: "https://pub.dartlang.org" source: hosted - version: "4.0.0" + version: "4.0.1" io: dependency: transitive description: @@ -229,7 +222,7 @@ packages: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.5.0" + version: "4.7.0" lints: dependency: "direct dev" description: @@ -250,21 +243,21 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.11" + version: "0.12.12" material_color_utilities: dependency: transitive description: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.5" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.8.0" mime: dependency: transitive description: @@ -278,21 +271,21 @@ packages: name: package_config url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.1.0" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" pool: dependency: transitive description: name: pool url: "https://pub.dartlang.org" source: hosted - version: "1.5.0" + version: "1.5.1" pub_semver: dependency: transitive description: @@ -306,21 +299,21 @@ packages: name: pubspec_parse url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" shelf: dependency: transitive description: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.4.0" shelf_web_socket: dependency: transitive description: name: shelf_web_socket url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.2" sky_engine: dependency: transitive description: flutter @@ -332,14 +325,14 @@ packages: name: source_gen url: "https://pub.dartlang.org" source: hosted - version: "1.2.2" + version: "1.2.5" source_span: dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.9.0" + version: "1.9.1" stack_trace: dependency: transitive description: @@ -353,7 +346,7 @@ packages: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" stream_transform: dependency: transitive description: @@ -374,7 +367,7 @@ packages: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" timing: dependency: transitive description: @@ -388,14 +381,14 @@ packages: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.1" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" watcher: dependency: transitive description: @@ -418,5 +411,5 @@ packages: source: hosted version: "3.1.1" sdks: - dart: ">=2.16.0 <3.0.0" + dart: ">=2.17.0 <3.0.0" flutter: ">=2.5.0" diff --git a/dev_packages/test_gen/pubspec.yaml b/dev_packages/test_gen/pubspec.yaml index 155717eb..3b11705e 100755 --- a/dev_packages/test_gen/pubspec.yaml +++ b/dev_packages/test_gen/pubspec.yaml @@ -14,7 +14,7 @@ dependencies: path: ../flutter_inappwebview_internal_annotations/ dev_dependencies: - build_runner: + build_runner: ^2.2.1 generators: path: ../generators/ lints: ^1.0.1 \ No newline at end of file diff --git a/example/test_assets/certificate.pfx b/example/test_assets/certificate.pfx index 3225678f2496fe0a2c632dde05acc7337b66b44c..6e3621075d27a5d473303fb4a3dfff59b003ff23 100755 GIT binary patch delta 5594 zcmV<06(#EZD}^jTFoG5V0s#Xsf)&RG2`Yw2hW8Bt2LYgh6}SX~6|^vd6|gXZ3+Dz2 zDuzgg_YDCD2B3lq*f4?%)B*tjFoFxskw6`PGO^}q>m?p$0s;sCfPxF4t2`a$YAk7` z`5lJCi2@NDX7Iob&jN|-IrMj&!+_`Iyy<ytFmB`h=b3s|-h;4gGPn6vC)93nTW z=G^tj@+ck&(S;d4DcMP8Qn%$BwI4Hoi*$$og~EXn`2maEPVc$l1fx5}@e3duD};(L z_A9)lH&7t}B{+?My$$YUhe#-flT*3W_0C?b^4-p}!>Y!e7 zlhe9vlibG?3kLjhFcJmQFhA1%k8^LV&=Ou!cG25HHJa%?k3t*S1Vr|cAzp@m^A`c} z_1y@&2>E8b)(xqGHMoq`e7aKfpxywXhqBZY2T^|!JdxNjI2;T{eiq$KScI{Wc*iVc z;Pk|1c_*b3aqM|c@D(k)#!MAcs=uu;xrwVPY)r)as?Be#1CzUkmBUveOL8;>TG-%W z!VH;i*hqBLECkR4n@@V*bU~$mRUWYDq9&G}mm9^K(i{D)tBE`kAnvAnZYI%I*ka7U zk8}^sJU}OX++?=z!f#5e&~mkIKyHHWvlDDar&arPtaoJHWv!L+*R5vrA7Yy#Za43t z0N@GB^T05!RhXpuuEixRT2OvoV;_q@TYY)D660roR*fW_J@#?} zeN&&_I!n@BHB3wV-J;rKFw1-jraM3k8?Uc)kf>>>+7TX zRduA5Xa-sdVD(pPStF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UkO7YXPVx42DRKl1`69(w-#>J--0Su^SZGrSF$Zh1bv+6=7f8jiVs>k86!8eSnbfyHs@h|kMBNzN2fS) z4hTTZJXuUegV7p!hGUYG{q%DiIzvg)YXSBMl`Q$VBW`pHcyGGM zI5e{$YJ`_aZ+E)Di4;oO|D3&2qaZLm==kCtdfET2WkJvU4$?3~PxGDLW^pPEP4PwN zVZoTHqsHwpmXXEYbB7XGUv2k)>v>cq?~0O78utl~Mn`e;6&&|c-hYwZIKLa+UepOU z-0$vzk!b0bVWDI@lGAusei(E^2DrAvvWSv}j>HlKtOw1iJ{HBQe^V8UuF8M#O11xu^ z)t~v{0BI!|MKAdZamfk^U2jt@5%cIW4@|b*=L%R+)&1InbrLE@2fOvjn(oH89l>a& zAWM;_nkQ}$a%s6VKh6?=jo{Tn4M*-NSNlcF0b@pZwNgd`GbC!H2na?yaYIWAoQb>U zva(n|MZY+`9<6;ecC})H9!udpS`?#GASg`gC0VLMwP_L5xcQK(_T6v&UEiOaVF=p$ zk{9|jV9|B;pFi|B==2xr`Aat-qpm~xYldklkeecGM!BCZAHkb{YB6&A`rk1{pA4Z8 zj+@5&PBZJxJliXfQDA?(n+4rJfF!rV^EXQa8~NtfK8%_IUb4Ch$su_tT4zPtNvq8K zqkL+z#==D`LTPey<;MEts-r6G=&a{XbK`4tV9k+Oq`d=*ZTqw!%KkAWFe3&DDuzgg z_YDCF6)_eB6no@Fw?Nd?YsXs0@S1hPA#xB4V>~c1Fd;Ar1_dh)0|FWa00b0H)%f}+ g6TJ3U@*m0toRgRM&KdUv2r^_(jS&eht^xuG0L`AaK>z>% diff --git a/ios/Classes/InAppWebView/WebViewChannelDelegate.swift b/ios/Classes/InAppWebView/WebViewChannelDelegate.swift index 761bc337..551e2b58 100644 --- a/ios/Classes/InAppWebView/WebViewChannelDelegate.swift +++ b/ios/Classes/InAppWebView/WebViewChannelDelegate.swift @@ -1007,7 +1007,7 @@ public class WebViewChannelDelegate : ChannelDelegate { override init() { super.init() 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 false diff --git a/lib/src/android/main.dart b/lib/src/android/main.dart index fce751da..5b7613df 100644 --- a/lib/src/android/main.dart +++ b/lib/src/android/main.dart @@ -1,3 +1,3 @@ export 'service_worker_controller.dart'; -export 'webview_feature.dart'; +export 'webview_feature.dart' show WebViewFeature, AndroidWebViewFeature; export 'proxy_controller.dart'; diff --git a/lib/src/android/webview_feature.dart b/lib/src/android/webview_feature.dart index 4c7f398a..ea8a2e46 100644 --- a/lib/src/android/webview_feature.dart +++ b/lib/src/android/webview_feature.dart @@ -1,255 +1,198 @@ import 'dart:async'; 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_settings.dart'; import 'proxy_controller.dart'; import 'service_worker_controller.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 WebViewFeature { +@ExchangeableEnum() +class WebViewFeature_ { + @ExchangeableEnumCustomValue() static const MethodChannel _channel = const MethodChannel( 'com.pichillilorenzo/flutter_inappwebview_webviewfeature'); + // ignore: unused_field final String _value; + const WebViewFeature_._internal(this._value); - const WebViewFeature._internal(this._value); - - static final Set 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; - } - + @ExchangeableObjectMethod(ignore: true) String toValue() => _value; - @override - String toString() => _value; - ///This feature covers [InAppWebViewController.createWebMessageChannel]. 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]. 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]. - static const FORCE_DARK = const WebViewFeature._internal("FORCE_DARK"); + static const FORCE_DARK = const WebViewFeature_._internal("FORCE_DARK"); ///This feature covers [InAppWebViewSettings.forceDarkStrategy]. static const FORCE_DARK_STRATEGY = - const WebViewFeature._internal("FORCE_DARK_STRATEGY"); + const WebViewFeature_._internal("FORCE_DARK_STRATEGY"); /// 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 = - const WebViewFeature._internal("GET_WEB_VIEW_CLIENT"); + const WebViewFeature_._internal("GET_WEB_VIEW_CLIENT"); /// 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]. static const OFF_SCREEN_PRERASTER = - const WebViewFeature._internal("OFF_SCREEN_PRERASTER"); + const WebViewFeature_._internal("OFF_SCREEN_PRERASTER"); ///This feature covers [InAppWebViewController.postWebMessage]. 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]. static const PROXY_OVERRIDE = - const WebViewFeature._internal("PROXY_OVERRIDE"); + const WebViewFeature_._internal("PROXY_OVERRIDE"); /// static const RECEIVE_HTTP_ERROR = - const WebViewFeature._internal("RECEIVE_HTTP_ERROR"); + const WebViewFeature_._internal("RECEIVE_HTTP_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]. static const SAFE_BROWSING_ALLOWLIST = - const WebViewFeature._internal("SAFE_BROWSING_ALLOWLIST"); + const WebViewFeature_._internal("SAFE_BROWSING_ALLOWLIST"); ///This feature covers [InAppWebViewSettings.safeBrowsingEnabled]. static const SAFE_BROWSING_ENABLE = - const WebViewFeature._internal("SAFE_BROWSING_ENABLE"); + const WebViewFeature_._internal("SAFE_BROWSING_ENABLE"); /// static const SAFE_BROWSING_HIT = - const WebViewFeature._internal("SAFE_BROWSING_HIT"); + const WebViewFeature_._internal("SAFE_BROWSING_HIT"); ///This feature covers [InAppWebViewController.getSafeBrowsingPrivacyPolicyUrl]. 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 = - const WebViewFeature._internal("SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY"); + const WebViewFeature_._internal("SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY"); /// 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 = - const WebViewFeature._internal( + const WebViewFeature_._internal( "SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL"); ///Use [SAFE_BROWSING_ALLOWLIST] instead. @Deprecated('Use SAFE_BROWSING_ALLOWLIST instead') static const SAFE_BROWSING_WHITELIST = - const WebViewFeature._internal("SAFE_BROWSING_WHITELIST"); + const WebViewFeature_._internal("SAFE_BROWSING_WHITELIST"); ///This feature covers [ServiceWorkerController]. 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]. 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]. 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]. 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]. 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]. 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 = - const WebViewFeature._internal("SHOULD_OVERRIDE_WITH_REDIRECTS"); + const WebViewFeature_._internal("SHOULD_OVERRIDE_WITH_REDIRECTS"); ///This feature covers [InAppWebViewController.startSafeBrowsing]. static const START_SAFE_BROWSING = - const WebViewFeature._internal("START_SAFE_BROWSING"); + const WebViewFeature_._internal("START_SAFE_BROWSING"); /// 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 = - const WebViewFeature._internal("VISUAL_STATE_CALLBACK"); + const WebViewFeature_._internal("VISUAL_STATE_CALLBACK"); /// 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]. static const WEB_MESSAGE_LISTENER = - const WebViewFeature._internal("WEB_MESSAGE_LISTENER"); + const WebViewFeature_._internal("WEB_MESSAGE_LISTENER"); /// 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 = - const WebViewFeature._internal("WEB_MESSAGE_PORT_POST_MESSAGE"); + const WebViewFeature_._internal("WEB_MESSAGE_PORT_POST_MESSAGE"); /// 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 = - const WebViewFeature._internal("WEB_RESOURCE_ERROR_GET_CODE"); + const WebViewFeature_._internal("WEB_RESOURCE_ERROR_GET_CODE"); /// 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 = - const WebViewFeature._internal("WEB_RESOURCE_REQUEST_IS_REDIRECT"); + const WebViewFeature_._internal("WEB_RESOURCE_REQUEST_IS_REDIRECT"); /// 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 = - const WebViewFeature._internal("WEB_VIEW_RENDERER_TERMINATE"); - - bool operator ==(value) => value == _value; - - @override - int get hashCode => _value.hashCode; + const WebViewFeature_._internal("WEB_VIEW_RENDERER_TERMINATE"); ///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 isFeatureSupported(WebViewFeature feature) async { + static Future isFeatureSupported(WebViewFeature_ feature) async { Map args = {}; args.putIfAbsent("feature", () => feature.toValue()); 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. ///Use [WebViewFeature] instead. @Deprecated("Use WebViewFeature instead") -class AndroidWebViewFeature { +@ExchangeableEnum() +class AndroidWebViewFeature_ { + @ExchangeableEnumCustomValue() static const MethodChannel _channel = const MethodChannel( 'com.pichillilorenzo/flutter_inappwebview_webviewfeature'); + // ignore: unused_field final String _value; + const AndroidWebViewFeature_._internal(this._value); - const AndroidWebViewFeature._internal(this._value); - - static final Set 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; - } - + @ExchangeableObjectMethod(ignore: true) String toValue() => _value; - @override - String toString() => _value; - /// 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 = - 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 = - const AndroidWebViewFeature._internal("FORCE_DARK_STRATEGY"); + const AndroidWebViewFeature_._internal("FORCE_DARK_STRATEGY"); /// 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 = - const AndroidWebViewFeature._internal("GET_WEB_VIEW_CLIENT"); + const AndroidWebViewFeature_._internal("GET_WEB_VIEW_CLIENT"); /// static const GET_WEB_VIEW_RENDERER = - const AndroidWebViewFeature._internal("GET_WEB_VIEW_RENDERER"); + const AndroidWebViewFeature_._internal("GET_WEB_VIEW_RENDERER"); /// static const MULTI_PROCESS = - const AndroidWebViewFeature._internal("MULTI_PROCESS"); + const AndroidWebViewFeature_._internal("MULTI_PROCESS"); /// static const OFF_SCREEN_PRERASTER = - const AndroidWebViewFeature._internal("OFF_SCREEN_PRERASTER"); + const AndroidWebViewFeature_._internal("OFF_SCREEN_PRERASTER"); /// static const POST_WEB_MESSAGE = - const AndroidWebViewFeature._internal("POST_WEB_MESSAGE"); + const AndroidWebViewFeature_._internal("POST_WEB_MESSAGE"); /// static const PROXY_OVERRIDE = - const AndroidWebViewFeature._internal("PROXY_OVERRIDE"); + const AndroidWebViewFeature_._internal("PROXY_OVERRIDE"); /// static const RECEIVE_HTTP_ERROR = - const AndroidWebViewFeature._internal("RECEIVE_HTTP_ERROR"); + const AndroidWebViewFeature_._internal("RECEIVE_HTTP_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 = - const AndroidWebViewFeature._internal("SAFE_BROWSING_ALLOWLIST"); + const AndroidWebViewFeature_._internal("SAFE_BROWSING_ALLOWLIST"); /// static const SAFE_BROWSING_ENABLE = - const AndroidWebViewFeature._internal("SAFE_BROWSING_ENABLE"); + const AndroidWebViewFeature_._internal("SAFE_BROWSING_ENABLE"); /// static const SAFE_BROWSING_HIT = - const AndroidWebViewFeature._internal("SAFE_BROWSING_HIT"); + const AndroidWebViewFeature_._internal("SAFE_BROWSING_HIT"); /// 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 = - const AndroidWebViewFeature._internal( + const AndroidWebViewFeature_._internal( "SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY"); /// 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 = - const AndroidWebViewFeature._internal( + const AndroidWebViewFeature_._internal( "SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL"); ///Use [SAFE_BROWSING_ALLOWLIST] instead. @Deprecated('Use SAFE_BROWSING_ALLOWLIST instead') static const SAFE_BROWSING_WHITELIST = - const AndroidWebViewFeature._internal("SAFE_BROWSING_WHITELIST"); + const AndroidWebViewFeature_._internal("SAFE_BROWSING_WHITELIST"); /// 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 = - const AndroidWebViewFeature._internal( + const AndroidWebViewFeature_._internal( "SERVICE_WORKER_BLOCK_NETWORK_LOADS"); /// 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 = - const AndroidWebViewFeature._internal("SERVICE_WORKER_CONTENT_ACCESS"); + const AndroidWebViewFeature_._internal("SERVICE_WORKER_CONTENT_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 = - const AndroidWebViewFeature._internal( + const AndroidWebViewFeature_._internal( "SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST"); /// 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 = - const AndroidWebViewFeature._internal("START_SAFE_BROWSING"); + const AndroidWebViewFeature_._internal("START_SAFE_BROWSING"); /// 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 = - const AndroidWebViewFeature._internal("VISUAL_STATE_CALLBACK"); + const AndroidWebViewFeature_._internal("VISUAL_STATE_CALLBACK"); /// 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 = - const AndroidWebViewFeature._internal("WEB_MESSAGE_LISTENER"); + const AndroidWebViewFeature_._internal("WEB_MESSAGE_LISTENER"); /// 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 = - const AndroidWebViewFeature._internal("WEB_MESSAGE_PORT_POST_MESSAGE"); + const AndroidWebViewFeature_._internal("WEB_MESSAGE_PORT_POST_MESSAGE"); /// static const WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK = - const AndroidWebViewFeature._internal( + const AndroidWebViewFeature_._internal( "WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK"); /// 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 = - const AndroidWebViewFeature._internal( + const AndroidWebViewFeature_._internal( "WEB_RESOURCE_ERROR_GET_DESCRIPTION"); /// 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 = - const AndroidWebViewFeature._internal( + const AndroidWebViewFeature_._internal( "WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE"); /// static const WEB_VIEW_RENDERER_TERMINATE = - const AndroidWebViewFeature._internal("WEB_VIEW_RENDERER_TERMINATE"); - - bool operator ==(value) => value == _value; - - @override - int get hashCode => _value.hashCode; + const AndroidWebViewFeature_._internal("WEB_VIEW_RENDERER_TERMINATE"); ///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 isFeatureSupported(AndroidWebViewFeature feature) async { + static Future isFeatureSupported(AndroidWebViewFeature_ feature) async { Map args = {}; args.putIfAbsent("feature", () => feature.toValue()); return await _channel.invokeMethod('isFeatureSupported', args); diff --git a/lib/src/android/webview_feature.g.dart b/lib/src/android/webview_feature.g.dart new file mode 100644 index 00000000..6ef3baa9 --- /dev/null +++ b/lib/src/android/webview_feature.g.dart @@ -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 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 isFeatureSupported(WebViewFeature_ feature) async { + Map args = {}; + 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 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 isFeatureSupported(AndroidWebViewFeature_ feature) async { + Map args = {}; + 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; + } +} diff --git a/lib/src/in_app_webview/apple/in_app_webview_options.dart b/lib/src/in_app_webview/apple/in_app_webview_options.dart index 4cc00046..2b98252b 100755 --- a/lib/src/in_app_webview/apple/in_app_webview_options.dart +++ b/lib/src/in_app_webview/apple/in_app_webview_options.dart @@ -196,8 +196,8 @@ class IOSInAppWebViewOptions ///- [IOSInAppWebViewOptions.enableViewportScale] /// ///Events affected: - ///- the `hitTestResult` argument of [WebView.onLongPressHitTestResult] will be empty - ///- the `hitTestResult` argument of [ContextMenu.onCreateContextMenu] will be empty + ///- the `hitTestResult` argument of [WebView.onLongPressHitTestResult] will be empty + ///- the `hitTestResult` argument of [ContextMenu.onCreateContextMenu] will be empty ///- [WebView.onLoadResource] ///- [WebView.shouldInterceptAjaxRequest] ///- [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. ///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. ///Specify a directory to give WebView permission to read additional files in the specified directory. Uri? allowingReadAccessTo; diff --git a/lib/src/in_app_webview/in_app_webview_controller.dart b/lib/src/in_app_webview/in_app_webview_controller.dart index 41d6bb74..c48dd30f 100644 --- a/lib/src/in_app_webview/in_app_webview_controller.dart +++ b/lib/src/in_app_webview/in_app_webview_controller.dart @@ -445,19 +445,19 @@ class InAppWebViewController { if (_webview != null) { if (_webview!.onRenderProcessUnresponsive != null) return (await _webview!.onRenderProcessUnresponsive!(this, uri)) - ?.toMap(); + ?.toNativeValue(); else { // ignore: deprecated_member_use_from_same_package return (await _webview!.androidOnRenderProcessUnresponsive!( this, uri)) - ?.toMap(); + ?.toNativeValue(); } } else { return ((await _inAppBrowser!.onRenderProcessUnresponsive(uri)) ?? (await _inAppBrowser! // ignore: deprecated_member_use_from_same_package .androidOnRenderProcessUnresponsive(uri))) - ?.toMap(); + ?.toNativeValue(); } } break; @@ -473,19 +473,19 @@ class InAppWebViewController { if (_webview != null) { if (_webview!.onRenderProcessResponsive != null) return (await _webview!.onRenderProcessResponsive!(this, uri)) - ?.toMap(); + ?.toNativeValue(); else { // ignore: deprecated_member_use_from_same_package return (await _webview!.androidOnRenderProcessResponsive!( this, uri)) - ?.toMap(); + ?.toNativeValue(); } } else { return ((await _inAppBrowser!.onRenderProcessResponsive(uri)) ?? (await _inAppBrowser! // ignore: deprecated_member_use_from_same_package .androidOnRenderProcessResponsive(uri))) - ?.toMap(); + ?.toNativeValue(); } } break; @@ -957,19 +957,19 @@ class InAppWebViewController { if (_webview!.shouldAllowDeprecatedTLS != null) return (await _webview!.shouldAllowDeprecatedTLS!( this, challenge)) - ?.toMap(); + ?.toNativeValue(); else { // ignore: deprecated_member_use_from_same_package return (await _webview!.iosShouldAllowDeprecatedTLS!( this, challenge)) - ?.toMap(); + ?.toNativeValue(); } } else { return (await _inAppBrowser!.shouldAllowDeprecatedTLS(challenge)) - ?.toMap() ?? + ?.toNativeValue() ?? // ignore: deprecated_member_use_from_same_package (await _inAppBrowser!.iosShouldAllowDeprecatedTLS(challenge)) - ?.toMap(); + ?.toNativeValue(); } } break; @@ -2281,7 +2281,7 @@ class InAppWebViewController { ///Prints the current page. /// ///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+. /// @@ -2823,9 +2823,9 @@ class InAppWebViewController { ///[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. /// - ///**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**: ///- 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 { if (!autoname) { if (defaultTargetPlatform == TargetPlatform.android) { - assert(filePath.endsWith("." + WebArchiveFormat.MHT.toValue())); + assert(filePath.endsWith("." + WebArchiveFormat.MHT.toNativeValue())); } else if (defaultTargetPlatform == TargetPlatform.iOS) { - assert(filePath.endsWith("." + WebArchiveFormat.WEBARCHIVE.toValue())); + assert(filePath.endsWith("." + WebArchiveFormat.WEBARCHIVE.toNativeValue())); } } diff --git a/lib/src/in_app_webview/in_app_webview_settings.dart b/lib/src/in_app_webview/in_app_webview_settings.dart index 29e5dcc0..f161820a 100755 --- a/lib/src/in_app_webview/in_app_webview_settings.dart +++ b/lib/src/in_app_webview/in_app_webview_settings.dart @@ -916,8 +916,8 @@ class InAppWebViewSettings { ///- [InAppWebViewSettings.enableViewportScale] /// ///Events affected: - ///- the `hitTestResult` argument of [WebView.onLongPressHitTestResult] will be empty - ///- the `hitTestResult` argument of [ContextMenu.onCreateContextMenu] will be empty + ///- the `hitTestResult` argument of [WebView.onLongPressHitTestResult] will be empty + ///- the `hitTestResult` argument of [ContextMenu.onCreateContextMenu] will be empty ///- [WebView.onLoadResource] ///- [WebView.shouldInterceptAjaxRequest] ///- [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. ///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. ///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.useShouldInterceptRequest = false, this.useOnRenderProcessGone = false, - this.overScrollMode = OverScrollMode.OVER_SCROLL_IF_CONTENT_SCROLLS, + this.overScrollMode = OverScrollMode.IF_CONTENT_SCROLLS, this.networkAvailable, this.scrollBarStyle = ScrollBarStyle.SCROLLBARS_INSIDE_OVERLAY, this.verticalScrollbarPosition = diff --git a/lib/src/print_job/print_job_settings.dart b/lib/src/print_job/print_job_settings.dart index d49b94c1..2d9503cf 100644 --- a/lib/src/print_job/print_job_settings.dart +++ b/lib/src/print_job/print_job_settings.dart @@ -6,7 +6,7 @@ import 'print_job_controller.dart'; ///Class that represents the settings of a [PrintJobController]. 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. ///The default value is `false`. /// diff --git a/lib/src/types/content_world.dart b/lib/src/types/content_world.dart index 4607b0fc..3fe37a7e 100644 --- a/lib/src/types/content_world.dart +++ b/lib/src/types/content_world.dart @@ -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 Android**: it will create and append an `