code format
This commit is contained in:
parent
f886f2f1e5
commit
68f98754df
772
.idea/libraries/Dart_Packages.xml
generated
772
.idea/libraries/Dart_Packages.xml
generated
@ -1,772 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Dart Packages" type="DartPackagesLibraryType">
|
||||
<properties>
|
||||
<option name="packageNameToDirsMap">
|
||||
<entry key="_fe_analyzer_shared">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/_fe_analyzer_shared-12.0.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="analyzer">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.40.6/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="archive">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.0.0/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/archive-2.0.13/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="args">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/args-1.6.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="async">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.5.0/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.5.0-nullsafety.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="boolean_selector">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0-nullsafety.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="characters">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.1.0/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.1.0-nullsafety.5/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="charcode">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/charcode-1.2.0/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/charcode-1.2.0-nullsafety.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="cli_util">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/cli_util-0.2.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="clock">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/clock-1.1.0/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/clock-1.1.0-nullsafety.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="collection">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0-nullsafety.5/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="convert">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/convert-2.1.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="coverage">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/coverage-0.14.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="crypto">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/crypto-3.0.0/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/crypto-2.1.5/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="cupertino_icons">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-1.0.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="device_info">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/device_info-2.0.0-nullsafety.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="device_info_platform_interface">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/device_info_platform_interface-2.0.0-nullsafety.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="fake_async">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.2.0/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.2.0-nullsafety.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="ffi">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-1.0.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="file">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/file-6.1.0/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/file-6.0.0-nullsafety.4/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="flutter">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/packages/flutter/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="flutter_downloader">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.5.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="flutter_driver">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/packages/flutter_driver/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="flutter_test">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/packages/flutter_test/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="fuchsia_remote_debug_protocol">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/packages/fuchsia_remote_debug_protocol/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="glob">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/glob-1.2.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="http_multi_server">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/http_multi_server-2.2.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="http_parser">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/http_parser-3.1.4/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="integration_test">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/packages/integration_test/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="intl">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/intl-0.17.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="io">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/io-0.3.4/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="js">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.3-nullsafety.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="json_rpc_2">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/json_rpc_2-2.2.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="logging">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/logging-0.11.4/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="matcher">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.10/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.10-nullsafety.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="meta">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.3.0/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.3.0-nullsafety.6/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="mime">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/mime-1.0.0/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/mime-0.9.7/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="mockito">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/mockito-4.1.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="node_interop">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/node_interop-1.2.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="node_io">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/node_io-1.1.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="node_preamble">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/node_preamble-1.4.13/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="package_config">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/package_config-1.9.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="path">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.8.0/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.8.0-nullsafety.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="path_provider">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.0-nullsafety/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="path_provider_linux">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.2.0-nullsafety/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="path_provider_macos">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.5-nullsafety/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="path_provider_platform_interface">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_platform_interface-2.0.0-nullsafety/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="path_provider_windows">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.1.0-nullsafety.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="pedantic">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/pedantic-1.10.0/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/pedantic-1.10.0-nullsafety.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="permission_handler">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="permission_handler_platform_interface">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler_platform_interface-2.0.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="platform">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/platform-3.0.0/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/platform-3.0.0-nullsafety.4/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="plugin_platform_interface">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/plugin_platform_interface-1.1.0-nullsafety.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="pool">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/pool-1.5.0-nullsafety.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="process">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/process-4.1.0/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/process-4.0.0-nullsafety.4/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="pub_semver">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/pub_semver-1.4.4/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="shelf">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/shelf-0.7.5/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="shelf_packages_handler">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/shelf_packages_handler-2.0.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="shelf_static">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/shelf_static-0.2.9+1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="shelf_web_socket">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/shelf_web_socket-0.2.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="sky_engine">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/bin/cache/pkg/sky_engine/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="source_map_stack_trace">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/source_map_stack_trace-2.1.0-nullsafety.4/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="source_maps">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/source_maps-0.10.10-nullsafety.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="source_span">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.8.1/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.8.0-nullsafety.4/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="stack_trace">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0-nullsafety.6/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="stream_channel">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0-nullsafety.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="string_scanner">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.0/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.0-nullsafety.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="sync_http">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/sync_http-0.3.0/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/sync_http-0.2.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="term_glyph">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.0/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.0-nullsafety.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="test">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/test-1.16.0-nullsafety.9/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="test_api">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.2.19/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.2.19-nullsafety.6/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="test_core">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/test_core-0.3.12-nullsafety.9/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="typed_data">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0-nullsafety.5/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="url_launcher">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.0-nullsafety.6/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="url_launcher_linux">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-0.1.0-nullsafety.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="url_launcher_macos">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.1.0-nullsafety.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="url_launcher_platform_interface">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_platform_interface-2.0.0-nullsafety.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="url_launcher_windows">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-0.1.0-nullsafety.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="uuid">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/uuid-3.0.0-nullsafety.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="vector_math">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.0/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.0-nullsafety.5/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="vm_service">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/vm_service-6.0.1-nullsafety.1/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/vm_service-5.5.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="watcher">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/watcher-0.9.7+15/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="web_socket_channel">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/web_socket_channel-1.2.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="webdriver">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/webdriver-3.0.0/lib" />
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/webdriver-2.1.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="webkit_inspection_protocol">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/webkit_inspection_protocol-0.7.4/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="win32">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/win32-2.0.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="xdg_directories">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/xdg_directories-0.2.0-nullsafety.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="yaml">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/yaml-2.2.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
</option>
|
||||
</properties>
|
||||
<CLASSES>
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/_fe_analyzer_shared-12.0.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.40.6/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/archive-2.0.13/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.0.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/args-1.6.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.5.0-nullsafety.3/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.5.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0-nullsafety.3/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.1.0-nullsafety.5/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.1.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/charcode-1.2.0-nullsafety.3/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/charcode-1.2.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/cli_util-0.2.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/clock-1.1.0-nullsafety.3/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/clock-1.1.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0-nullsafety.5/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/convert-2.1.1/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/coverage-0.14.2/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/crypto-2.1.5/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/crypto-3.0.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-1.0.2/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/device_info-2.0.0-nullsafety.2/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/device_info_platform_interface-2.0.0-nullsafety.2/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.2.0-nullsafety.3/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.2.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-1.0.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/file-6.0.0-nullsafety.4/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/file-6.1.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.5.2/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/glob-1.2.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/http_multi_server-2.2.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/http_parser-3.1.4/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/intl-0.17.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/io-0.3.4/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.3-nullsafety.3/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/json_rpc_2-2.2.2/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/logging-0.11.4/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.10-nullsafety.3/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.10/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.3.0-nullsafety.6/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.3.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/mime-0.9.7/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/mime-1.0.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/mockito-4.1.1/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/node_interop-1.2.1/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/node_io-1.1.1/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/node_preamble-1.4.13/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/package_config-1.9.3/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.8.0-nullsafety.3/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.8.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.0-nullsafety/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.2.0-nullsafety/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.5-nullsafety/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_platform_interface-2.0.0-nullsafety/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.1.0-nullsafety.3/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/pedantic-1.10.0-nullsafety.3/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/pedantic-1.10.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler_platform_interface-2.0.2/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/platform-3.0.0-nullsafety.4/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/platform-3.0.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/plugin_platform_interface-1.1.0-nullsafety.1/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/pool-1.5.0-nullsafety.3/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/process-4.0.0-nullsafety.4/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/process-4.1.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/pub_semver-1.4.4/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/shelf-0.7.5/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/shelf_packages_handler-2.0.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/shelf_static-0.2.9+1/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/shelf_web_socket-0.2.3/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/source_map_stack_trace-2.1.0-nullsafety.4/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/source_maps-0.10.10-nullsafety.3/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.8.0-nullsafety.4/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.8.1/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0-nullsafety.6/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0-nullsafety.3/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.0-nullsafety.3/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/sync_http-0.2.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/sync_http-0.3.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.0-nullsafety.3/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/test-1.16.0-nullsafety.9/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.2.19-nullsafety.6/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.2.19/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/test_core-0.3.12-nullsafety.9/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0-nullsafety.5/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.0-nullsafety.6/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-0.1.0-nullsafety.3/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.1.0-nullsafety.2/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_platform_interface-2.0.0-nullsafety.1/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-0.1.0-nullsafety.2/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/uuid-3.0.0-nullsafety.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.0-nullsafety.5/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/vm_service-5.5.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/vm_service-6.0.1-nullsafety.1/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/watcher-0.9.7+15/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/web_socket_channel-1.2.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/webdriver-2.1.2/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/webdriver-3.0.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/webkit_inspection_protocol-0.7.4/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/win32-2.0.0/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/xdg_directories-0.2.0-nullsafety.1/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/yaml-2.2.1/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/bin/cache/pkg/sky_engine/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/packages/flutter/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/packages/flutter_driver/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/packages/flutter_test/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/packages/fuchsia_remote_debug_protocol/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/packages/integration_test/lib" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
5
.idea/libraries/Flutter_Plugins.xml
generated
5
.idea/libraries/Flutter_Plugins.xml
generated
@ -1,6 +1,9 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Flutter Plugins">
|
||||
<CLASSES />
|
||||
<CLASSES>
|
||||
<root url="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/device_info-2.0.0-nullsafety.2" />
|
||||
<root url="file://$PROJECT_DIR$" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
|
@ -1 +1 @@
|
||||
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/device_info-2.0.0-nullsafety.2/","dependencies":[]},{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.5.2/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":["device_info"]},{"name":"integration_test","path":"/Users/lorenzopichilli/flutter/packages/integration_test/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.0-nullsafety/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/","dependencies":[]},{"name":"url_launcher","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.0-nullsafety.6/","dependencies":[]}],"android":[{"name":"device_info","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/device_info-2.0.0-nullsafety.2/","dependencies":[]},{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.5.2/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":["device_info"]},{"name":"integration_test","path":"/Users/lorenzopichilli/flutter/packages/integration_test/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.0-nullsafety/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/","dependencies":[]},{"name":"url_launcher","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.0-nullsafety.6/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.5-nullsafety/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.1.0-nullsafety.2/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.2.0-nullsafety/","dependencies":[]},{"name":"url_launcher_linux","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-0.1.0-nullsafety.3/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.1.0-nullsafety.3/","dependencies":[]},{"name":"url_launcher_windows","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-0.1.0-nullsafety.2/","dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"device_info","dependencies":[]},{"name":"flutter_downloader","dependencies":[]},{"name":"flutter_inappwebview","dependencies":["device_info"]},{"name":"integration_test","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_linux","url_launcher_macos","url_launcher_windows"]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2021-02-22 23:35:30.325662","version":"1.27.0-5.0.pre.90"}
|
||||
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/device_info-2.0.0-nullsafety.2/","dependencies":[]},{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.5.2/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":["device_info"]},{"name":"integration_test","path":"/Users/lorenzopichilli/flutter/packages/integration_test/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.0-nullsafety/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/","dependencies":[]},{"name":"url_launcher","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.0-nullsafety.6/","dependencies":[]}],"android":[{"name":"device_info","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/device_info-2.0.0-nullsafety.2/","dependencies":[]},{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.5.2/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":["device_info"]},{"name":"integration_test","path":"/Users/lorenzopichilli/flutter/packages/integration_test/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.0-nullsafety/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/","dependencies":[]},{"name":"url_launcher","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.0-nullsafety.6/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.5-nullsafety/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.1.0-nullsafety.2/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.2.0-nullsafety/","dependencies":[]},{"name":"url_launcher_linux","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-0.1.0-nullsafety.3/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.1.0-nullsafety.3/","dependencies":[]},{"name":"url_launcher_windows","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-0.1.0-nullsafety.2/","dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"device_info","dependencies":[]},{"name":"flutter_downloader","dependencies":[]},{"name":"flutter_inappwebview","dependencies":["device_info"]},{"name":"integration_test","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_linux","url_launcher_macos","url_launcher_windows"]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2021-02-22 23:52:14.900647","version":"1.27.0-5.0.pre.90"}
|
@ -2,12 +2,12 @@
|
||||
# This is a generated file; do not edit or check into version control.
|
||||
export "FLUTTER_ROOT=/Users/lorenzopichilli/flutter"
|
||||
export "FLUTTER_APPLICATION_PATH=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example"
|
||||
export "FLUTTER_TARGET=integration_test/webview_flutter_test.dart"
|
||||
export "FLUTTER_TARGET=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example/lib/main.dart"
|
||||
export "FLUTTER_BUILD_DIR=build"
|
||||
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
|
||||
export "FLUTTER_BUILD_NAME=1.0.0"
|
||||
export "FLUTTER_BUILD_NUMBER=1"
|
||||
export "DART_DEFINES=RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ=="
|
||||
export "DART_DEFINES=Zmx1dHRlci5pbnNwZWN0b3Iuc3RydWN0dXJlZEVycm9ycz10cnVl,RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ=="
|
||||
export "DART_OBFUSCATION=false"
|
||||
export "TRACK_WIDGET_CREATION=true"
|
||||
export "TREE_SHAKE_ICONS=false"
|
||||
|
@ -80,6 +80,5 @@
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Dart SDK" level="project" />
|
||||
<orderEntry type="library" name="Flutter Plugins" level="project" />
|
||||
<orderEntry type="library" name="Dart Packages" level="project" />
|
||||
</component>
|
||||
</module>
|
@ -21,4 +21,4 @@
|
||||
|
||||
library flutter_inappwebview;
|
||||
|
||||
export 'src/main.dart';
|
||||
export 'src/main.dart';
|
||||
|
@ -1,3 +1,3 @@
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
final UUID_GENERATOR = Uuid();
|
||||
final UUID_GENERATOR = Uuid();
|
||||
|
@ -27,17 +27,21 @@ class AndroidServiceWorkerController {
|
||||
}
|
||||
|
||||
static Future<dynamic> _handleMethod(MethodCall call) async {
|
||||
AndroidServiceWorkerController controller = AndroidServiceWorkerController.instance();
|
||||
AndroidServiceWorkerClient? serviceWorkerClient = controller.serviceWorkerClient;
|
||||
AndroidServiceWorkerController controller =
|
||||
AndroidServiceWorkerController.instance();
|
||||
AndroidServiceWorkerClient? serviceWorkerClient =
|
||||
controller.serviceWorkerClient;
|
||||
|
||||
switch (call.method) {
|
||||
case "shouldInterceptRequest":
|
||||
if (serviceWorkerClient != null && serviceWorkerClient.shouldInterceptRequest != null) {
|
||||
Map<String, dynamic> arguments = call.arguments.cast<String, dynamic>();
|
||||
if (serviceWorkerClient != null &&
|
||||
serviceWorkerClient.shouldInterceptRequest != null) {
|
||||
Map<String, dynamic> arguments =
|
||||
call.arguments.cast<String, dynamic>();
|
||||
WebResourceRequest request = WebResourceRequest.fromMap(arguments)!;
|
||||
|
||||
return (await serviceWorkerClient.shouldInterceptRequest!(request))
|
||||
?.toMap();
|
||||
?.toMap();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -88,7 +92,8 @@ class AndroidServiceWorkerController {
|
||||
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#getCacheMode()
|
||||
static Future<AndroidCacheMode?> getCacheMode() async {
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
return AndroidCacheMode.fromValue(await _channel.invokeMethod('getCacheMode', args));
|
||||
return AndroidCacheMode.fromValue(
|
||||
await _channel.invokeMethod('getCacheMode', args));
|
||||
}
|
||||
|
||||
///Enables or disables content URL access from Service Workers.
|
||||
@ -146,7 +151,6 @@ class AndroidServiceWorkerController {
|
||||
///
|
||||
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerClientCompat
|
||||
class AndroidServiceWorkerClient {
|
||||
|
||||
///Notify the host application of a resource request and allow the application to return the data.
|
||||
///If the return value is `null`, the Service Worker will continue to load the resource as usual.
|
||||
///Otherwise, the return response and data will be used.
|
||||
@ -158,9 +162,7 @@ class AndroidServiceWorkerClient {
|
||||
///
|
||||
///**NOTE**: available on Android 24+.
|
||||
final Future<WebResourceResponse?> Function(WebResourceRequest request)?
|
||||
shouldInterceptRequest;
|
||||
shouldInterceptRequest;
|
||||
|
||||
AndroidServiceWorkerClient({
|
||||
this.shouldInterceptRequest
|
||||
});
|
||||
}
|
||||
AndroidServiceWorkerClient({this.shouldInterceptRequest});
|
||||
}
|
||||
|
@ -59,8 +59,8 @@ class AndroidWebViewFeature {
|
||||
static AndroidWebViewFeature? fromValue(String? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return AndroidWebViewFeature.values.firstWhere(
|
||||
(element) => element.toValue() == value);
|
||||
return AndroidWebViewFeature.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
@ -74,127 +74,174 @@ class AndroidWebViewFeature {
|
||||
String toString() => _value;
|
||||
|
||||
///
|
||||
static const CREATE_WEB_MESSAGE_CHANNEL = const AndroidWebViewFeature._internal("CREATE_WEB_MESSAGE_CHANNEL");
|
||||
static const 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");
|
||||
static const 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_STRATEGY = const AndroidWebViewFeature._internal("FORCE_DARK_STRATEGY");
|
||||
static const FORCE_DARK_STRATEGY =
|
||||
const AndroidWebViewFeature._internal("FORCE_DARK_STRATEGY");
|
||||
|
||||
///
|
||||
static const GET_WEB_CHROME_CLIENT = const AndroidWebViewFeature._internal("GET_WEB_CHROME_CLIENT");
|
||||
static const GET_WEB_CHROME_CLIENT =
|
||||
const AndroidWebViewFeature._internal("GET_WEB_CHROME_CLIENT");
|
||||
|
||||
///
|
||||
static const GET_WEB_VIEW_CLIENT = const AndroidWebViewFeature._internal("GET_WEB_VIEW_CLIENT");
|
||||
static const GET_WEB_VIEW_CLIENT =
|
||||
const AndroidWebViewFeature._internal("GET_WEB_VIEW_CLIENT");
|
||||
|
||||
///
|
||||
static const GET_WEB_VIEW_RENDERER = const AndroidWebViewFeature._internal("GET_WEB_VIEW_RENDERER");
|
||||
static const GET_WEB_VIEW_RENDERER =
|
||||
const AndroidWebViewFeature._internal("GET_WEB_VIEW_RENDERER");
|
||||
|
||||
///
|
||||
static const MULTI_PROCESS = const AndroidWebViewFeature._internal("MULTI_PROCESS");
|
||||
static const MULTI_PROCESS =
|
||||
const AndroidWebViewFeature._internal("MULTI_PROCESS");
|
||||
|
||||
///
|
||||
static const OFF_SCREEN_PRERASTER = const AndroidWebViewFeature._internal("OFF_SCREEN_PRERASTER");
|
||||
static const OFF_SCREEN_PRERASTER =
|
||||
const AndroidWebViewFeature._internal("OFF_SCREEN_PRERASTER");
|
||||
|
||||
///
|
||||
static const POST_WEB_MESSAGE = const AndroidWebViewFeature._internal("POST_WEB_MESSAGE");
|
||||
static const POST_WEB_MESSAGE =
|
||||
const AndroidWebViewFeature._internal("POST_WEB_MESSAGE");
|
||||
|
||||
///
|
||||
static const PROXY_OVERRIDE = const AndroidWebViewFeature._internal("PROXY_OVERRIDE");
|
||||
static const PROXY_OVERRIDE =
|
||||
const AndroidWebViewFeature._internal("PROXY_OVERRIDE");
|
||||
|
||||
///
|
||||
static const RECEIVE_HTTP_ERROR = const AndroidWebViewFeature._internal("RECEIVE_HTTP_ERROR");
|
||||
static const RECEIVE_HTTP_ERROR =
|
||||
const AndroidWebViewFeature._internal("RECEIVE_HTTP_ERROR");
|
||||
|
||||
///
|
||||
static const RECEIVE_WEB_RESOURCE_ERROR = const AndroidWebViewFeature._internal("RECEIVE_WEB_RESOURCE_ERROR");
|
||||
static const RECEIVE_WEB_RESOURCE_ERROR =
|
||||
const AndroidWebViewFeature._internal("RECEIVE_WEB_RESOURCE_ERROR");
|
||||
|
||||
///
|
||||
static const SAFE_BROWSING_ALLOWLIST = const AndroidWebViewFeature._internal("SAFE_BROWSING_ALLOWLIST");
|
||||
static const SAFE_BROWSING_ALLOWLIST =
|
||||
const AndroidWebViewFeature._internal("SAFE_BROWSING_ALLOWLIST");
|
||||
|
||||
///
|
||||
static const SAFE_BROWSING_ENABLE = const AndroidWebViewFeature._internal("SAFE_BROWSING_ENABLE");
|
||||
static const SAFE_BROWSING_ENABLE =
|
||||
const AndroidWebViewFeature._internal("SAFE_BROWSING_ENABLE");
|
||||
|
||||
///
|
||||
static const SAFE_BROWSING_HIT = const AndroidWebViewFeature._internal("SAFE_BROWSING_HIT");
|
||||
static const SAFE_BROWSING_HIT =
|
||||
const AndroidWebViewFeature._internal("SAFE_BROWSING_HIT");
|
||||
|
||||
///
|
||||
static const SAFE_BROWSING_PRIVACY_POLICY_URL = const AndroidWebViewFeature._internal("SAFE_BROWSING_PRIVACY_POLICY_URL");
|
||||
static const SAFE_BROWSING_PRIVACY_POLICY_URL =
|
||||
const AndroidWebViewFeature._internal("SAFE_BROWSING_PRIVACY_POLICY_URL");
|
||||
|
||||
///
|
||||
static const SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY = const AndroidWebViewFeature._internal("SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY");
|
||||
static const SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY =
|
||||
const AndroidWebViewFeature._internal(
|
||||
"SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY");
|
||||
|
||||
///
|
||||
static const SAFE_BROWSING_RESPONSE_PROCEED = const AndroidWebViewFeature._internal("SAFE_BROWSING_RESPONSE_PROCEED");
|
||||
static const SAFE_BROWSING_RESPONSE_PROCEED =
|
||||
const AndroidWebViewFeature._internal("SAFE_BROWSING_RESPONSE_PROCEED");
|
||||
|
||||
///
|
||||
static const SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL = const AndroidWebViewFeature._internal("SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL");
|
||||
static const SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL =
|
||||
const AndroidWebViewFeature._internal(
|
||||
"SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL");
|
||||
|
||||
///
|
||||
static const SAFE_BROWSING_WHITELIST = const AndroidWebViewFeature._internal("SAFE_BROWSING_WHITELIST");
|
||||
static const SAFE_BROWSING_WHITELIST =
|
||||
const AndroidWebViewFeature._internal("SAFE_BROWSING_WHITELIST");
|
||||
|
||||
///
|
||||
static const SERVICE_WORKER_BASIC_USAGE = const AndroidWebViewFeature._internal("SERVICE_WORKER_BASIC_USAGE");
|
||||
static const SERVICE_WORKER_BASIC_USAGE =
|
||||
const AndroidWebViewFeature._internal("SERVICE_WORKER_BASIC_USAGE");
|
||||
|
||||
///
|
||||
static const SERVICE_WORKER_BLOCK_NETWORK_LOADS = const AndroidWebViewFeature._internal("SERVICE_WORKER_BLOCK_NETWORK_LOADS");
|
||||
static const SERVICE_WORKER_BLOCK_NETWORK_LOADS =
|
||||
const AndroidWebViewFeature._internal(
|
||||
"SERVICE_WORKER_BLOCK_NETWORK_LOADS");
|
||||
|
||||
///
|
||||
static const SERVICE_WORKER_CACHE_MODE = const AndroidWebViewFeature._internal("SERVICE_WORKER_CACHE_MODE");
|
||||
static const SERVICE_WORKER_CACHE_MODE =
|
||||
const AndroidWebViewFeature._internal("SERVICE_WORKER_CACHE_MODE");
|
||||
|
||||
///
|
||||
static const SERVICE_WORKER_CONTENT_ACCESS = const AndroidWebViewFeature._internal("SERVICE_WORKER_CONTENT_ACCESS");
|
||||
static const SERVICE_WORKER_CONTENT_ACCESS =
|
||||
const AndroidWebViewFeature._internal("SERVICE_WORKER_CONTENT_ACCESS");
|
||||
|
||||
///
|
||||
static const SERVICE_WORKER_FILE_ACCESS = const AndroidWebViewFeature._internal("SERVICE_WORKER_FILE_ACCESS");
|
||||
static const SERVICE_WORKER_FILE_ACCESS =
|
||||
const AndroidWebViewFeature._internal("SERVICE_WORKER_FILE_ACCESS");
|
||||
|
||||
///
|
||||
static const SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST = const AndroidWebViewFeature._internal("SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST");
|
||||
static const SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST =
|
||||
const AndroidWebViewFeature._internal(
|
||||
"SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST");
|
||||
|
||||
///
|
||||
static const SHOULD_OVERRIDE_WITH_REDIRECTS = const AndroidWebViewFeature._internal("SHOULD_OVERRIDE_WITH_REDIRECTS");
|
||||
static const SHOULD_OVERRIDE_WITH_REDIRECTS =
|
||||
const AndroidWebViewFeature._internal("SHOULD_OVERRIDE_WITH_REDIRECTS");
|
||||
|
||||
///
|
||||
static const START_SAFE_BROWSING = const AndroidWebViewFeature._internal("START_SAFE_BROWSING");
|
||||
static const START_SAFE_BROWSING =
|
||||
const AndroidWebViewFeature._internal("START_SAFE_BROWSING");
|
||||
|
||||
///
|
||||
static const TRACING_CONTROLLER_BASIC_USAGE = const AndroidWebViewFeature._internal("TRACING_CONTROLLER_BASIC_USAGE");
|
||||
static const TRACING_CONTROLLER_BASIC_USAGE =
|
||||
const AndroidWebViewFeature._internal("TRACING_CONTROLLER_BASIC_USAGE");
|
||||
|
||||
///
|
||||
static const VISUAL_STATE_CALLBACK = const AndroidWebViewFeature._internal("VISUAL_STATE_CALLBACK");
|
||||
static const VISUAL_STATE_CALLBACK =
|
||||
const AndroidWebViewFeature._internal("VISUAL_STATE_CALLBACK");
|
||||
|
||||
///
|
||||
static const WEB_MESSAGE_CALLBACK_ON_MESSAGE = const AndroidWebViewFeature._internal("WEB_MESSAGE_CALLBACK_ON_MESSAGE");
|
||||
static const WEB_MESSAGE_CALLBACK_ON_MESSAGE =
|
||||
const AndroidWebViewFeature._internal("WEB_MESSAGE_CALLBACK_ON_MESSAGE");
|
||||
|
||||
///
|
||||
static const WEB_MESSAGE_LISTENER = const AndroidWebViewFeature._internal("WEB_MESSAGE_LISTENER");
|
||||
static const WEB_MESSAGE_LISTENER =
|
||||
const AndroidWebViewFeature._internal("WEB_MESSAGE_LISTENER");
|
||||
|
||||
///
|
||||
static const WEB_MESSAGE_PORT_CLOSE = const AndroidWebViewFeature._internal("WEB_MESSAGE_PORT_CLOSE");
|
||||
static const 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");
|
||||
static const WEB_MESSAGE_PORT_POST_MESSAGE =
|
||||
const AndroidWebViewFeature._internal("WEB_MESSAGE_PORT_POST_MESSAGE");
|
||||
|
||||
///
|
||||
static const WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK = const AndroidWebViewFeature._internal("WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK");
|
||||
static const WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK =
|
||||
const AndroidWebViewFeature._internal(
|
||||
"WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK");
|
||||
|
||||
///
|
||||
static const WEB_RESOURCE_ERROR_GET_CODE = const AndroidWebViewFeature._internal("WEB_RESOURCE_ERROR_GET_CODE");
|
||||
static const WEB_RESOURCE_ERROR_GET_CODE =
|
||||
const AndroidWebViewFeature._internal("WEB_RESOURCE_ERROR_GET_CODE");
|
||||
|
||||
///
|
||||
static const WEB_RESOURCE_ERROR_GET_DESCRIPTION = const AndroidWebViewFeature._internal("WEB_RESOURCE_ERROR_GET_DESCRIPTION");
|
||||
static const WEB_RESOURCE_ERROR_GET_DESCRIPTION =
|
||||
const AndroidWebViewFeature._internal(
|
||||
"WEB_RESOURCE_ERROR_GET_DESCRIPTION");
|
||||
|
||||
///
|
||||
static const WEB_RESOURCE_REQUEST_IS_REDIRECT = const AndroidWebViewFeature._internal("WEB_RESOURCE_REQUEST_IS_REDIRECT");
|
||||
static const WEB_RESOURCE_REQUEST_IS_REDIRECT =
|
||||
const AndroidWebViewFeature._internal("WEB_RESOURCE_REQUEST_IS_REDIRECT");
|
||||
|
||||
///
|
||||
static const WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE = const AndroidWebViewFeature._internal("WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE");
|
||||
static const WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE =
|
||||
const AndroidWebViewFeature._internal(
|
||||
"WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE");
|
||||
|
||||
///
|
||||
static const WEB_VIEW_RENDERER_TERMINATE = const AndroidWebViewFeature._internal("WEB_VIEW_RENDERER_TERMINATE");
|
||||
static const WEB_VIEW_RENDERER_TERMINATE =
|
||||
const AndroidWebViewFeature._internal("WEB_VIEW_RENDERER_TERMINATE");
|
||||
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@ -211,4 +258,4 @@ class AndroidWebViewFeature {
|
||||
args.putIfAbsent("feature", () => feature.toValue());
|
||||
return await _channel.invokeMethod('isFeatureSupported', args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -62,7 +62,8 @@ class AndroidChromeCustomTabsOptions
|
||||
new AndroidChromeCustomTabsOptions();
|
||||
options.addDefaultShareMenuItem = map["addDefaultShareMenuItem"];
|
||||
options.showTitle = map["showTitle"];
|
||||
options.toolbarBackgroundColor = UtilColor.fromHex(map["toolbarBackgroundColor"]);
|
||||
options.toolbarBackgroundColor =
|
||||
UtilColor.fromHex(map["toolbarBackgroundColor"]);
|
||||
options.enableUrlBarHiding = map["enableUrlBarHiding"];
|
||||
options.instantAppsEnabled = map["instantAppsEnabled"];
|
||||
options.packageName = map["packageName"];
|
||||
@ -84,4 +85,4 @@ class AndroidChromeCustomTabsOptions
|
||||
AndroidChromeCustomTabsOptions copy() {
|
||||
return AndroidChromeCustomTabsOptions.fromMap(this.toMap());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -83,8 +83,7 @@ class ChromeSafariBrowser {
|
||||
///
|
||||
///[options]: Options for the [ChromeSafariBrowser].
|
||||
Future<void> open(
|
||||
{required Uri url,
|
||||
ChromeSafariBrowserClassOptions? options}) async {
|
||||
{required Uri url, ChromeSafariBrowserClassOptions? options}) async {
|
||||
assert(url.toString().isNotEmpty);
|
||||
this.throwIsAlreadyOpened(message: 'Cannot open $url!');
|
||||
|
||||
|
@ -43,7 +43,8 @@ class ChromeSafariBrowserClassOptions {
|
||||
Map<String, dynamic> options = {};
|
||||
if (defaultTargetPlatform == TargetPlatform.android)
|
||||
options.addAll(this.android?.toMap() ?? {});
|
||||
else if (defaultTargetPlatform == TargetPlatform.iOS) options.addAll(this.ios?.toMap() ?? {});
|
||||
else if (defaultTargetPlatform == TargetPlatform.iOS)
|
||||
options.addAll(this.ios?.toMap() ?? {});
|
||||
|
||||
return options;
|
||||
}
|
||||
@ -56,4 +57,4 @@ class ChromeSafariBrowserClassOptions {
|
||||
String toString() {
|
||||
return toMap().toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
export 'safari_options.dart';
|
||||
export 'safari_options.dart';
|
||||
|
@ -65,8 +65,10 @@ class IOSSafariOptions implements ChromeSafariBrowserOptions, IosOptions {
|
||||
options.barCollapsingEnabled = map["barCollapsingEnabled"];
|
||||
options.dismissButtonStyle =
|
||||
IOSSafariDismissButtonStyle.fromValue(map["dismissButtonStyle"])!;
|
||||
options.preferredBarTintColor = UtilColor.fromHex(map["preferredBarTintColor"]);
|
||||
options.preferredControlTintColor = UtilColor.fromHex(map["preferredControlTintColor"]);
|
||||
options.preferredBarTintColor =
|
||||
UtilColor.fromHex(map["preferredBarTintColor"]);
|
||||
options.preferredControlTintColor =
|
||||
UtilColor.fromHex(map["preferredControlTintColor"]);
|
||||
options.presentationStyle =
|
||||
IOSUIModalPresentationStyle.fromValue(map["presentationStyle"])!;
|
||||
options.transitionStyle =
|
||||
|
@ -1,4 +1,4 @@
|
||||
export 'chrome_safari_browser.dart';
|
||||
export 'chrome_safari_browser_options.dart';
|
||||
export 'android/main.dart';
|
||||
export 'ios/main.dart';
|
||||
export 'ios/main.dart';
|
||||
|
@ -65,10 +65,7 @@ class ContextMenuItem {
|
||||
Function()? action;
|
||||
|
||||
ContextMenuItem(
|
||||
{this.androidId,
|
||||
this.iosId,
|
||||
required this.title,
|
||||
this.action});
|
||||
{this.androidId, this.iosId, required this.title, this.action});
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {"androidId": androidId, "iosId": iosId, "title": title};
|
||||
|
@ -76,9 +76,17 @@ class CookieManager {
|
||||
IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
|
||||
var version = double.tryParse(iosInfo.systemVersion);
|
||||
if (version != null && version < 11.0) {
|
||||
await _setCookieWithJavaScript(url: url, name: name, value: value, domain: domain,
|
||||
path: path, expiresDate: expiresDate, maxAge: maxAge, isSecure: isSecure,
|
||||
sameSite: sameSite, webViewController: iosBelow11WebViewController);
|
||||
await _setCookieWithJavaScript(
|
||||
url: url,
|
||||
name: name,
|
||||
value: value,
|
||||
domain: domain,
|
||||
path: path,
|
||||
expiresDate: expiresDate,
|
||||
maxAge: maxAge,
|
||||
isSecure: isSecure,
|
||||
sameSite: sameSite,
|
||||
webViewController: iosBelow11WebViewController);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -100,35 +108,32 @@ class CookieManager {
|
||||
|
||||
Future<void> _setCookieWithJavaScript(
|
||||
{required Uri url,
|
||||
required String name,
|
||||
required String value,
|
||||
required String domain,
|
||||
String path = "/",
|
||||
int? expiresDate,
|
||||
int? maxAge,
|
||||
bool? isSecure,
|
||||
HTTPCookieSameSitePolicy? sameSite,
|
||||
InAppWebViewController? webViewController}) async {
|
||||
var cookieValue = name + "=" + value + "; Domain=" + domain + "; Path=" + path;
|
||||
required String name,
|
||||
required String value,
|
||||
required String domain,
|
||||
String path = "/",
|
||||
int? expiresDate,
|
||||
int? maxAge,
|
||||
bool? isSecure,
|
||||
HTTPCookieSameSitePolicy? sameSite,
|
||||
InAppWebViewController? webViewController}) async {
|
||||
var cookieValue =
|
||||
name + "=" + value + "; Domain=" + domain + "; Path=" + path;
|
||||
|
||||
if (expiresDate != null)
|
||||
cookieValue += "; Expires=" + _getCookieExpirationDate(expiresDate);
|
||||
|
||||
if (maxAge != null)
|
||||
cookieValue += "; Max-Age=" + maxAge.toString();
|
||||
if (maxAge != null) cookieValue += "; Max-Age=" + maxAge.toString();
|
||||
|
||||
if (isSecure != null && isSecure)
|
||||
cookieValue += "; Secure";
|
||||
if (isSecure != null && isSecure) cookieValue += "; Secure";
|
||||
|
||||
if (sameSite != null)
|
||||
cookieValue += "; SameSite=" + sameSite.toValue();
|
||||
if (sameSite != null) cookieValue += "; SameSite=" + sameSite.toValue();
|
||||
|
||||
cookieValue += ";";
|
||||
|
||||
if (webViewController != null) {
|
||||
InAppWebViewGroupOptions? options = await webViewController.getOptions();
|
||||
if (options != null &&
|
||||
options.crossPlatform.javaScriptEnabled) {
|
||||
if (options != null && options.crossPlatform.javaScriptEnabled) {
|
||||
await webViewController.evaluateJavascript(
|
||||
source: 'document.cookie="$cookieValue"');
|
||||
return;
|
||||
@ -158,7 +163,9 @@ class CookieManager {
|
||||
///**NOTE for iOS below 11.0**: All the cookies returned this way will have all the properties to `null` except for [Cookie.name] and [Cookie.value].
|
||||
///If [iosBelow11WebViewController] is `null` or JavaScript is disabled for it, it will try to use a [HeadlessInAppWebView]
|
||||
///to get the cookies (session-only cookies and cookies with `isHttpOnly` enabled won't be found!).
|
||||
Future<List<Cookie>> getCookies({required Uri url, InAppWebViewController? iosBelow11WebViewController}) async {
|
||||
Future<List<Cookie>> getCookies(
|
||||
{required Uri url,
|
||||
InAppWebViewController? iosBelow11WebViewController}) async {
|
||||
assert(url.toString().isNotEmpty);
|
||||
|
||||
if (Platform.isIOS) {
|
||||
@ -166,7 +173,8 @@ class CookieManager {
|
||||
IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
|
||||
var version = double.tryParse(iosInfo.systemVersion);
|
||||
if (version != null && version < 11.0) {
|
||||
return await _getCookiesWithJavaScript(url: url, webViewController: iosBelow11WebViewController);
|
||||
return await _getCookiesWithJavaScript(
|
||||
url: url, webViewController: iosBelow11WebViewController);
|
||||
}
|
||||
}
|
||||
|
||||
@ -185,8 +193,7 @@ class CookieManager {
|
||||
expiresDate: cookieMap["expiresDate"],
|
||||
isSessionOnly: cookieMap["isSessionOnly"],
|
||||
domain: cookieMap["domain"],
|
||||
sameSite:
|
||||
HTTPCookieSameSitePolicy.fromValue(cookieMap["sameSite"]),
|
||||
sameSite: HTTPCookieSameSitePolicy.fromValue(cookieMap["sameSite"]),
|
||||
isSecure: cookieMap["isSecure"],
|
||||
isHttpOnly: cookieMap["isHttpOnly"],
|
||||
path: cookieMap["path"]));
|
||||
@ -194,24 +201,26 @@ class CookieManager {
|
||||
return cookies;
|
||||
}
|
||||
|
||||
Future<List<Cookie>> _getCookiesWithJavaScript({required Uri url, InAppWebViewController? webViewController}) async {
|
||||
Future<List<Cookie>> _getCookiesWithJavaScript(
|
||||
{required Uri url, InAppWebViewController? webViewController}) async {
|
||||
assert(url.toString().isNotEmpty);
|
||||
|
||||
List<Cookie> cookies = [];
|
||||
|
||||
if (webViewController != null) {
|
||||
InAppWebViewGroupOptions? options = await webViewController.getOptions();
|
||||
if (options != null &&
|
||||
options.crossPlatform.javaScriptEnabled) {
|
||||
List<String> documentCookies = (await webViewController.evaluateJavascript(source: 'document.cookie') as String)
|
||||
.split(';').map((documentCookie) => documentCookie.trim()).toList();
|
||||
if (options != null && options.crossPlatform.javaScriptEnabled) {
|
||||
List<String> documentCookies = (await webViewController
|
||||
.evaluateJavascript(source: 'document.cookie') as String)
|
||||
.split(';')
|
||||
.map((documentCookie) => documentCookie.trim())
|
||||
.toList();
|
||||
documentCookies.forEach((documentCookie) {
|
||||
List<String> cookie = documentCookie.split('=');
|
||||
cookies.add(Cookie(
|
||||
name: cookie[0],
|
||||
value: cookie[1],
|
||||
)
|
||||
);
|
||||
));
|
||||
});
|
||||
return cookies;
|
||||
}
|
||||
@ -227,15 +236,17 @@ class CookieManager {
|
||||
await headlessWebView.run();
|
||||
await pageLoaded.future;
|
||||
|
||||
List<String> documentCookies = (await headlessWebView.webViewController.evaluateJavascript(source: 'document.cookie') as String)
|
||||
.split(';').map((documentCookie) => documentCookie.trim()).toList();
|
||||
List<String> documentCookies = (await headlessWebView.webViewController
|
||||
.evaluateJavascript(source: 'document.cookie') as String)
|
||||
.split(';')
|
||||
.map((documentCookie) => documentCookie.trim())
|
||||
.toList();
|
||||
documentCookies.forEach((documentCookie) {
|
||||
List<String> cookie = documentCookie.split('=');
|
||||
cookies.add(Cookie(
|
||||
name: cookie[0],
|
||||
value: cookie[1],
|
||||
)
|
||||
);
|
||||
));
|
||||
});
|
||||
await headlessWebView.dispose();
|
||||
return cookies;
|
||||
@ -251,8 +262,9 @@ class CookieManager {
|
||||
///If [iosBelow11WebViewController] is `null` or JavaScript is disabled for it, it will try to use a [HeadlessInAppWebView]
|
||||
///to get the cookie (session-only cookie and cookie with `isHttpOnly` enabled won't be found!).
|
||||
Future<Cookie?> getCookie(
|
||||
{required Uri url, required String name, InAppWebViewController? iosBelow11WebViewController}) async {
|
||||
|
||||
{required Uri url,
|
||||
required String name,
|
||||
InAppWebViewController? iosBelow11WebViewController}) async {
|
||||
assert(url.toString().isNotEmpty);
|
||||
assert(name.isNotEmpty);
|
||||
|
||||
@ -261,8 +273,11 @@ class CookieManager {
|
||||
IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
|
||||
var version = double.tryParse(iosInfo.systemVersion);
|
||||
if (version != null && version < 11.0) {
|
||||
List<Cookie> cookies = await _getCookiesWithJavaScript(url: url, webViewController: iosBelow11WebViewController);
|
||||
return cookies.cast<Cookie?>().firstWhere((cookie) => cookie!.name == name, orElse: () => null);
|
||||
List<Cookie> cookies = await _getCookiesWithJavaScript(
|
||||
url: url, webViewController: iosBelow11WebViewController);
|
||||
return cookies
|
||||
.cast<Cookie?>()
|
||||
.firstWhere((cookie) => cookie!.name == name, orElse: () => null);
|
||||
}
|
||||
}
|
||||
|
||||
@ -315,7 +330,14 @@ class CookieManager {
|
||||
IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
|
||||
var version = double.tryParse(iosInfo.systemVersion);
|
||||
if (version != null && version < 11.0) {
|
||||
await _setCookieWithJavaScript(url: url, name: name, value: "", path: path, domain: domain, maxAge: -1, webViewController: iosBelow11WebViewController);
|
||||
await _setCookieWithJavaScript(
|
||||
url: url,
|
||||
name: name,
|
||||
value: "",
|
||||
path: path,
|
||||
domain: domain,
|
||||
maxAge: -1,
|
||||
webViewController: iosBelow11WebViewController);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -340,8 +362,10 @@ class CookieManager {
|
||||
///**NOTE for iOS below 11.0**: If [iosBelow11WebViewController] is `null` or JavaScript is disabled for it, it will try to use a [HeadlessInAppWebView]
|
||||
///to delete the cookies (session-only cookies and cookies with `isHttpOnly` enabled won't be deleted!).
|
||||
Future<void> deleteCookies(
|
||||
{required Uri url, String domain = "", String path = "/",
|
||||
InAppWebViewController? iosBelow11WebViewController}) async {
|
||||
{required Uri url,
|
||||
String domain = "",
|
||||
String path = "/",
|
||||
InAppWebViewController? iosBelow11WebViewController}) async {
|
||||
if (domain.isEmpty) domain = _getDomainName(url);
|
||||
|
||||
assert(url.toString().isNotEmpty);
|
||||
@ -351,9 +375,17 @@ class CookieManager {
|
||||
IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
|
||||
var version = double.tryParse(iosInfo.systemVersion);
|
||||
if (version != null && version < 11.0) {
|
||||
List<Cookie> cookies = await _getCookiesWithJavaScript(url: url, webViewController: iosBelow11WebViewController);
|
||||
List<Cookie> cookies = await _getCookiesWithJavaScript(
|
||||
url: url, webViewController: iosBelow11WebViewController);
|
||||
for (var i = 0; i < cookies.length; i++) {
|
||||
await _setCookieWithJavaScript(url: url, name: cookies[i].name, value: "", path: path, domain: domain, maxAge: -1, webViewController: iosBelow11WebViewController);
|
||||
await _setCookieWithJavaScript(
|
||||
url: url,
|
||||
name: cookies[i].name,
|
||||
value: "",
|
||||
path: path,
|
||||
domain: domain,
|
||||
maxAge: -1,
|
||||
webViewController: iosBelow11WebViewController);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -383,7 +415,8 @@ class CookieManager {
|
||||
|
||||
String _getCookieExpirationDate(int expiresDate) {
|
||||
var dateTime = DateTime.fromMillisecondsSinceEpoch(expiresDate).toUtc();
|
||||
return DateFormat('EEE, d MMM yyyy hh:mm:ss', "en_US").format(dateTime) + ' GMT';
|
||||
return DateFormat('EEE, d MMM yyyy hh:mm:ss', "en_US").format(dateTime) +
|
||||
' GMT';
|
||||
}
|
||||
}
|
||||
|
||||
@ -411,7 +444,7 @@ class IOSCookieManager {
|
||||
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
List<dynamic> cookieListMap =
|
||||
await CookieManager._channel.invokeMethod('getAllCookies', args);
|
||||
await CookieManager._channel.invokeMethod('getAllCookies', args);
|
||||
cookieListMap = cookieListMap.cast<Map<dynamic, dynamic>>();
|
||||
|
||||
cookieListMap.forEach((cookieMap) {
|
||||
@ -421,12 +454,11 @@ class IOSCookieManager {
|
||||
expiresDate: cookieMap["expiresDate"],
|
||||
isSessionOnly: cookieMap["isSessionOnly"],
|
||||
domain: cookieMap["domain"],
|
||||
sameSite:
|
||||
HTTPCookieSameSitePolicy.fromValue(cookieMap["sameSite"]),
|
||||
sameSite: HTTPCookieSameSitePolicy.fromValue(cookieMap["sameSite"]),
|
||||
isSecure: cookieMap["isSecure"],
|
||||
isHttpOnly: cookieMap["isHttpOnly"],
|
||||
path: cookieMap["path"]));
|
||||
});
|
||||
return cookies;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,8 @@ class HttpAuthCredentialDatabase {
|
||||
List<URLProtectionSpaceHttpAuthCredentials> result = [];
|
||||
|
||||
for (Map<dynamic, dynamic> map in allCredentials) {
|
||||
var element = URLProtectionSpaceHttpAuthCredentials.fromMap(map.cast<String, dynamic>());
|
||||
var element = URLProtectionSpaceHttpAuthCredentials.fromMap(
|
||||
map.cast<String, dynamic>());
|
||||
if (element != null) {
|
||||
result.add(element);
|
||||
}
|
||||
|
@ -50,4 +50,4 @@ class AndroidInAppBrowserOptions implements BrowserOptions, AndroidOptions {
|
||||
AndroidInAppBrowserOptions copy() {
|
||||
return AndroidInAppBrowserOptions.fromMap(this.toMap());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
export 'in_app_browser_options.dart';
|
||||
export 'in_app_browser_options.dart';
|
||||
|
@ -67,8 +67,8 @@ class InAppBrowser {
|
||||
MethodChannel('com.pichillilorenzo/flutter_inappbrowser_$uuid');
|
||||
this._channel.setMethodCallHandler(handleMethod);
|
||||
_isOpened = false;
|
||||
webViewController =
|
||||
new InAppWebViewController.fromInAppBrowser(uuid, this._channel, this, this.initialUserScripts);
|
||||
webViewController = new InAppWebViewController.fromInAppBrowser(
|
||||
uuid, this._channel, this, this.initialUserScripts);
|
||||
}
|
||||
|
||||
Future<dynamic> handleMethod(MethodCall call) async {
|
||||
@ -100,10 +100,12 @@ class InAppBrowser {
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent('uuid', () => uuid);
|
||||
args.putIfAbsent('urlRequest', () => urlRequest.toMap());
|
||||
args.putIfAbsent('options', () => options?.toMap() ?? InAppBrowserClassOptions().toMap());
|
||||
args.putIfAbsent('options',
|
||||
() => options?.toMap() ?? InAppBrowserClassOptions().toMap());
|
||||
args.putIfAbsent('contextMenu', () => contextMenu?.toMap() ?? {});
|
||||
args.putIfAbsent('windowId', () => windowId);
|
||||
args.putIfAbsent('initialUserScripts', () => initialUserScripts?.map((e) => e.toMap()).toList() ?? []);
|
||||
args.putIfAbsent('initialUserScripts',
|
||||
() => initialUserScripts?.map((e) => e.toMap()).toList() ?? []);
|
||||
await _sharedChannel.invokeMethod('openUrlRequest', args);
|
||||
}
|
||||
|
||||
@ -151,10 +153,12 @@ class InAppBrowser {
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent('uuid', () => uuid);
|
||||
args.putIfAbsent('assetFilePath', () => assetFilePath);
|
||||
args.putIfAbsent('options', () => options?.toMap() ?? InAppBrowserClassOptions().toMap());
|
||||
args.putIfAbsent('options',
|
||||
() => options?.toMap() ?? InAppBrowserClassOptions().toMap());
|
||||
args.putIfAbsent('contextMenu', () => contextMenu?.toMap() ?? {});
|
||||
args.putIfAbsent('windowId', () => windowId);
|
||||
args.putIfAbsent('initialUserScripts', () => initialUserScripts?.map((e) => e.toMap()).toList() ?? []);
|
||||
args.putIfAbsent('initialUserScripts',
|
||||
() => initialUserScripts?.map((e) => e.toMap()).toList() ?? []);
|
||||
await _sharedChannel.invokeMethod('openFile', args);
|
||||
}
|
||||
|
||||
@ -175,18 +179,21 @@ class InAppBrowser {
|
||||
Uri? androidHistoryUrl,
|
||||
InAppBrowserClassOptions? options}) async {
|
||||
this.throwIfAlreadyOpened(message: 'Cannot open data!');
|
||||
|
||||
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent('uuid', () => uuid);
|
||||
args.putIfAbsent('options', () => options?.toMap() ?? InAppBrowserClassOptions().toMap());
|
||||
args.putIfAbsent('options',
|
||||
() => options?.toMap() ?? InAppBrowserClassOptions().toMap());
|
||||
args.putIfAbsent('data', () => data);
|
||||
args.putIfAbsent('mimeType', () => mimeType);
|
||||
args.putIfAbsent('encoding', () => encoding);
|
||||
args.putIfAbsent('baseUrl', () => baseUrl?.toString() ?? "about:blank");
|
||||
args.putIfAbsent('historyUrl', () => androidHistoryUrl?.toString() ?? "about:blank");
|
||||
args.putIfAbsent(
|
||||
'historyUrl', () => androidHistoryUrl?.toString() ?? "about:blank");
|
||||
args.putIfAbsent('contextMenu', () => contextMenu?.toMap() ?? {});
|
||||
args.putIfAbsent('windowId', () => windowId);
|
||||
args.putIfAbsent('initialUserScripts', () => initialUserScripts?.map((e) => e.toMap()).toList() ?? []);
|
||||
args.putIfAbsent('initialUserScripts',
|
||||
() => initialUserScripts?.map((e) => e.toMap()).toList() ?? []);
|
||||
await _sharedChannel.invokeMethod('openData', args);
|
||||
}
|
||||
|
||||
@ -360,8 +367,7 @@ class InAppBrowser {
|
||||
///[url] represents the url of the request.
|
||||
///
|
||||
///**Official iOS API**: https://developer.apple.com/documentation/webkit/wkurlschemehandler
|
||||
Future<CustomSchemeResponse?>? onLoadResourceCustomScheme(
|
||||
Uri url) {}
|
||||
Future<CustomSchemeResponse?>? onLoadResourceCustomScheme(Uri url) {}
|
||||
|
||||
///Event fired when the [InAppBrowser] webview requests the host application to create a new window,
|
||||
///for example when trying to open a link with `target="_blank"` or when `window.open()` is called by JavaScript side.
|
||||
@ -518,7 +524,8 @@ class InAppBrowser {
|
||||
///[fetchRequest] represents a resource request.
|
||||
///
|
||||
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewOptions.useShouldInterceptFetchRequest] option to `true`.
|
||||
Future<FetchRequest?>? shouldInterceptFetchRequest(FetchRequest fetchRequest) {}
|
||||
Future<FetchRequest?>? shouldInterceptFetchRequest(
|
||||
FetchRequest fetchRequest) {}
|
||||
|
||||
///Event fired when the host application updates its visited links database.
|
||||
///This event is also fired when the navigation state of the [InAppWebView] changes through the usage of
|
||||
@ -643,8 +650,8 @@ class InAppBrowser {
|
||||
///**Official Android API**:
|
||||
///- https://developer.android.com/reference/android/webkit/WebViewClient#shouldInterceptRequest(android.webkit.WebView,%20android.webkit.WebResourceRequest)
|
||||
///- https://developer.android.com/reference/android/webkit/WebViewClient#shouldInterceptRequest(android.webkit.WebView,%20java.lang.String)
|
||||
Future<WebResourceResponse?>?
|
||||
androidShouldInterceptRequest(WebResourceRequest request) {}
|
||||
Future<WebResourceResponse?>? androidShouldInterceptRequest(
|
||||
WebResourceRequest request) {}
|
||||
|
||||
///Event called when the renderer currently associated with the WebView becomes unresponsive as a result of a long running blocking task such as the execution of JavaScript.
|
||||
///
|
||||
@ -664,8 +671,8 @@ class InAppBrowser {
|
||||
///**NOTE**: available only on Android 29+.
|
||||
///
|
||||
///**Official Android API**: https://developer.android.com/reference/android/webkit/WebViewRenderProcessClient#onRenderProcessUnresponsive(android.webkit.WebView,%20android.webkit.WebViewRenderProcess)
|
||||
Future<WebViewRenderProcessAction?>?
|
||||
androidOnRenderProcessUnresponsive(Uri? url) {}
|
||||
Future<WebViewRenderProcessAction?>? androidOnRenderProcessUnresponsive(
|
||||
Uri? url) {}
|
||||
|
||||
///Event called once when an unresponsive renderer currently associated with the WebView becomes responsive.
|
||||
///
|
||||
@ -678,8 +685,8 @@ class InAppBrowser {
|
||||
///**NOTE**: available only on Android 29+.
|
||||
///
|
||||
///**Official Android API**: https://developer.android.com/reference/android/webkit/WebViewRenderProcessClient#onRenderProcessResponsive(android.webkit.WebView,%20android.webkit.WebViewRenderProcess)
|
||||
Future<WebViewRenderProcessAction?>?
|
||||
androidOnRenderProcessResponsive(Uri? url) {}
|
||||
Future<WebViewRenderProcessAction?>? androidOnRenderProcessResponsive(
|
||||
Uri? url) {}
|
||||
|
||||
///Event fired when the given WebView's render process has exited.
|
||||
///The application's implementation of this callback should only attempt to clean up the WebView.
|
||||
@ -697,8 +704,7 @@ class InAppBrowser {
|
||||
///**NOTE**: available only on Android.
|
||||
///
|
||||
///**Official Android API**: https://developer.android.com/reference/android/webkit/WebViewClient#onFormResubmission(android.webkit.WebView,%20android.os.Message,%20android.os.Message)
|
||||
Future<FormResubmissionAction?>?
|
||||
androidOnFormResubmission(Uri? url) {}
|
||||
Future<FormResubmissionAction?>? androidOnFormResubmission(Uri? url) {}
|
||||
|
||||
///Event fired when the scale applied to the WebView has changed.
|
||||
///
|
||||
@ -777,8 +783,8 @@ class InAppBrowser {
|
||||
///**NOTE**: available only on iOS.
|
||||
///
|
||||
///**Official iOS API**: https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview
|
||||
Future<IOSNavigationResponseAction?>?
|
||||
iosOnNavigationResponse(IOSWKNavigationResponse navigationResponse) {}
|
||||
Future<IOSNavigationResponseAction?>? iosOnNavigationResponse(
|
||||
IOSWKNavigationResponse navigationResponse) {}
|
||||
|
||||
///Called when a web view asks whether to continue with a connection that uses a deprecated version of TLS (v1.0 and v1.1).
|
||||
///
|
||||
@ -787,8 +793,8 @@ class InAppBrowser {
|
||||
///**NOTE**: available only on iOS 14.0+.
|
||||
///
|
||||
///**Official iOS API**: https://developer.apple.com/documentation/webkit/wknavigationdelegate/3601237-webview
|
||||
Future<IOSShouldAllowDeprecatedTLSAction?>?
|
||||
iosShouldAllowDeprecatedTLS(URLAuthenticationChallenge challenge) {}
|
||||
Future<IOSShouldAllowDeprecatedTLSAction?>? iosShouldAllowDeprecatedTLS(
|
||||
URLAuthenticationChallenge challenge) {}
|
||||
|
||||
void throwIfAlreadyOpened({String message = ''}) {
|
||||
if (this.isOpened()) {
|
||||
|
@ -35,7 +35,6 @@ class BrowserOptions {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///Class that represents the options that can be used for an [InAppBrowser] WebView.
|
||||
class InAppBrowserClassOptions {
|
||||
///Cross-platform options.
|
||||
@ -52,9 +51,9 @@ class InAppBrowserClassOptions {
|
||||
|
||||
InAppBrowserClassOptions(
|
||||
{InAppBrowserOptions? crossPlatform,
|
||||
AndroidInAppBrowserOptions? android,
|
||||
IOSInAppBrowserOptions? ios,
|
||||
InAppWebViewGroupOptions? inAppWebViewGroupOptions}) {
|
||||
AndroidInAppBrowserOptions? android,
|
||||
IOSInAppBrowserOptions? ios,
|
||||
InAppWebViewGroupOptions? inAppWebViewGroupOptions}) {
|
||||
this.crossPlatform = crossPlatform ?? InAppBrowserOptions();
|
||||
this.android = android ?? AndroidInAppBrowserOptions();
|
||||
this.ios = ios ?? IOSInAppBrowserOptions();
|
||||
@ -89,7 +88,7 @@ class InAppBrowserClassOptions {
|
||||
|
||||
static InAppBrowserClassOptions fromMap(Map<String, dynamic> options) {
|
||||
InAppBrowserClassOptions inAppBrowserClassOptions =
|
||||
InAppBrowserClassOptions();
|
||||
InAppBrowserClassOptions();
|
||||
|
||||
inAppBrowserClassOptions.crossPlatform =
|
||||
InAppBrowserOptions.fromMap(options);
|
||||
@ -157,7 +156,8 @@ class InAppBrowserOptions
|
||||
InAppBrowserOptions options = InAppBrowserOptions();
|
||||
options.hidden = map["hidden"];
|
||||
options.hideToolbarTop = map["hideToolbarTop"];
|
||||
options.toolbarTopBackgroundColor = UtilColor.fromHex(map["toolbarTopBackgroundColor"]);
|
||||
options.toolbarTopBackgroundColor =
|
||||
UtilColor.fromHex(map["toolbarTopBackgroundColor"]);
|
||||
options.hideUrlBar = map["hideUrlBar"];
|
||||
options.hideProgressBar = map["hideProgressBar"];
|
||||
return options;
|
||||
|
@ -76,8 +76,10 @@ class IOSInAppBrowserOptions implements BrowserOptions, IosOptions {
|
||||
options.toolbarTopTranslucent = map["toolbarTopTranslucent"];
|
||||
options.toolbarTopTintColor = UtilColor.fromHex(map["toolbarTopTintColor"]);
|
||||
options.hideToolbarBottom = map["hideToolbarBottom"];
|
||||
options.toolbarBottomBackgroundColor = UtilColor.fromHex(map["toolbarBottomBackgroundColor"]);
|
||||
options.toolbarBottomTintColor = UtilColor.fromHex(map["toolbarBottomTintColor"]);
|
||||
options.toolbarBottomBackgroundColor =
|
||||
UtilColor.fromHex(map["toolbarBottomBackgroundColor"]);
|
||||
options.toolbarBottomTintColor =
|
||||
UtilColor.fromHex(map["toolbarBottomTintColor"]);
|
||||
options.toolbarBottomTranslucent = map["toolbarBottomTranslucent"];
|
||||
options.closeButtonCaption = map["closeButtonCaption"];
|
||||
options.closeButtonColor = UtilColor.fromHex(map["closeButtonColor"]);
|
||||
|
@ -1 +1 @@
|
||||
export 'in_app_browser_options.dart';
|
||||
export 'in_app_browser_options.dart';
|
||||
|
@ -1,4 +1,4 @@
|
||||
export 'in_app_browser.dart';
|
||||
export 'in_app_browser_options.dart';
|
||||
export 'android/main.dart';
|
||||
export 'ios/main.dart';
|
||||
export 'ios/main.dart';
|
||||
|
@ -1,3 +1,4 @@
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
const IN_APP_WEBVIEW_STATIC_CHANNEL = const MethodChannel('com.pichillilorenzo/flutter_inappwebview_static');
|
||||
const IN_APP_WEBVIEW_STATIC_CHANNEL =
|
||||
const MethodChannel('com.pichillilorenzo/flutter_inappwebview_static');
|
||||
|
@ -9,7 +9,6 @@ import '../../types.dart';
|
||||
|
||||
///Class represents the Android controller that contains only android-specific methods for the WebView.
|
||||
class AndroidInAppWebViewController {
|
||||
|
||||
late MethodChannel _channel;
|
||||
static MethodChannel _staticChannel = IN_APP_WEBVIEW_STATIC_CHANNEL;
|
||||
|
||||
@ -130,8 +129,7 @@ class AndroidInAppWebViewController {
|
||||
///**Official Android API**: https://developer.android.com/reference/android/webkit/WebView#clearClientCertPreferences(java.lang.Runnable)
|
||||
static Future<void> clearClientCertPreferences() async {
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
await _staticChannel
|
||||
.invokeMethod('clearClientCertPreferences', args);
|
||||
await _staticChannel.invokeMethod('clearClientCertPreferences', args);
|
||||
}
|
||||
|
||||
///Returns a URL pointing to the privacy policy for Safe Browsing reporting.
|
||||
@ -141,8 +139,8 @@ class AndroidInAppWebViewController {
|
||||
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/WebViewCompat#getSafeBrowsingPrivacyPolicyUrl()
|
||||
static Future<Uri?> getSafeBrowsingPrivacyPolicyUrl() async {
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
String? url = await _staticChannel
|
||||
.invokeMethod('getSafeBrowsingPrivacyPolicyUrl', args);
|
||||
String? url = await _staticChannel.invokeMethod(
|
||||
'getSafeBrowsingPrivacyPolicyUrl', args);
|
||||
return url != null ? Uri.parse(url) : null;
|
||||
}
|
||||
|
||||
@ -167,8 +165,7 @@ class AndroidInAppWebViewController {
|
||||
{required List<String> hosts}) async {
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent('hosts', () => hosts);
|
||||
return await _staticChannel
|
||||
.invokeMethod('setSafeBrowsingWhitelist', args);
|
||||
return await _staticChannel.invokeMethod('setSafeBrowsingWhitelist', args);
|
||||
}
|
||||
|
||||
///If WebView has already been loaded into the current process this method will return the package that was used to load it.
|
||||
@ -184,9 +181,9 @@ class AndroidInAppWebViewController {
|
||||
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/WebViewCompat#getCurrentWebViewPackage(android.content.Context)
|
||||
static Future<AndroidWebViewPackageInfo?> getCurrentWebViewPackage() async {
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
Map<String, dynamic>? packageInfo = (await _staticChannel
|
||||
.invokeMethod('getCurrentWebViewPackage', args))
|
||||
?.cast<String, dynamic>();
|
||||
Map<String, dynamic>? packageInfo =
|
||||
(await _staticChannel.invokeMethod('getCurrentWebViewPackage', args))
|
||||
?.cast<String, dynamic>();
|
||||
return AndroidWebViewPackageInfo.fromMap(packageInfo);
|
||||
}
|
||||
|
||||
@ -199,11 +196,11 @@ class AndroidInAppWebViewController {
|
||||
///**NOTE**: available only on Android 19+.
|
||||
///
|
||||
///**Official Android API**: https://developer.android.com/reference/android/webkit/WebView#setWebContentsDebuggingEnabled(boolean)
|
||||
static Future<void> setWebContentsDebuggingEnabled(bool debuggingEnabled) async {
|
||||
static Future<void> setWebContentsDebuggingEnabled(
|
||||
bool debuggingEnabled) async {
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent('debuggingEnabled', () => debuggingEnabled);
|
||||
return await _staticChannel
|
||||
.invokeMethod('setWebContentsDebuggingEnabled', args);
|
||||
return await _staticChannel.invokeMethod(
|
||||
'setWebContentsDebuggingEnabled', args);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
export 'in_app_webview_options.dart';
|
||||
export 'in_app_webview_controller.dart';
|
||||
export 'in_app_webview_controller.dart';
|
||||
|
@ -113,13 +113,16 @@ class HeadlessInAppWebView implements WebView {
|
||||
args.putIfAbsent(
|
||||
'params',
|
||||
() => <String, dynamic>{
|
||||
'initialUrlRequest': (this.initialUrlRequest ?? URLRequest(url: Uri.parse("about:blank"))).toMap(),
|
||||
'initialUrlRequest': (this.initialUrlRequest ??
|
||||
URLRequest(url: Uri.parse("about:blank")))
|
||||
.toMap(),
|
||||
'initialFile': this.initialFile,
|
||||
'initialData': this.initialData?.toMap(),
|
||||
'initialOptions': this.initialOptions?.toMap() ?? {},
|
||||
'contextMenu': this.contextMenu?.toMap() ?? {},
|
||||
'windowId': this.windowId,
|
||||
'initialUserScripts': this.initialUserScripts?.map((e) => e.toMap()).toList() ?? [],
|
||||
'initialUserScripts':
|
||||
this.initialUserScripts?.map((e) => e.toMap()).toList() ?? [],
|
||||
});
|
||||
await _sharedChannel.invokeMethod('createHeadlessWebView', args);
|
||||
}
|
||||
@ -151,8 +154,10 @@ class HeadlessInAppWebView implements WebView {
|
||||
List<String> resources)? androidOnPermissionRequest;
|
||||
|
||||
@override
|
||||
final Future<SafeBrowsingResponse?> Function(InAppWebViewController controller,
|
||||
Uri url, SafeBrowsingThreat? threatType)? androidOnSafeBrowsingHit;
|
||||
final Future<SafeBrowsingResponse?> Function(
|
||||
InAppWebViewController controller,
|
||||
Uri url,
|
||||
SafeBrowsingThreat? threatType)? androidOnSafeBrowsingHit;
|
||||
|
||||
@override
|
||||
final InAppWebViewInitialData? initialData;
|
||||
@ -189,14 +194,14 @@ class HeadlessInAppWebView implements WebView {
|
||||
iosOnWebContentProcessDidTerminate;
|
||||
|
||||
@override
|
||||
final Future<IOSNavigationResponseAction?> Function(InAppWebViewController controller,
|
||||
IOSWKNavigationResponse navigationResponse)?
|
||||
iosOnNavigationResponse;
|
||||
final Future<IOSNavigationResponseAction?> Function(
|
||||
InAppWebViewController controller,
|
||||
IOSWKNavigationResponse navigationResponse)? iosOnNavigationResponse;
|
||||
|
||||
@override
|
||||
final Future<IOSShouldAllowDeprecatedTLSAction?> Function(InAppWebViewController controller,
|
||||
URLAuthenticationChallenge challenge)?
|
||||
iosShouldAllowDeprecatedTLS;
|
||||
final Future<IOSShouldAllowDeprecatedTLSAction?> Function(
|
||||
InAppWebViewController controller,
|
||||
URLAuthenticationChallenge challenge)? iosShouldAllowDeprecatedTLS;
|
||||
|
||||
@override
|
||||
final Future<AjaxRequestAction> Function(
|
||||
@ -264,12 +269,10 @@ class HeadlessInAppWebView implements WebView {
|
||||
|
||||
@override
|
||||
final Future<CustomSchemeResponse?> Function(
|
||||
InAppWebViewController controller, Uri url)?
|
||||
onLoadResourceCustomScheme;
|
||||
InAppWebViewController controller, Uri url)? onLoadResourceCustomScheme;
|
||||
|
||||
@override
|
||||
final void Function(InAppWebViewController controller, Uri? url)?
|
||||
onLoadStart;
|
||||
final void Function(InAppWebViewController controller, Uri? url)? onLoadStart;
|
||||
|
||||
@override
|
||||
final void Function(InAppWebViewController controller, Uri? url)? onLoadStop;
|
||||
@ -286,19 +289,17 @@ class HeadlessInAppWebView implements WebView {
|
||||
onProgressChanged;
|
||||
|
||||
@override
|
||||
final Future<ClientCertResponse?> Function(
|
||||
InAppWebViewController controller, URLAuthenticationChallenge challenge)?
|
||||
onReceivedClientCertRequest;
|
||||
final Future<ClientCertResponse?> Function(InAppWebViewController controller,
|
||||
URLAuthenticationChallenge challenge)? onReceivedClientCertRequest;
|
||||
|
||||
@override
|
||||
final Future<HttpAuthResponse?> Function(
|
||||
InAppWebViewController controller, URLAuthenticationChallenge challenge)?
|
||||
onReceivedHttpAuthRequest;
|
||||
final Future<HttpAuthResponse?> Function(InAppWebViewController controller,
|
||||
URLAuthenticationChallenge challenge)? onReceivedHttpAuthRequest;
|
||||
|
||||
@override
|
||||
final Future<ServerTrustAuthResponse?> Function(
|
||||
InAppWebViewController controller, URLAuthenticationChallenge challenge)?
|
||||
onReceivedServerTrustAuthRequest;
|
||||
InAppWebViewController controller,
|
||||
URLAuthenticationChallenge challenge)? onReceivedServerTrustAuthRequest;
|
||||
|
||||
@override
|
||||
final void Function(InAppWebViewController controller, int x, int y)?
|
||||
|
@ -113,8 +113,10 @@ class InAppWebView extends StatefulWidget implements WebView {
|
||||
List<String> resources)? androidOnPermissionRequest;
|
||||
|
||||
@override
|
||||
final Future<SafeBrowsingResponse?> Function(InAppWebViewController controller,
|
||||
Uri url, SafeBrowsingThreat? threatType)? androidOnSafeBrowsingHit;
|
||||
final Future<SafeBrowsingResponse?> Function(
|
||||
InAppWebViewController controller,
|
||||
Uri url,
|
||||
SafeBrowsingThreat? threatType)? androidOnSafeBrowsingHit;
|
||||
|
||||
@override
|
||||
final InAppWebViewInitialData? initialData;
|
||||
@ -151,14 +153,14 @@ class InAppWebView extends StatefulWidget implements WebView {
|
||||
iosOnWebContentProcessDidTerminate;
|
||||
|
||||
@override
|
||||
final Future<IOSNavigationResponseAction?> Function(InAppWebViewController controller,
|
||||
IOSWKNavigationResponse navigationResponse)?
|
||||
iosOnNavigationResponse;
|
||||
final Future<IOSNavigationResponseAction?> Function(
|
||||
InAppWebViewController controller,
|
||||
IOSWKNavigationResponse navigationResponse)? iosOnNavigationResponse;
|
||||
|
||||
@override
|
||||
final Future<IOSShouldAllowDeprecatedTLSAction?> Function(InAppWebViewController controller,
|
||||
URLAuthenticationChallenge challenge)?
|
||||
iosShouldAllowDeprecatedTLS;
|
||||
final Future<IOSShouldAllowDeprecatedTLSAction?> Function(
|
||||
InAppWebViewController controller,
|
||||
URLAuthenticationChallenge challenge)? iosShouldAllowDeprecatedTLS;
|
||||
|
||||
@override
|
||||
final Future<AjaxRequestAction> Function(
|
||||
@ -235,12 +237,10 @@ class InAppWebView extends StatefulWidget implements WebView {
|
||||
|
||||
@override
|
||||
final Future<CustomSchemeResponse?> Function(
|
||||
InAppWebViewController controller, Uri url)?
|
||||
onLoadResourceCustomScheme;
|
||||
InAppWebViewController controller, Uri url)? onLoadResourceCustomScheme;
|
||||
|
||||
@override
|
||||
final void Function(InAppWebViewController controller, Uri? url)?
|
||||
onLoadStart;
|
||||
final void Function(InAppWebViewController controller, Uri? url)? onLoadStart;
|
||||
|
||||
@override
|
||||
final void Function(InAppWebViewController controller, Uri? url)? onLoadStop;
|
||||
@ -257,19 +257,17 @@ class InAppWebView extends StatefulWidget implements WebView {
|
||||
onProgressChanged;
|
||||
|
||||
@override
|
||||
final Future<ClientCertResponse?> Function(
|
||||
InAppWebViewController controller, URLAuthenticationChallenge challenge)?
|
||||
onReceivedClientCertRequest;
|
||||
final Future<ClientCertResponse?> Function(InAppWebViewController controller,
|
||||
URLAuthenticationChallenge challenge)? onReceivedClientCertRequest;
|
||||
|
||||
@override
|
||||
final Future<HttpAuthResponse?> Function(
|
||||
InAppWebViewController controller, URLAuthenticationChallenge challenge)?
|
||||
onReceivedHttpAuthRequest;
|
||||
final Future<HttpAuthResponse?> Function(InAppWebViewController controller,
|
||||
URLAuthenticationChallenge challenge)? onReceivedHttpAuthRequest;
|
||||
|
||||
@override
|
||||
final Future<ServerTrustAuthResponse?> Function(
|
||||
InAppWebViewController controller, URLAuthenticationChallenge challenge)?
|
||||
onReceivedServerTrustAuthRequest;
|
||||
InAppWebViewController controller,
|
||||
URLAuthenticationChallenge challenge)? onReceivedServerTrustAuthRequest;
|
||||
|
||||
@override
|
||||
final void Function(InAppWebViewController controller, int x, int y)?
|
||||
@ -354,12 +352,13 @@ class _InAppWebViewState extends State<InAppWebView> {
|
||||
return PlatformViewLink(
|
||||
viewType: 'com.pichillilorenzo/flutter_inappwebview',
|
||||
surfaceFactory: (
|
||||
BuildContext context,
|
||||
PlatformViewController controller,
|
||||
) {
|
||||
BuildContext context,
|
||||
PlatformViewController controller,
|
||||
) {
|
||||
return AndroidViewSurface(
|
||||
controller: controller as AndroidViewController,
|
||||
gestureRecognizers: widget.gestureRecognizers ?? const <Factory<OneSequenceGestureRecognizer>>{},
|
||||
gestureRecognizers: widget.gestureRecognizers ??
|
||||
const <Factory<OneSequenceGestureRecognizer>>{},
|
||||
hitTestBehavior: PlatformViewHitTestBehavior.opaque,
|
||||
);
|
||||
},
|
||||
@ -369,18 +368,23 @@ class _InAppWebViewState extends State<InAppWebView> {
|
||||
viewType: 'com.pichillilorenzo/flutter_inappwebview',
|
||||
layoutDirection: TextDirection.rtl,
|
||||
creationParams: <String, dynamic>{
|
||||
'initialUrlRequest': (widget.initialUrlRequest ?? URLRequest(url: Uri.parse("about:blank"))).toMap(),
|
||||
'initialUrlRequest': (widget.initialUrlRequest ??
|
||||
URLRequest(url: Uri.parse("about:blank")))
|
||||
.toMap(),
|
||||
'initialFile': widget.initialFile,
|
||||
'initialData': widget.initialData?.toMap(),
|
||||
'initialOptions': widget.initialOptions?.toMap() ?? {},
|
||||
'contextMenu': widget.contextMenu?.toMap() ?? {},
|
||||
'windowId': widget.windowId,
|
||||
'initialUserScripts': widget.initialUserScripts?.map((e) => e.toMap()).toList() ?? [],
|
||||
'initialUserScripts':
|
||||
widget.initialUserScripts?.map((e) => e.toMap()).toList() ??
|
||||
[],
|
||||
},
|
||||
creationParamsCodec: const StandardMessageCodec(),
|
||||
)
|
||||
..addOnPlatformViewCreatedListener(params.onPlatformViewCreated)
|
||||
..addOnPlatformViewCreatedListener((id) => _onPlatformViewCreated(id))
|
||||
..addOnPlatformViewCreatedListener(
|
||||
(id) => _onPlatformViewCreated(id))
|
||||
..create();
|
||||
},
|
||||
);
|
||||
@ -391,13 +395,16 @@ class _InAppWebViewState extends State<InAppWebView> {
|
||||
gestureRecognizers: widget.gestureRecognizers,
|
||||
layoutDirection: TextDirection.rtl,
|
||||
creationParams: <String, dynamic>{
|
||||
'initialUrlRequest': (widget.initialUrlRequest ?? URLRequest(url: Uri.parse("about:blank"))).toMap(),
|
||||
'initialUrlRequest': (widget.initialUrlRequest ??
|
||||
URLRequest(url: Uri.parse("about:blank")))
|
||||
.toMap(),
|
||||
'initialFile': widget.initialFile,
|
||||
'initialData': widget.initialData?.toMap(),
|
||||
'initialOptions': widget.initialOptions?.toMap() ?? {},
|
||||
'contextMenu': widget.contextMenu?.toMap() ?? {},
|
||||
'windowId': widget.windowId,
|
||||
'initialUserScripts': widget.initialUserScripts?.map((e) => e.toMap()).toList() ?? [],
|
||||
'initialUserScripts':
|
||||
widget.initialUserScripts?.map((e) => e.toMap()).toList() ?? [],
|
||||
},
|
||||
creationParamsCodec: const StandardMessageCodec(),
|
||||
);
|
||||
@ -408,13 +415,16 @@ class _InAppWebViewState extends State<InAppWebView> {
|
||||
onPlatformViewCreated: _onPlatformViewCreated,
|
||||
gestureRecognizers: widget.gestureRecognizers,
|
||||
creationParams: <String, dynamic>{
|
||||
'initialUrlRequest': (widget.initialUrlRequest ?? URLRequest(url: Uri.parse("about:blank"))).toMap(),
|
||||
'initialUrlRequest': (widget.initialUrlRequest ??
|
||||
URLRequest(url: Uri.parse("about:blank")))
|
||||
.toMap(),
|
||||
'initialFile': widget.initialFile,
|
||||
'initialData': widget.initialData?.toMap(),
|
||||
'initialOptions': widget.initialOptions?.toMap() ?? {},
|
||||
'contextMenu': widget.contextMenu?.toMap() ?? {},
|
||||
'windowId': widget.windowId,
|
||||
'initialUserScripts': widget.initialUserScripts?.map((e) => e.toMap()).toList() ?? [],
|
||||
'initialUserScripts':
|
||||
widget.initialUserScripts?.map((e) => e.toMap()).toList() ?? [],
|
||||
},
|
||||
creationParamsCodec: const StandardMessageCodec(),
|
||||
);
|
||||
|
@ -77,16 +77,21 @@ class InAppWebViewController {
|
||||
MethodChannel('com.pichillilorenzo/flutter_inappwebview_$id');
|
||||
this._channel.setMethodCallHandler(handleMethod);
|
||||
this._webview = webview;
|
||||
this._userScripts = List<UserScript>.from(webview.initialUserScripts ?? <UserScript>[]);
|
||||
this._userScripts =
|
||||
List<UserScript>.from(webview.initialUserScripts ?? <UserScript>[]);
|
||||
this._init();
|
||||
}
|
||||
|
||||
InAppWebViewController.fromInAppBrowser(
|
||||
String uuid, MethodChannel channel, InAppBrowser inAppBrowser, UnmodifiableListView<UserScript>? initialUserScripts) {
|
||||
String uuid,
|
||||
MethodChannel channel,
|
||||
InAppBrowser inAppBrowser,
|
||||
UnmodifiableListView<UserScript>? initialUserScripts) {
|
||||
this._inAppBrowserUuid = uuid;
|
||||
this._channel = channel;
|
||||
this._inAppBrowser = inAppBrowser;
|
||||
this._userScripts = List<UserScript>.from(initialUserScripts ?? <UserScript>[]);
|
||||
this._userScripts =
|
||||
List<UserScript>.from(initialUserScripts ?? <UserScript>[]);
|
||||
this._init();
|
||||
}
|
||||
|
||||
@ -100,11 +105,14 @@ class InAppWebViewController {
|
||||
Future<dynamic> handleMethod(MethodCall call) async {
|
||||
switch (call.method) {
|
||||
case "onHeadlessWebViewCreated":
|
||||
if (_webview != null && _webview is HeadlessInAppWebView && _webview!.onWebViewCreated != null)
|
||||
if (_webview != null &&
|
||||
_webview is HeadlessInAppWebView &&
|
||||
_webview!.onWebViewCreated != null)
|
||||
_webview!.onWebViewCreated!(this);
|
||||
break;
|
||||
case "onLoadStart":
|
||||
if ((_webview != null && _webview!.onLoadStart != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null && _webview!.onLoadStart != null) ||
|
||||
_inAppBrowser != null) {
|
||||
String? url = call.arguments["url"];
|
||||
Uri? uri = url != null ? Uri.parse(url) : null;
|
||||
if (_webview != null && _webview!.onLoadStart != null)
|
||||
@ -114,7 +122,8 @@ class InAppWebViewController {
|
||||
}
|
||||
break;
|
||||
case "onLoadStop":
|
||||
if ((_webview != null && _webview!.onLoadStop != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null && _webview!.onLoadStop != null) ||
|
||||
_inAppBrowser != null) {
|
||||
String? url = call.arguments["url"];
|
||||
Uri? uri = url != null ? Uri.parse(url) : null;
|
||||
if (_webview != null && _webview!.onLoadStop != null)
|
||||
@ -124,7 +133,8 @@ class InAppWebViewController {
|
||||
}
|
||||
break;
|
||||
case "onLoadError":
|
||||
if ((_webview != null && _webview!.onLoadError != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null && _webview!.onLoadError != null) ||
|
||||
_inAppBrowser != null) {
|
||||
String? url = call.arguments["url"];
|
||||
int code = call.arguments["code"];
|
||||
String message = call.arguments["message"];
|
||||
@ -136,7 +146,8 @@ class InAppWebViewController {
|
||||
}
|
||||
break;
|
||||
case "onLoadHttpError":
|
||||
if ((_webview != null && _webview!.onLoadHttpError != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null && _webview!.onLoadHttpError != null) ||
|
||||
_inAppBrowser != null) {
|
||||
String? url = call.arguments["url"];
|
||||
int statusCode = call.arguments["statusCode"];
|
||||
String description = call.arguments["description"];
|
||||
@ -148,7 +159,8 @@ class InAppWebViewController {
|
||||
}
|
||||
break;
|
||||
case "onProgressChanged":
|
||||
if ((_webview != null && _webview!.onProgressChanged != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null && _webview!.onProgressChanged != null) ||
|
||||
_inAppBrowser != null) {
|
||||
int progress = call.arguments["progress"];
|
||||
if (_webview != null && _webview!.onProgressChanged != null)
|
||||
_webview!.onProgressChanged!(this, progress);
|
||||
@ -157,22 +169,27 @@ class InAppWebViewController {
|
||||
}
|
||||
break;
|
||||
case "shouldOverrideUrlLoading":
|
||||
if ((_webview != null && _webview!.shouldOverrideUrlLoading != null) || _inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments = call.arguments.cast<String, dynamic>();
|
||||
NavigationAction navigationAction = NavigationAction.fromMap(arguments)!;
|
||||
if ((_webview != null && _webview!.shouldOverrideUrlLoading != null) ||
|
||||
_inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments =
|
||||
call.arguments.cast<String, dynamic>();
|
||||
NavigationAction navigationAction =
|
||||
NavigationAction.fromMap(arguments)!;
|
||||
|
||||
if (_webview != null && _webview!.shouldOverrideUrlLoading != null)
|
||||
return (await _webview!.shouldOverrideUrlLoading!(
|
||||
this, navigationAction))
|
||||
this, navigationAction))
|
||||
?.toMap();
|
||||
return (await _inAppBrowser!
|
||||
.shouldOverrideUrlLoading(navigationAction))
|
||||
.shouldOverrideUrlLoading(navigationAction))
|
||||
?.toMap();
|
||||
}
|
||||
break;
|
||||
case "onConsoleMessage":
|
||||
if ((_webview != null && _webview!.onConsoleMessage != null) || _inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments = call.arguments.cast<String, dynamic>();
|
||||
if ((_webview != null && _webview!.onConsoleMessage != null) ||
|
||||
_inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments =
|
||||
call.arguments.cast<String, dynamic>();
|
||||
ConsoleMessage consoleMessage = ConsoleMessage.fromMap(arguments)!;
|
||||
if (_webview != null && _webview!.onConsoleMessage != null)
|
||||
_webview!.onConsoleMessage!(this, consoleMessage);
|
||||
@ -181,7 +198,8 @@ class InAppWebViewController {
|
||||
}
|
||||
break;
|
||||
case "onScrollChanged":
|
||||
if ((_webview != null && _webview!.onScrollChanged != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null && _webview!.onScrollChanged != null) ||
|
||||
_inAppBrowser != null) {
|
||||
int x = call.arguments["x"];
|
||||
int y = call.arguments["y"];
|
||||
if (_webview != null && _webview!.onScrollChanged != null)
|
||||
@ -191,7 +209,8 @@ class InAppWebViewController {
|
||||
}
|
||||
break;
|
||||
case "onDownloadStart":
|
||||
if ((_webview != null && _webview!.onDownloadStart != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null && _webview!.onDownloadStart != null) ||
|
||||
_inAppBrowser != null) {
|
||||
String url = call.arguments["url"];
|
||||
Uri uri = Uri.parse(url);
|
||||
if (_webview != null && _webview!.onDownloadStart != null)
|
||||
@ -201,19 +220,26 @@ class InAppWebViewController {
|
||||
}
|
||||
break;
|
||||
case "onLoadResourceCustomScheme":
|
||||
if ((_webview != null && _webview!.onLoadResourceCustomScheme != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null &&
|
||||
_webview!.onLoadResourceCustomScheme != null) ||
|
||||
_inAppBrowser != null) {
|
||||
String url = call.arguments["url"];
|
||||
Uri uri = Uri.parse(url);
|
||||
if (_webview != null && _webview!.onLoadResourceCustomScheme != null)
|
||||
return (await _webview!.onLoadResourceCustomScheme!(this, uri))?.toMap();
|
||||
return (await _webview!.onLoadResourceCustomScheme!(this, uri))
|
||||
?.toMap();
|
||||
else
|
||||
return (await _inAppBrowser!.onLoadResourceCustomScheme(uri))?.toMap();
|
||||
return (await _inAppBrowser!.onLoadResourceCustomScheme(uri))
|
||||
?.toMap();
|
||||
}
|
||||
break;
|
||||
case "onCreateWindow":
|
||||
if ((_webview != null && _webview!.onCreateWindow != null) || _inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments = call.arguments.cast<String, dynamic>();
|
||||
CreateWindowAction createWindowAction = CreateWindowAction.fromMap(arguments)!;
|
||||
if ((_webview != null && _webview!.onCreateWindow != null) ||
|
||||
_inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments =
|
||||
call.arguments.cast<String, dynamic>();
|
||||
CreateWindowAction createWindowAction =
|
||||
CreateWindowAction.fromMap(arguments)!;
|
||||
|
||||
if (_webview != null && _webview!.onCreateWindow != null)
|
||||
return await _webview!.onCreateWindow!(this, createWindowAction);
|
||||
@ -227,7 +253,8 @@ class InAppWebViewController {
|
||||
else if (_inAppBrowser != null) _inAppBrowser!.onCloseWindow();
|
||||
break;
|
||||
case "onTitleChanged":
|
||||
if ((_webview != null && _webview!.onTitleChanged != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null && _webview!.onTitleChanged != null) ||
|
||||
_inAppBrowser != null) {
|
||||
String? title = call.arguments["title"];
|
||||
if (_webview != null && _webview!.onTitleChanged != null)
|
||||
_webview!.onTitleChanged!(this, title);
|
||||
@ -236,31 +263,40 @@ class InAppWebViewController {
|
||||
}
|
||||
break;
|
||||
case "onGeolocationPermissionsShowPrompt":
|
||||
if ((_webview != null && _webview!.androidOnGeolocationPermissionsShowPrompt != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null &&
|
||||
_webview!.androidOnGeolocationPermissionsShowPrompt != null) ||
|
||||
_inAppBrowser != null) {
|
||||
String origin = call.arguments["origin"];
|
||||
if (_webview != null && _webview!.androidOnGeolocationPermissionsShowPrompt != null)
|
||||
if (_webview != null &&
|
||||
_webview!.androidOnGeolocationPermissionsShowPrompt != null)
|
||||
return (await _webview!.androidOnGeolocationPermissionsShowPrompt!(
|
||||
this, origin))
|
||||
this, origin))
|
||||
?.toMap();
|
||||
else
|
||||
return (await _inAppBrowser!
|
||||
.androidOnGeolocationPermissionsShowPrompt(origin))
|
||||
.androidOnGeolocationPermissionsShowPrompt(origin))
|
||||
?.toMap();
|
||||
}
|
||||
break;
|
||||
case "onGeolocationPermissionsHidePrompt":
|
||||
if (_webview != null && _webview!.androidOnGeolocationPermissionsHidePrompt != null)
|
||||
if (_webview != null &&
|
||||
_webview!.androidOnGeolocationPermissionsHidePrompt != null)
|
||||
_webview!.androidOnGeolocationPermissionsHidePrompt!(this);
|
||||
else if (_inAppBrowser != null)
|
||||
_inAppBrowser!.androidOnGeolocationPermissionsHidePrompt();
|
||||
break;
|
||||
case "shouldInterceptRequest":
|
||||
if ((_webview != null && _webview!.androidShouldInterceptRequest != null) || _inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments = call.arguments.cast<String, dynamic>();
|
||||
if ((_webview != null &&
|
||||
_webview!.androidShouldInterceptRequest != null) ||
|
||||
_inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments =
|
||||
call.arguments.cast<String, dynamic>();
|
||||
WebResourceRequest request = WebResourceRequest.fromMap(arguments)!;
|
||||
|
||||
if (_webview != null && _webview!.androidShouldInterceptRequest != null)
|
||||
return (await _webview!.androidShouldInterceptRequest!(this, request))
|
||||
if (_webview != null &&
|
||||
_webview!.androidShouldInterceptRequest != null)
|
||||
return (await _webview!.androidShouldInterceptRequest!(
|
||||
this, request))
|
||||
?.toMap();
|
||||
else
|
||||
return (await _inAppBrowser!.androidShouldInterceptRequest(request))
|
||||
@ -268,23 +304,32 @@ class InAppWebViewController {
|
||||
}
|
||||
break;
|
||||
case "onRenderProcessUnresponsive":
|
||||
if ((_webview != null && _webview!.androidOnRenderProcessUnresponsive != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null &&
|
||||
_webview!.androidOnRenderProcessUnresponsive != null) ||
|
||||
_inAppBrowser != null) {
|
||||
String? url = call.arguments["url"];
|
||||
Uri? uri = url != null ? Uri.parse(url) : null;
|
||||
if (_webview != null && _webview!.androidOnRenderProcessUnresponsive != null)
|
||||
return (await _webview!.androidOnRenderProcessUnresponsive!(this, uri))
|
||||
if (_webview != null &&
|
||||
_webview!.androidOnRenderProcessUnresponsive != null)
|
||||
return (await _webview!.androidOnRenderProcessUnresponsive!(
|
||||
this, uri))
|
||||
?.toMap();
|
||||
else
|
||||
return (await _inAppBrowser!.androidOnRenderProcessUnresponsive(uri))
|
||||
return (await _inAppBrowser!
|
||||
.androidOnRenderProcessUnresponsive(uri))
|
||||
?.toMap();
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case "onRenderProcessResponsive":
|
||||
if ((_webview != null && _webview!.androidOnRenderProcessResponsive != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null &&
|
||||
_webview!.androidOnRenderProcessResponsive != null) ||
|
||||
_inAppBrowser != null) {
|
||||
String? url = call.arguments["url"];
|
||||
Uri? uri = url != null ? Uri.parse(url) : null;
|
||||
if (_webview != null && _webview!.androidOnRenderProcessResponsive != null)
|
||||
return (await _webview!.androidOnRenderProcessResponsive!(this, uri))
|
||||
if (_webview != null &&
|
||||
_webview!.androidOnRenderProcessResponsive != null)
|
||||
return (await _webview!.androidOnRenderProcessResponsive!(
|
||||
this, uri))
|
||||
?.toMap();
|
||||
else
|
||||
return (await _inAppBrowser!.androidOnRenderProcessResponsive(uri))
|
||||
@ -292,9 +337,13 @@ class InAppWebViewController {
|
||||
}
|
||||
break;
|
||||
case "onRenderProcessGone":
|
||||
if ((_webview != null && _webview!.androidOnRenderProcessGone != null) || _inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments = call.arguments.cast<String, dynamic>();
|
||||
RenderProcessGoneDetail detail = RenderProcessGoneDetail.fromMap(arguments)!;
|
||||
if ((_webview != null &&
|
||||
_webview!.androidOnRenderProcessGone != null) ||
|
||||
_inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments =
|
||||
call.arguments.cast<String, dynamic>();
|
||||
RenderProcessGoneDetail detail =
|
||||
RenderProcessGoneDetail.fromMap(arguments)!;
|
||||
|
||||
if (_webview != null && _webview!.androidOnRenderProcessGone != null)
|
||||
_webview!.androidOnRenderProcessGone!(this, detail);
|
||||
@ -303,17 +352,21 @@ class InAppWebViewController {
|
||||
}
|
||||
break;
|
||||
case "onFormResubmission":
|
||||
if ((_webview != null && _webview!.androidOnFormResubmission != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null && _webview!.androidOnFormResubmission != null) ||
|
||||
_inAppBrowser != null) {
|
||||
String? url = call.arguments["url"];
|
||||
Uri? uri = url != null ? Uri.parse(url) : null;
|
||||
if (_webview != null && _webview!.androidOnFormResubmission != null)
|
||||
return (await _webview!.androidOnFormResubmission!(this, uri))?.toMap();
|
||||
return (await _webview!.androidOnFormResubmission!(this, uri))
|
||||
?.toMap();
|
||||
else
|
||||
return (await _inAppBrowser!.androidOnFormResubmission(uri))?.toMap();
|
||||
return (await _inAppBrowser!.androidOnFormResubmission(uri))
|
||||
?.toMap();
|
||||
}
|
||||
break;
|
||||
case "onScaleChanged":
|
||||
if ((_webview != null && _webview!.androidOnScaleChanged != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null && _webview!.androidOnScaleChanged != null) ||
|
||||
_inAppBrowser != null) {
|
||||
double oldScale = call.arguments["oldScale"];
|
||||
double newScale = call.arguments["newScale"];
|
||||
if (_webview != null && _webview!.androidOnScaleChanged != null)
|
||||
@ -323,8 +376,10 @@ class InAppWebViewController {
|
||||
}
|
||||
break;
|
||||
case "onReceivedIcon":
|
||||
if ((_webview != null && _webview!.androidOnReceivedIcon != null) || _inAppBrowser != null) {
|
||||
Uint8List icon = Uint8List.fromList(call.arguments["icon"].cast<int>());
|
||||
if ((_webview != null && _webview!.androidOnReceivedIcon != null) ||
|
||||
_inAppBrowser != null) {
|
||||
Uint8List icon =
|
||||
Uint8List.fromList(call.arguments["icon"].cast<int>());
|
||||
|
||||
if (_webview != null && _webview!.androidOnReceivedIcon != null)
|
||||
_webview!.androidOnReceivedIcon!(this, icon);
|
||||
@ -333,19 +388,24 @@ class InAppWebViewController {
|
||||
}
|
||||
break;
|
||||
case "onReceivedTouchIconUrl":
|
||||
if ((_webview != null && _webview!.androidOnReceivedTouchIconUrl != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null &&
|
||||
_webview!.androidOnReceivedTouchIconUrl != null) ||
|
||||
_inAppBrowser != null) {
|
||||
String url = call.arguments["url"];
|
||||
bool precomposed = call.arguments["precomposed"];
|
||||
Uri uri = Uri.parse(url);
|
||||
if (_webview != null && _webview!.androidOnReceivedTouchIconUrl != null)
|
||||
if (_webview != null &&
|
||||
_webview!.androidOnReceivedTouchIconUrl != null)
|
||||
_webview!.androidOnReceivedTouchIconUrl!(this, uri, precomposed);
|
||||
else
|
||||
_inAppBrowser!.androidOnReceivedTouchIconUrl(uri, precomposed);
|
||||
}
|
||||
break;
|
||||
case "onJsAlert":
|
||||
if ((_webview != null && _webview!.onJsAlert != null) || _inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments = call.arguments.cast<String, dynamic>();
|
||||
if ((_webview != null && _webview!.onJsAlert != null) ||
|
||||
_inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments =
|
||||
call.arguments.cast<String, dynamic>();
|
||||
JsAlertRequest jsAlertRequest = JsAlertRequest.fromMap(arguments)!;
|
||||
|
||||
if (_webview != null && _webview!.onJsAlert != null)
|
||||
@ -355,72 +415,92 @@ class InAppWebViewController {
|
||||
}
|
||||
break;
|
||||
case "onJsConfirm":
|
||||
if ((_webview != null && _webview!.onJsConfirm != null) || _inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments = call.arguments.cast<String, dynamic>();
|
||||
JsConfirmRequest jsConfirmRequest = JsConfirmRequest.fromMap(arguments)!;
|
||||
if ((_webview != null && _webview!.onJsConfirm != null) ||
|
||||
_inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments =
|
||||
call.arguments.cast<String, dynamic>();
|
||||
JsConfirmRequest jsConfirmRequest =
|
||||
JsConfirmRequest.fromMap(arguments)!;
|
||||
|
||||
if (_webview != null && _webview!.onJsConfirm != null)
|
||||
return (await _webview!.onJsConfirm!(this, jsConfirmRequest))?.toMap();
|
||||
return (await _webview!.onJsConfirm!(this, jsConfirmRequest))
|
||||
?.toMap();
|
||||
else
|
||||
return (await _inAppBrowser!.onJsConfirm(jsConfirmRequest))?.toMap();
|
||||
return (await _inAppBrowser!.onJsConfirm(jsConfirmRequest))
|
||||
?.toMap();
|
||||
}
|
||||
break;
|
||||
case "onJsPrompt":
|
||||
if ((_webview != null && _webview!.onJsPrompt != null) || _inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments = call.arguments.cast<String, dynamic>();
|
||||
if ((_webview != null && _webview!.onJsPrompt != null) ||
|
||||
_inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments =
|
||||
call.arguments.cast<String, dynamic>();
|
||||
JsPromptRequest jsPromptRequest = JsPromptRequest.fromMap(arguments)!;
|
||||
|
||||
if (_webview != null && _webview!.onJsPrompt != null)
|
||||
return (await _webview!.onJsPrompt!(this, jsPromptRequest))?.toMap();
|
||||
return (await _webview!.onJsPrompt!(this, jsPromptRequest))
|
||||
?.toMap();
|
||||
else
|
||||
return (await _inAppBrowser!.onJsPrompt(jsPromptRequest))?.toMap();
|
||||
}
|
||||
break;
|
||||
case "onJsBeforeUnload":
|
||||
if ((_webview != null && _webview!.androidOnJsBeforeUnload != null) || _inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments = call.arguments.cast<String, dynamic>();
|
||||
JsBeforeUnloadRequest jsBeforeUnloadRequest = JsBeforeUnloadRequest.fromMap(arguments)!;
|
||||
if ((_webview != null && _webview!.androidOnJsBeforeUnload != null) ||
|
||||
_inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments =
|
||||
call.arguments.cast<String, dynamic>();
|
||||
JsBeforeUnloadRequest jsBeforeUnloadRequest =
|
||||
JsBeforeUnloadRequest.fromMap(arguments)!;
|
||||
|
||||
if (_webview != null && _webview!.androidOnJsBeforeUnload != null)
|
||||
return (await _webview!.androidOnJsBeforeUnload!(
|
||||
this, jsBeforeUnloadRequest))
|
||||
this, jsBeforeUnloadRequest))
|
||||
?.toMap();
|
||||
else
|
||||
return (await _inAppBrowser!
|
||||
.androidOnJsBeforeUnload(jsBeforeUnloadRequest))
|
||||
.androidOnJsBeforeUnload(jsBeforeUnloadRequest))
|
||||
?.toMap();
|
||||
}
|
||||
break;
|
||||
case "onSafeBrowsingHit":
|
||||
if ((_webview != null && _webview!.androidOnSafeBrowsingHit != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null && _webview!.androidOnSafeBrowsingHit != null) ||
|
||||
_inAppBrowser != null) {
|
||||
String url = call.arguments["url"];
|
||||
SafeBrowsingThreat? threatType =
|
||||
SafeBrowsingThreat.fromValue(call.arguments["threatType"]);
|
||||
SafeBrowsingThreat.fromValue(call.arguments["threatType"]);
|
||||
Uri uri = Uri.parse(url);
|
||||
if (_webview != null && _webview!.androidOnSafeBrowsingHit != null)
|
||||
return (await _webview!.androidOnSafeBrowsingHit!(
|
||||
this, uri, threatType))
|
||||
this, uri, threatType))
|
||||
?.toMap();
|
||||
else
|
||||
return (await _inAppBrowser!.androidOnSafeBrowsingHit(uri, threatType))
|
||||
return (await _inAppBrowser!
|
||||
.androidOnSafeBrowsingHit(uri, threatType))
|
||||
?.toMap();
|
||||
}
|
||||
break;
|
||||
case "onReceivedLoginRequest":
|
||||
if ((_webview != null && _webview!.androidOnReceivedLoginRequest != null) || _inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments = call.arguments.cast<String, dynamic>();
|
||||
if ((_webview != null &&
|
||||
_webview!.androidOnReceivedLoginRequest != null) ||
|
||||
_inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments =
|
||||
call.arguments.cast<String, dynamic>();
|
||||
LoginRequest loginRequest = LoginRequest.fromMap(arguments)!;
|
||||
|
||||
if (_webview != null && _webview!.androidOnReceivedLoginRequest != null)
|
||||
if (_webview != null &&
|
||||
_webview!.androidOnReceivedLoginRequest != null)
|
||||
_webview!.androidOnReceivedLoginRequest!(this, loginRequest);
|
||||
else
|
||||
_inAppBrowser!.androidOnReceivedLoginRequest(loginRequest);
|
||||
}
|
||||
break;
|
||||
case "onReceivedHttpAuthRequest":
|
||||
if ((_webview != null && _webview!.onReceivedHttpAuthRequest != null) || _inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments = call.arguments.cast<String, dynamic>();
|
||||
HttpAuthenticationChallenge challenge = HttpAuthenticationChallenge.fromMap(arguments)!;
|
||||
if ((_webview != null && _webview!.onReceivedHttpAuthRequest != null) ||
|
||||
_inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments =
|
||||
call.arguments.cast<String, dynamic>();
|
||||
HttpAuthenticationChallenge challenge =
|
||||
HttpAuthenticationChallenge.fromMap(arguments)!;
|
||||
|
||||
if (_webview != null && _webview!.onReceivedHttpAuthRequest != null)
|
||||
return (await _webview!.onReceivedHttpAuthRequest!(this, challenge))
|
||||
@ -431,27 +511,37 @@ class InAppWebViewController {
|
||||
}
|
||||
break;
|
||||
case "onReceivedServerTrustAuthRequest":
|
||||
if ((_webview != null && _webview!.onReceivedServerTrustAuthRequest != null) || _inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments = call.arguments.cast<String, dynamic>();
|
||||
ServerTrustChallenge challenge = ServerTrustChallenge.fromMap(arguments)!;
|
||||
if ((_webview != null &&
|
||||
_webview!.onReceivedServerTrustAuthRequest != null) ||
|
||||
_inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments =
|
||||
call.arguments.cast<String, dynamic>();
|
||||
ServerTrustChallenge challenge =
|
||||
ServerTrustChallenge.fromMap(arguments)!;
|
||||
|
||||
if (_webview != null && _webview!.onReceivedServerTrustAuthRequest != null)
|
||||
if (_webview != null &&
|
||||
_webview!.onReceivedServerTrustAuthRequest != null)
|
||||
return (await _webview!.onReceivedServerTrustAuthRequest!(
|
||||
this, challenge))
|
||||
this, challenge))
|
||||
?.toMap();
|
||||
else
|
||||
return (await _inAppBrowser!
|
||||
.onReceivedServerTrustAuthRequest(challenge))
|
||||
.onReceivedServerTrustAuthRequest(challenge))
|
||||
?.toMap();
|
||||
}
|
||||
break;
|
||||
case "onReceivedClientCertRequest":
|
||||
if ((_webview != null && _webview!.onReceivedClientCertRequest != null) || _inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments = call.arguments.cast<String, dynamic>();
|
||||
ClientCertChallenge challenge = ClientCertChallenge.fromMap(arguments)!;
|
||||
if ((_webview != null &&
|
||||
_webview!.onReceivedClientCertRequest != null) ||
|
||||
_inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments =
|
||||
call.arguments.cast<String, dynamic>();
|
||||
ClientCertChallenge challenge =
|
||||
ClientCertChallenge.fromMap(arguments)!;
|
||||
|
||||
if (_webview != null && _webview!.onReceivedClientCertRequest != null)
|
||||
return (await _webview!.onReceivedClientCertRequest!(this, challenge))
|
||||
return (await _webview!.onReceivedClientCertRequest!(
|
||||
this, challenge))
|
||||
?.toMap();
|
||||
else
|
||||
return (await _inAppBrowser!.onReceivedClientCertRequest(challenge))
|
||||
@ -459,7 +549,8 @@ class InAppWebViewController {
|
||||
}
|
||||
break;
|
||||
case "onFindResultReceived":
|
||||
if ((_webview != null && _webview!.onFindResultReceived != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null && _webview!.onFindResultReceived != null) ||
|
||||
_inAppBrowser != null) {
|
||||
int activeMatchOrdinal = call.arguments["activeMatchOrdinal"];
|
||||
int numberOfMatches = call.arguments["numberOfMatches"];
|
||||
bool isDoneCounting = call.arguments["isDoneCounting"];
|
||||
@ -472,21 +563,24 @@ class InAppWebViewController {
|
||||
}
|
||||
break;
|
||||
case "onPermissionRequest":
|
||||
if ((_webview != null && _webview!.androidOnPermissionRequest != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null &&
|
||||
_webview!.androidOnPermissionRequest != null) ||
|
||||
_inAppBrowser != null) {
|
||||
String origin = call.arguments["origin"];
|
||||
List<String> resources = call.arguments["resources"].cast<String>();
|
||||
if (_webview != null && _webview!.androidOnPermissionRequest != null)
|
||||
return (await _webview!.androidOnPermissionRequest!(
|
||||
this, origin, resources))
|
||||
this, origin, resources))
|
||||
?.toMap();
|
||||
else
|
||||
return (await _inAppBrowser!.androidOnPermissionRequest(
|
||||
origin, resources))
|
||||
return (await _inAppBrowser!
|
||||
.androidOnPermissionRequest(origin, resources))
|
||||
?.toMap();
|
||||
}
|
||||
break;
|
||||
case "onUpdateVisitedHistory":
|
||||
if ((_webview != null && _webview!.onUpdateVisitedHistory != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null && _webview!.onUpdateVisitedHistory != null) ||
|
||||
_inAppBrowser != null) {
|
||||
String? url = call.arguments["url"];
|
||||
bool? androidIsReload = call.arguments["androidIsReload"];
|
||||
Uri? uri = url != null ? Uri.parse(url) : null;
|
||||
@ -504,7 +598,8 @@ class InAppWebViewController {
|
||||
_inAppBrowser!.iosOnWebContentProcessDidTerminate();
|
||||
break;
|
||||
case "onPageCommitVisible":
|
||||
if ((_webview != null && _webview!.onPageCommitVisible != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null && _webview!.onPageCommitVisible != null) ||
|
||||
_inAppBrowser != null) {
|
||||
String? url = call.arguments["url"];
|
||||
Uri? uri = url != null ? Uri.parse(url) : null;
|
||||
if (_webview != null && _webview!.onPageCommitVisible != null)
|
||||
@ -517,44 +612,55 @@ class InAppWebViewController {
|
||||
if (_webview != null &&
|
||||
_webview!.iosOnDidReceiveServerRedirectForProvisionalNavigation !=
|
||||
null)
|
||||
_webview!.iosOnDidReceiveServerRedirectForProvisionalNavigation!(this);
|
||||
_webview!
|
||||
.iosOnDidReceiveServerRedirectForProvisionalNavigation!(this);
|
||||
else if (_inAppBrowser != null)
|
||||
_inAppBrowser!.iosOnDidReceiveServerRedirectForProvisionalNavigation();
|
||||
_inAppBrowser!
|
||||
.iosOnDidReceiveServerRedirectForProvisionalNavigation();
|
||||
break;
|
||||
case "onNavigationResponse":
|
||||
if ((_webview != null && _webview!.iosOnNavigationResponse != null) || _inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments = call.arguments.cast<String, dynamic>();
|
||||
IOSWKNavigationResponse iosOnNavigationResponse = IOSWKNavigationResponse.fromMap(arguments)!;
|
||||
if ((_webview != null && _webview!.iosOnNavigationResponse != null) ||
|
||||
_inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments =
|
||||
call.arguments.cast<String, dynamic>();
|
||||
IOSWKNavigationResponse iosOnNavigationResponse =
|
||||
IOSWKNavigationResponse.fromMap(arguments)!;
|
||||
|
||||
if (_webview != null && _webview!.iosOnNavigationResponse != null)
|
||||
return (await _webview!.iosOnNavigationResponse!(
|
||||
this, iosOnNavigationResponse))
|
||||
this, iosOnNavigationResponse))
|
||||
?.toMap();
|
||||
else
|
||||
return (await _inAppBrowser!
|
||||
.iosOnNavigationResponse(iosOnNavigationResponse))
|
||||
.iosOnNavigationResponse(iosOnNavigationResponse))
|
||||
?.toMap();
|
||||
}
|
||||
break;
|
||||
case "shouldAllowDeprecatedTLS":
|
||||
if ((_webview != null && _webview!.iosShouldAllowDeprecatedTLS != null) || _inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments = call.arguments.cast<String, dynamic>();
|
||||
URLAuthenticationChallenge challenge = URLAuthenticationChallenge.fromMap(arguments)!;
|
||||
if ((_webview != null &&
|
||||
_webview!.iosShouldAllowDeprecatedTLS != null) ||
|
||||
_inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments =
|
||||
call.arguments.cast<String, dynamic>();
|
||||
URLAuthenticationChallenge challenge =
|
||||
URLAuthenticationChallenge.fromMap(arguments)!;
|
||||
|
||||
if (_webview != null && _webview!.iosShouldAllowDeprecatedTLS != null)
|
||||
return (await _webview!.iosShouldAllowDeprecatedTLS!(
|
||||
this, challenge))
|
||||
this, challenge))
|
||||
?.toMap();
|
||||
else
|
||||
return (await _inAppBrowser!
|
||||
.iosShouldAllowDeprecatedTLS(challenge))
|
||||
return (await _inAppBrowser!.iosShouldAllowDeprecatedTLS(challenge))
|
||||
?.toMap();
|
||||
}
|
||||
break;
|
||||
case "onLongPressHitTestResult":
|
||||
if ((_webview != null && _webview!.onLongPressHitTestResult != null) || _inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments = call.arguments.cast<String, dynamic>();
|
||||
InAppWebViewHitTestResult hitTestResult = InAppWebViewHitTestResult.fromMap(arguments)!;
|
||||
if ((_webview != null && _webview!.onLongPressHitTestResult != null) ||
|
||||
_inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments =
|
||||
call.arguments.cast<String, dynamic>();
|
||||
InAppWebViewHitTestResult hitTestResult =
|
||||
InAppWebViewHitTestResult.fromMap(arguments)!;
|
||||
|
||||
if (_webview != null && _webview!.onLongPressHitTestResult != null)
|
||||
_webview!.onLongPressHitTestResult!(this, hitTestResult);
|
||||
@ -566,13 +672,16 @@ class InAppWebViewController {
|
||||
ContextMenu? contextMenu;
|
||||
if (_webview != null && _webview!.contextMenu != null) {
|
||||
contextMenu = _webview!.contextMenu;
|
||||
} else if (_inAppBrowser != null && _inAppBrowser!.contextMenu != null) {
|
||||
} else if (_inAppBrowser != null &&
|
||||
_inAppBrowser!.contextMenu != null) {
|
||||
contextMenu = _inAppBrowser!.contextMenu;
|
||||
}
|
||||
|
||||
if (contextMenu != null && contextMenu.onCreateContextMenu != null) {
|
||||
Map<String, dynamic> arguments = call.arguments.cast<String, dynamic>();
|
||||
InAppWebViewHitTestResult hitTestResult = InAppWebViewHitTestResult.fromMap(arguments)!;
|
||||
Map<String, dynamic> arguments =
|
||||
call.arguments.cast<String, dynamic>();
|
||||
InAppWebViewHitTestResult hitTestResult =
|
||||
InAppWebViewHitTestResult.fromMap(arguments)!;
|
||||
|
||||
contextMenu.onCreateContextMenu!(hitTestResult);
|
||||
}
|
||||
@ -581,7 +690,8 @@ class InAppWebViewController {
|
||||
ContextMenu? contextMenu;
|
||||
if (_webview != null && _webview!.contextMenu != null) {
|
||||
contextMenu = _webview!.contextMenu;
|
||||
} else if (_inAppBrowser != null && _inAppBrowser!.contextMenu != null) {
|
||||
} else if (_inAppBrowser != null &&
|
||||
_inAppBrowser!.contextMenu != null) {
|
||||
contextMenu = _inAppBrowser!.contextMenu;
|
||||
}
|
||||
|
||||
@ -593,7 +703,8 @@ class InAppWebViewController {
|
||||
ContextMenu? contextMenu;
|
||||
if (_webview != null && _webview!.contextMenu != null) {
|
||||
contextMenu = _webview!.contextMenu;
|
||||
} else if (_inAppBrowser != null && _inAppBrowser!.contextMenu != null) {
|
||||
} else if (_inAppBrowser != null &&
|
||||
_inAppBrowser!.contextMenu != null) {
|
||||
contextMenu = _inAppBrowser!.contextMenu;
|
||||
}
|
||||
|
||||
@ -606,8 +717,10 @@ class InAppWebViewController {
|
||||
androidId: androidId, iosId: iosId, title: title, action: null);
|
||||
|
||||
for (var menuItem in contextMenu.menuItems) {
|
||||
if ((defaultTargetPlatform == TargetPlatform.android && menuItem.androidId == androidId) ||
|
||||
(defaultTargetPlatform == TargetPlatform.iOS && menuItem.iosId == iosId)) {
|
||||
if ((defaultTargetPlatform == TargetPlatform.android &&
|
||||
menuItem.androidId == androidId) ||
|
||||
(defaultTargetPlatform == TargetPlatform.iOS &&
|
||||
menuItem.iosId == iosId)) {
|
||||
menuItemClicked = menuItem;
|
||||
if (menuItem.action != null) {
|
||||
menuItem.action!();
|
||||
@ -638,7 +751,8 @@ class InAppWebViewController {
|
||||
|
||||
switch (handlerName) {
|
||||
case "onLoadResource":
|
||||
if ((_webview != null && _webview!.onLoadResource != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null && _webview!.onLoadResource != null) ||
|
||||
_inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments = args[0].cast<String, dynamic>();
|
||||
arguments["startTime"] = arguments["startTime"] is int
|
||||
? arguments["startTime"].toDouble()
|
||||
@ -656,11 +770,14 @@ class InAppWebViewController {
|
||||
}
|
||||
return null;
|
||||
case "shouldInterceptAjaxRequest":
|
||||
if ((_webview != null && _webview!.shouldInterceptAjaxRequest != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null &&
|
||||
_webview!.shouldInterceptAjaxRequest != null) ||
|
||||
_inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments = args[0].cast<String, dynamic>();
|
||||
AjaxRequest request = AjaxRequest.fromMap(arguments)!;
|
||||
|
||||
if (_webview != null && _webview!.shouldInterceptAjaxRequest != null)
|
||||
if (_webview != null &&
|
||||
_webview!.shouldInterceptAjaxRequest != null)
|
||||
return jsonEncode(
|
||||
await _webview!.shouldInterceptAjaxRequest!(this, request));
|
||||
else
|
||||
@ -669,7 +786,9 @@ class InAppWebViewController {
|
||||
}
|
||||
return null;
|
||||
case "onAjaxReadyStateChange":
|
||||
if ((_webview != null && _webview!.onAjaxReadyStateChange != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null &&
|
||||
_webview!.onAjaxReadyStateChange != null) ||
|
||||
_inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments = args[0].cast<String, dynamic>();
|
||||
AjaxRequest request = AjaxRequest.fromMap(arguments)!;
|
||||
|
||||
@ -682,31 +801,37 @@ class InAppWebViewController {
|
||||
}
|
||||
return null;
|
||||
case "onAjaxProgress":
|
||||
if ((_webview != null && _webview!.onAjaxProgress != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null && _webview!.onAjaxProgress != null) ||
|
||||
_inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments = args[0].cast<String, dynamic>();
|
||||
AjaxRequest request = AjaxRequest.fromMap(arguments)!;
|
||||
|
||||
if (_webview != null && _webview!.onAjaxProgress != null)
|
||||
return jsonEncode(await _webview!.onAjaxProgress!(this, request));
|
||||
return jsonEncode(
|
||||
await _webview!.onAjaxProgress!(this, request));
|
||||
else
|
||||
return jsonEncode(await _inAppBrowser!.onAjaxProgress(request));
|
||||
}
|
||||
return null;
|
||||
case "shouldInterceptFetchRequest":
|
||||
if ((_webview != null && _webview!.shouldInterceptFetchRequest != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null &&
|
||||
_webview!.shouldInterceptFetchRequest != null) ||
|
||||
_inAppBrowser != null) {
|
||||
Map<String, dynamic> arguments = args[0].cast<String, dynamic>();
|
||||
FetchRequest request = FetchRequest.fromMap(arguments)!;
|
||||
|
||||
if (_webview != null && _webview!.shouldInterceptFetchRequest != null)
|
||||
return jsonEncode(
|
||||
await _webview!.shouldInterceptFetchRequest!(this, request));
|
||||
if (_webview != null &&
|
||||
_webview!.shouldInterceptFetchRequest != null)
|
||||
return jsonEncode(await _webview!.shouldInterceptFetchRequest!(
|
||||
this, request));
|
||||
else
|
||||
return jsonEncode(
|
||||
await _inAppBrowser!.shouldInterceptFetchRequest(request));
|
||||
}
|
||||
return null;
|
||||
case "onPrint":
|
||||
if ((_webview != null && _webview!.onPrint != null) || _inAppBrowser != null) {
|
||||
if ((_webview != null && _webview!.onPrint != null) ||
|
||||
_inAppBrowser != null) {
|
||||
String? url = args[0];
|
||||
Uri? uri = url != null ? Uri.parse(url) : null;
|
||||
if (_webview != null && _webview!.onPrint != null)
|
||||
@ -785,8 +910,7 @@ class InAppWebViewController {
|
||||
String? html;
|
||||
|
||||
InAppWebViewGroupOptions? options = await getOptions();
|
||||
if (options != null &&
|
||||
options.crossPlatform.javaScriptEnabled == true) {
|
||||
if (options != null && options.crossPlatform.javaScriptEnabled == true) {
|
||||
html = await evaluateJavascript(
|
||||
source: "window.document.getElementsByTagName('html')[0].outerHTML;");
|
||||
if (html != null && html.isNotEmpty) return html;
|
||||
@ -809,7 +933,7 @@ class InAppWebViewController {
|
||||
try {
|
||||
var htmlRequest = await client.getUrl(webviewUrl);
|
||||
html =
|
||||
await (await htmlRequest.close()).transform(Utf8Decoder()).join();
|
||||
await (await htmlRequest.close()).transform(Utf8Decoder()).join();
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
@ -843,8 +967,7 @@ class InAppWebViewController {
|
||||
}
|
||||
|
||||
InAppWebViewGroupOptions? options = await getOptions();
|
||||
if (options != null &&
|
||||
options.crossPlatform.javaScriptEnabled == true) {
|
||||
if (options != null && options.crossPlatform.javaScriptEnabled == true) {
|
||||
List<Map<dynamic, dynamic>> links = (await evaluateJavascript(source: """
|
||||
(function() {
|
||||
var linkNodes = document.head.getElementsByTagName("link");
|
||||
@ -893,7 +1016,8 @@ class InAppWebViewController {
|
||||
|
||||
// try to get /favicon.ico
|
||||
try {
|
||||
var faviconUrl = webviewUrl.scheme + "://" + webviewUrl.host + "/favicon.ico";
|
||||
var faviconUrl =
|
||||
webviewUrl.scheme + "://" + webviewUrl.host + "/favicon.ico";
|
||||
var faviconUri = Uri.parse(faviconUrl);
|
||||
await client.headUrl(faviconUri);
|
||||
favicons.add(Favicon(url: faviconUri, rel: "shortcut icon"));
|
||||
@ -907,7 +1031,8 @@ class InAppWebViewController {
|
||||
HttpClientResponse? manifestResponse;
|
||||
bool manifestFound = false;
|
||||
if (manifestUrl == null) {
|
||||
manifestUrl = webviewUrl.scheme + "://" + webviewUrl.host + "/manifest.json";
|
||||
manifestUrl =
|
||||
webviewUrl.scheme + "://" + webviewUrl.host + "/manifest.json";
|
||||
}
|
||||
try {
|
||||
manifestRequest = await client.getUrl(Uri.parse(manifestUrl));
|
||||
@ -924,8 +1049,8 @@ class InAppWebViewController {
|
||||
json.decode(await manifestResponse!.transform(Utf8Decoder()).join());
|
||||
if (manifest.containsKey("icons")) {
|
||||
for (Map<String, dynamic> icon in manifest["icons"]) {
|
||||
favicons.addAll(_createFavicons(webviewUrl, assetPathBase, icon["src"],
|
||||
icon["rel"], icon["sizes"], true));
|
||||
favicons.addAll(_createFavicons(webviewUrl, assetPathBase,
|
||||
icon["src"], icon["rel"], icon["sizes"], true));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -964,11 +1089,12 @@ class InAppWebViewController {
|
||||
for (String size in sizesSplitted) {
|
||||
int width = int.parse(size.split("x")[0]);
|
||||
int height = int.parse(size.split("x")[1]);
|
||||
favicons
|
||||
.add(Favicon(url: Uri.parse(urlIcon), rel: rel, width: width, height: height));
|
||||
favicons.add(Favicon(
|
||||
url: Uri.parse(urlIcon), rel: rel, width: width, height: height));
|
||||
}
|
||||
} else {
|
||||
favicons.add(Favicon(url: Uri.parse(urlIcon), rel: rel, width: null, height: null));
|
||||
favicons.add(Favicon(
|
||||
url: Uri.parse(urlIcon), rel: rel, width: null, height: null));
|
||||
}
|
||||
|
||||
return favicons;
|
||||
@ -989,13 +1115,16 @@ class InAppWebViewController {
|
||||
///**Official iOS API**:
|
||||
///- https://developer.apple.com/documentation/webkit/wkwebview/1414954-load
|
||||
///- if [iosAllowingReadAccessTo] is used, https://developer.apple.com/documentation/webkit/wkwebview/1414973-loadfileurl
|
||||
Future<void> loadUrl({required URLRequest urlRequest, Uri? iosAllowingReadAccessTo}) async {
|
||||
Future<void> loadUrl(
|
||||
{required URLRequest urlRequest, Uri? iosAllowingReadAccessTo}) async {
|
||||
assert(urlRequest.url != null && urlRequest.url.toString().isNotEmpty);
|
||||
assert(iosAllowingReadAccessTo == null || iosAllowingReadAccessTo.isScheme("file"));
|
||||
assert(iosAllowingReadAccessTo == null ||
|
||||
iosAllowingReadAccessTo.isScheme("file"));
|
||||
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent('urlRequest', () => urlRequest.toMap());
|
||||
args.putIfAbsent('allowingReadAccessTo', () => iosAllowingReadAccessTo.toString());
|
||||
args.putIfAbsent(
|
||||
'allowingReadAccessTo', () => iosAllowingReadAccessTo.toString());
|
||||
await _channel.invokeMethod('loadUrl', args);
|
||||
}
|
||||
|
||||
@ -1040,7 +1169,8 @@ class InAppWebViewController {
|
||||
args.putIfAbsent('mimeType', () => mimeType);
|
||||
args.putIfAbsent('encoding', () => encoding);
|
||||
args.putIfAbsent('baseUrl', () => baseUrl?.toString() ?? "about:blank");
|
||||
args.putIfAbsent('historyUrl', () => androidHistoryUrl?.toString() ?? "about:blank");
|
||||
args.putIfAbsent(
|
||||
'historyUrl', () => androidHistoryUrl?.toString() ?? "about:blank");
|
||||
await _channel.invokeMethod('loadData', args);
|
||||
}
|
||||
|
||||
@ -1192,12 +1322,14 @@ class InAppWebViewController {
|
||||
///**Official iOS API**:
|
||||
///- https://developer.apple.com/documentation/webkit/wkwebview/1415017-evaluatejavascript
|
||||
///- https://developer.apple.com/documentation/webkit/wkwebview/3656442-evaluatejavascript
|
||||
Future<dynamic> evaluateJavascript({required String source, ContentWorld? contentWorld}) async {
|
||||
Future<dynamic> evaluateJavascript(
|
||||
{required String source, ContentWorld? contentWorld}) async {
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent('source', () => source);
|
||||
args.putIfAbsent('contentWorld', () => contentWorld?.toMap());
|
||||
var data = await _channel.invokeMethod('evaluateJavascript', args);
|
||||
if (data != null && defaultTargetPlatform == TargetPlatform.android) data = json.decode(data);
|
||||
if (data != null && defaultTargetPlatform == TargetPlatform.android)
|
||||
data = json.decode(data);
|
||||
return data;
|
||||
}
|
||||
|
||||
@ -1209,11 +1341,14 @@ class InAppWebViewController {
|
||||
///because, in these events, the [WebView] is not ready to handle it yet.
|
||||
///Instead, you should call this method, for example, inside the [WebView.onLoadStop] event or in any other events
|
||||
///where you know the page is ready "enough".
|
||||
Future<void> injectJavascriptFileFromUrl({required Uri urlFile, ScriptHtmlTagAttributes? scriptHtmlTagAttributes}) async {
|
||||
Future<void> injectJavascriptFileFromUrl(
|
||||
{required Uri urlFile,
|
||||
ScriptHtmlTagAttributes? scriptHtmlTagAttributes}) async {
|
||||
assert(urlFile.toString().isNotEmpty);
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent('urlFile', () => urlFile.toString());
|
||||
args.putIfAbsent('scriptHtmlTagAttributes', () => scriptHtmlTagAttributes?.toMap());
|
||||
args.putIfAbsent(
|
||||
'scriptHtmlTagAttributes', () => scriptHtmlTagAttributes?.toMap());
|
||||
await _channel.invokeMethod('injectJavascriptFileFromUrl', args);
|
||||
}
|
||||
|
||||
@ -1249,11 +1384,14 @@ class InAppWebViewController {
|
||||
///because, in these events, the [WebView] is not ready to handle it yet.
|
||||
///Instead, you should call this method, for example, inside the [WebView.onLoadStop] event or in any other events
|
||||
///where you know the page is ready "enough".
|
||||
Future<void> injectCSSFileFromUrl({required Uri urlFile, CSSLinkHtmlTagAttributes? cssLinkHtmlTagAttributes}) async {
|
||||
Future<void> injectCSSFileFromUrl(
|
||||
{required Uri urlFile,
|
||||
CSSLinkHtmlTagAttributes? cssLinkHtmlTagAttributes}) async {
|
||||
assert(urlFile.toString().isNotEmpty);
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent('urlFile', () => urlFile.toString());
|
||||
args.putIfAbsent('cssLinkHtmlTagAttributes', () => cssLinkHtmlTagAttributes?.toMap());
|
||||
args.putIfAbsent(
|
||||
'cssLinkHtmlTagAttributes', () => cssLinkHtmlTagAttributes?.toMap());
|
||||
await _channel.invokeMethod('injectCSSFileFromUrl', args);
|
||||
}
|
||||
|
||||
@ -1340,9 +1478,11 @@ class InAppWebViewController {
|
||||
///**NOTE for iOS**: available on iOS 11.0+.
|
||||
///
|
||||
///**Official iOS API**: https://developer.apple.com/documentation/webkit/wkwebview/2873260-takesnapshot
|
||||
Future<Uint8List?> takeScreenshot({ScreenshotConfiguration? screenshotConfiguration}) async {
|
||||
Future<Uint8List?> takeScreenshot(
|
||||
{ScreenshotConfiguration? screenshotConfiguration}) async {
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent('screenshotConfiguration', () => screenshotConfiguration?.toMap());
|
||||
args.putIfAbsent(
|
||||
'screenshotConfiguration', () => screenshotConfiguration?.toMap());
|
||||
return await _channel.invokeMethod('takeScreenshot', args);
|
||||
}
|
||||
|
||||
@ -1378,7 +1518,9 @@ class InAppWebViewController {
|
||||
///**Official iOS API**: https://developer.apple.com/documentation/webkit/wkwebview/1414977-backforwardlist
|
||||
Future<WebHistory?> getCopyBackForwardList() async {
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
Map<String, dynamic>? result = (await _channel.invokeMethod('getCopyBackForwardList', args))?.cast<String, dynamic>();
|
||||
Map<String, dynamic>? result =
|
||||
(await _channel.invokeMethod('getCopyBackForwardList', args))
|
||||
?.cast<String, dynamic>();
|
||||
return WebHistory.fromMap(result);
|
||||
}
|
||||
|
||||
@ -1533,9 +1675,12 @@ class InAppWebViewController {
|
||||
///**Official Android API**: https://developer.android.com/reference/android/webkit/WebView#zoomBy(float)
|
||||
///
|
||||
///**Official iOS API**: https://developer.apple.com/documentation/uikit/uiscrollview/1619412-setzoomscale
|
||||
Future<void> zoomBy({required double zoomFactor, bool iosAnimated = false}) async {
|
||||
Future<void> zoomBy(
|
||||
{required double zoomFactor, bool iosAnimated = false}) async {
|
||||
assert(defaultTargetPlatform != TargetPlatform.android ||
|
||||
(defaultTargetPlatform == TargetPlatform.android && zoomFactor > 0.01 && zoomFactor <= 100.0));
|
||||
(defaultTargetPlatform == TargetPlatform.android &&
|
||||
zoomFactor > 0.01 &&
|
||||
zoomFactor <= 100.0));
|
||||
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent('zoomFactor', () => zoomFactor);
|
||||
@ -1723,7 +1868,9 @@ class InAppWebViewController {
|
||||
|
||||
var colorValue = metaTagThemeColor.content;
|
||||
|
||||
return colorValue != null ? UtilColor.fromStringRepresentation(colorValue) : null;
|
||||
return colorValue != null
|
||||
? UtilColor.fromStringRepresentation(colorValue)
|
||||
: null;
|
||||
}
|
||||
|
||||
///Returns the scrolled left position of the current WebView.
|
||||
@ -1832,7 +1979,8 @@ class InAppWebViewController {
|
||||
///**NOTE for iOS**: this method will throw an error if the [WebView.windowId] has been set.
|
||||
///There isn't any way to add/remove user scripts specific to iOS window WebViews.
|
||||
///This is a limitation of the native iOS WebKit APIs.
|
||||
Future<void> removeUserScripts({required List<UserScript> userScripts}) async {
|
||||
Future<void> removeUserScripts(
|
||||
{required List<UserScript> userScripts}) async {
|
||||
assert(_webview?.windowId == null || !Platform.isIOS);
|
||||
|
||||
for (var i = 0; i < userScripts.length; i++) {
|
||||
@ -1880,7 +2028,8 @@ class InAppWebViewController {
|
||||
///**NOTE for Android**: available only on Android 21+.
|
||||
///
|
||||
///**Official iOS API**: https://developer.apple.com/documentation/webkit/wkwebview/3656441-callasyncjavascript
|
||||
Future<CallAsyncJavaScriptResult?> callAsyncJavaScript({required String functionBody,
|
||||
Future<CallAsyncJavaScriptResult?> callAsyncJavaScript(
|
||||
{required String functionBody,
|
||||
Map<String, dynamic> arguments = const <String, dynamic>{},
|
||||
ContentWorld? contentWorld}) async {
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
@ -1894,7 +2043,8 @@ class InAppWebViewController {
|
||||
if (defaultTargetPlatform == TargetPlatform.android) {
|
||||
data = json.decode(data);
|
||||
}
|
||||
return CallAsyncJavaScriptResult(value: data["value"], error: data["error"]);
|
||||
return CallAsyncJavaScriptResult(
|
||||
value: data["value"], error: data["error"]);
|
||||
}
|
||||
|
||||
///Saves the current WebView as a web archive.
|
||||
@ -1919,7 +2069,7 @@ class InAppWebViewController {
|
||||
assert(filePath.endsWith("." + WebArchiveFormat.WEBARCHIVE.toValue()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent("filePath", () => filePath);
|
||||
args.putIfAbsent("autoname", () => autoname);
|
||||
@ -1932,8 +2082,7 @@ class InAppWebViewController {
|
||||
///**NOTE for Android**: available Android 21.0+.
|
||||
Future<bool> isSecureContext() async {
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
return await _channel
|
||||
.invokeMethod('isSecureContext', args);
|
||||
return await _channel.invokeMethod('isSecureContext', args);
|
||||
}
|
||||
|
||||
///Gets the default user agent.
|
||||
@ -1943,4 +2092,4 @@ class InAppWebViewController {
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
return await _staticChannel.invokeMethod('getDefaultUserAgent', args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,10 @@ class InAppWebViewGroupOptions {
|
||||
///iOS-specific options.
|
||||
late IOSInAppWebViewOptions ios;
|
||||
|
||||
InAppWebViewGroupOptions({InAppWebViewOptions? crossPlatform, AndroidInAppWebViewOptions? android, IOSInAppWebViewOptions? ios}) {
|
||||
InAppWebViewGroupOptions(
|
||||
{InAppWebViewOptions? crossPlatform,
|
||||
AndroidInAppWebViewOptions? android,
|
||||
IOSInAppWebViewOptions? ios}) {
|
||||
this.crossPlatform = crossPlatform ?? InAppWebViewOptions();
|
||||
this.android = android ?? AndroidInAppWebViewOptions();
|
||||
this.ios = ios ?? IOSInAppWebViewOptions();
|
||||
@ -52,14 +55,15 @@ class InAppWebViewGroupOptions {
|
||||
options.addAll(this.crossPlatform.toMap());
|
||||
if (defaultTargetPlatform == TargetPlatform.android)
|
||||
options.addAll(this.android.toMap());
|
||||
else if (defaultTargetPlatform == TargetPlatform.iOS) options.addAll(this.ios.toMap());
|
||||
else if (defaultTargetPlatform == TargetPlatform.iOS)
|
||||
options.addAll(this.ios.toMap());
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
static InAppWebViewGroupOptions fromMap(Map<String, dynamic> options) {
|
||||
InAppWebViewGroupOptions inAppWebViewGroupOptions =
|
||||
InAppWebViewGroupOptions();
|
||||
InAppWebViewGroupOptions();
|
||||
|
||||
inAppWebViewGroupOptions.crossPlatform =
|
||||
InAppWebViewOptions.fromMap(options);
|
||||
@ -229,7 +233,8 @@ class InAppWebViewOptions
|
||||
this.allowFileAccessFromFileURLs = false,
|
||||
this.allowUniversalAccessFromFileURLs = false}) {
|
||||
if (this.minimumFontSize == null)
|
||||
this.minimumFontSize = defaultTargetPlatform == TargetPlatform.android ? 8 : 0;
|
||||
this.minimumFontSize =
|
||||
defaultTargetPlatform == TargetPlatform.android ? 8 : 0;
|
||||
assert(!this.resourceCustomSchemes.contains("http") &&
|
||||
!this.resourceCustomSchemes.contains("https"));
|
||||
}
|
||||
@ -313,7 +318,8 @@ class InAppWebViewOptions
|
||||
options.disableContextMenu = map["disableContextMenu"];
|
||||
options.supportZoom = map["supportZoom"];
|
||||
options.allowFileAccessFromFileURLs = map["allowFileAccessFromFileURLs"];
|
||||
options.allowUniversalAccessFromFileURLs = map["allowUniversalAccessFromFileURLs"];
|
||||
options.allowUniversalAccessFromFileURLs =
|
||||
map["allowUniversalAccessFromFileURLs"];
|
||||
return options;
|
||||
}
|
||||
|
||||
|
@ -33,9 +33,11 @@ class IOSInAppWebViewController {
|
||||
///**NOTE**: available only on iOS 14.0+.
|
||||
///
|
||||
///**Official iOS API**: https://developer.apple.com/documentation/webkit/wkwebview/3650490-createpdf
|
||||
Future<Uint8List?> createPdf({IOSWKPDFConfiguration? iosWKPdfConfiguration}) async {
|
||||
Future<Uint8List?> createPdf(
|
||||
{IOSWKPDFConfiguration? iosWKPdfConfiguration}) async {
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent('iosWKPdfConfiguration', () => iosWKPdfConfiguration?.toMap());
|
||||
args.putIfAbsent(
|
||||
'iosWKPdfConfiguration', () => iosWKPdfConfiguration?.toMap());
|
||||
return await _channel.invokeMethod('createPdf', args);
|
||||
}
|
||||
|
||||
@ -55,8 +57,7 @@ class IOSInAppWebViewController {
|
||||
///**Official iOS API**: https://developer.apple.com/documentation/webkit/wkwebview/1415002-hasonlysecurecontent
|
||||
Future<bool> hasOnlySecureContent() async {
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
return await _channel
|
||||
.invokeMethod('hasOnlySecureContent', args);
|
||||
return await _channel.invokeMethod('hasOnlySecureContent', args);
|
||||
}
|
||||
|
||||
///Returns a Boolean value that indicates whether WebKit natively supports resources with the specified URL scheme.
|
||||
@ -69,7 +70,6 @@ class IOSInAppWebViewController {
|
||||
static Future<bool> handlesURLScheme(String urlScheme) async {
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent('urlScheme', () => urlScheme);
|
||||
return await _staticChannel
|
||||
.invokeMethod('handlesURLScheme', args);
|
||||
return await _staticChannel.invokeMethod('handlesURLScheme', args);
|
||||
}
|
||||
}
|
||||
|
@ -247,7 +247,8 @@ class IOSInAppWebViewOptions
|
||||
this.applePayAPIEnabled = false,
|
||||
this.allowingReadAccessTo,
|
||||
this.disableLongPressContextMenuOnLinks = false}) {
|
||||
assert(allowingReadAccessTo == null || allowingReadAccessTo!.isScheme("file"));
|
||||
assert(
|
||||
allowingReadAccessTo == null || allowingReadAccessTo!.isScheme("file"));
|
||||
}
|
||||
|
||||
@override
|
||||
@ -283,7 +284,8 @@ class IOSInAppWebViewOptions
|
||||
"isPagingEnabled": isPagingEnabled,
|
||||
"maximumZoomScale": maximumZoomScale,
|
||||
"minimumZoomScale": minimumZoomScale,
|
||||
"contentInsetAdjustmentBehavior": contentInsetAdjustmentBehavior.toValue(),
|
||||
"contentInsetAdjustmentBehavior":
|
||||
contentInsetAdjustmentBehavior.toValue(),
|
||||
"isDirectionalLockEnabled": isDirectionalLockEnabled,
|
||||
"mediaType": mediaType,
|
||||
"pageZoom": pageZoom,
|
||||
@ -300,7 +302,8 @@ class IOSInAppWebViewOptions
|
||||
List<String> dataDetectorTypesList =
|
||||
List<String>.from(map["dataDetectorTypes"] ?? []);
|
||||
dataDetectorTypesList.forEach((dataDetectorTypeValue) {
|
||||
var dataDetectorType = IOSWKDataDetectorTypes.fromValue(dataDetectorTypeValue);
|
||||
var dataDetectorType =
|
||||
IOSWKDataDetectorTypes.fromValue(dataDetectorTypeValue);
|
||||
if (dataDetectorType != null) {
|
||||
dataDetectorTypes.add(dataDetectorType);
|
||||
}
|
||||
@ -344,11 +347,15 @@ class IOSInAppWebViewOptions
|
||||
options.isDirectionalLockEnabled = map["isDirectionalLockEnabled"];
|
||||
options.mediaType = map["mediaType"];
|
||||
options.pageZoom = map["pageZoom"];
|
||||
options.limitsNavigationsToAppBoundDomains = map["limitsNavigationsToAppBoundDomains"];
|
||||
options.limitsNavigationsToAppBoundDomains =
|
||||
map["limitsNavigationsToAppBoundDomains"];
|
||||
options.useOnNavigationResponse = map["useOnNavigationResponse"];
|
||||
options.applePayAPIEnabled = map["applePayAPIEnabled"];
|
||||
options.allowingReadAccessTo = map["allowingReadAccessTo"] != null ? Uri.parse(map["allowingReadAccessTo"]) : null;
|
||||
options.disableLongPressContextMenuOnLinks = map["disableLongPressContextMenuOnLinks"];
|
||||
options.allowingReadAccessTo = map["allowingReadAccessTo"] != null
|
||||
? Uri.parse(map["allowingReadAccessTo"])
|
||||
: null;
|
||||
options.disableLongPressContextMenuOnLinks =
|
||||
map["disableLongPressContextMenuOnLinks"];
|
||||
return options;
|
||||
}
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
export 'in_app_webview_options.dart';
|
||||
export 'in_app_webview_controller.dart';
|
||||
export 'in_app_webview_controller.dart';
|
||||
|
@ -4,4 +4,4 @@ export 'in_app_webview_controller.dart';
|
||||
export 'in_app_webview_options.dart';
|
||||
export 'headless_in_app_webview.dart';
|
||||
export 'android/main.dart';
|
||||
export 'ios/main.dart';
|
||||
export 'ios/main.dart';
|
||||
|
@ -21,8 +21,7 @@ abstract class WebView {
|
||||
///**Official Android API**: https://developer.android.com/reference/android/webkit/WebViewClient#onPageStarted(android.webkit.WebView,%20java.lang.String,%20android.graphics.Bitmap)
|
||||
///
|
||||
///**Official iOS API**: https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455621-webview
|
||||
final void Function(InAppWebViewController controller, Uri? url)?
|
||||
onLoadStart;
|
||||
final void Function(InAppWebViewController controller, Uri? url)? onLoadStart;
|
||||
|
||||
///Event fired when the [WebView] finishes loading an [url].
|
||||
///
|
||||
@ -126,8 +125,7 @@ abstract class WebView {
|
||||
///
|
||||
///**Official iOS API**: https://developer.apple.com/documentation/webkit/wkurlschemehandler
|
||||
final Future<CustomSchemeResponse?> Function(
|
||||
InAppWebViewController controller, Uri url)?
|
||||
onLoadResourceCustomScheme;
|
||||
InAppWebViewController controller, Uri url)? onLoadResourceCustomScheme;
|
||||
|
||||
///Event fired when the [WebView] requests the host application to create a new window,
|
||||
///for example when trying to open a link with `target="_blank"` or when `window.open()` is called by JavaScript side.
|
||||
@ -221,9 +219,8 @@ abstract class WebView {
|
||||
///**Official Android API**: https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedHttpAuthRequest(android.webkit.WebView,%20android.webkit.HttpAuthHandler,%20java.lang.String,%20java.lang.String)
|
||||
///
|
||||
///**Official iOS API**: https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview
|
||||
final Future<HttpAuthResponse?> Function(
|
||||
InAppWebViewController controller, HttpAuthenticationChallenge challenge)?
|
||||
onReceivedHttpAuthRequest;
|
||||
final Future<HttpAuthResponse?> Function(InAppWebViewController controller,
|
||||
HttpAuthenticationChallenge challenge)? onReceivedHttpAuthRequest;
|
||||
|
||||
///Event fired when the WebView need to perform server trust authentication (certificate validation).
|
||||
///The host application must return either [ServerTrustAuthResponse] instance with [ServerTrustAuthResponseAction.CANCEL] or [ServerTrustAuthResponseAction.PROCEED].
|
||||
@ -396,8 +393,10 @@ abstract class WebView {
|
||||
///**NOTE**: available only on Android 27+.
|
||||
///
|
||||
///**Official Android API**: https://developer.android.com/reference/android/webkit/WebViewClient#onSafeBrowsingHit(android.webkit.WebView,%20android.webkit.WebResourceRequest,%20int,%20android.webkit.SafeBrowsingResponse)
|
||||
final Future<SafeBrowsingResponse?> Function(InAppWebViewController controller,
|
||||
Uri url, SafeBrowsingThreat? threatType)? androidOnSafeBrowsingHit;
|
||||
final Future<SafeBrowsingResponse?> Function(
|
||||
InAppWebViewController controller,
|
||||
Uri url,
|
||||
SafeBrowsingThreat? threatType)? androidOnSafeBrowsingHit;
|
||||
|
||||
///Event fired when the WebView is requesting permission to access the specified resources and the permission currently isn't granted or denied.
|
||||
///
|
||||
@ -602,9 +601,9 @@ abstract class WebView {
|
||||
///
|
||||
///
|
||||
///**Official iOS API**: https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview
|
||||
final Future<IOSNavigationResponseAction?> Function(InAppWebViewController controller,
|
||||
IOSWKNavigationResponse navigationResponse)?
|
||||
iosOnNavigationResponse;
|
||||
final Future<IOSNavigationResponseAction?> Function(
|
||||
InAppWebViewController controller,
|
||||
IOSWKNavigationResponse navigationResponse)? iosOnNavigationResponse;
|
||||
|
||||
///Called when a web view asks whether to continue with a connection that uses a deprecated version of TLS (v1.0 and v1.1).
|
||||
///
|
||||
@ -613,9 +612,9 @@ abstract class WebView {
|
||||
///**NOTE**: available only on iOS 14.0+.
|
||||
///
|
||||
///**Official iOS API**: https://developer.apple.com/documentation/webkit/wknavigationdelegate/3601237-webview
|
||||
final Future<IOSShouldAllowDeprecatedTLSAction?> Function(InAppWebViewController controller,
|
||||
URLAuthenticationChallenge challenge)?
|
||||
iosShouldAllowDeprecatedTLS;
|
||||
final Future<IOSShouldAllowDeprecatedTLSAction?> Function(
|
||||
InAppWebViewController controller,
|
||||
URLAuthenticationChallenge challenge)? iosShouldAllowDeprecatedTLS;
|
||||
|
||||
///Initial url request that will be loaded.
|
||||
///
|
||||
|
@ -0,0 +1 @@
|
||||
|
@ -13,4 +13,4 @@ export 'cookie_manager.dart';
|
||||
export 'in_app_localhost_server.dart';
|
||||
export 'content_blocker.dart';
|
||||
export 'http_auth_credentials_database.dart';
|
||||
export 'context_menu.dart';
|
||||
export 'context_menu.dart';
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -449,4 +449,4 @@ extension HexColor on Color {
|
||||
'${red.toRadixString(16).padLeft(2, '0')}'
|
||||
'${green.toRadixString(16).padLeft(2, '0')}'
|
||||
'${blue.toRadixString(16).padLeft(2, '0')}';
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
const WEB_STORAGE_STATIC_CHANNEL = const MethodChannel('com.pichillilorenzo/flutter_inappwebview_webstoragemanager');
|
||||
const WEB_STORAGE_STATIC_CHANNEL = const MethodChannel(
|
||||
'com.pichillilorenzo/flutter_inappwebview_webstoragemanager');
|
||||
|
@ -1 +1 @@
|
||||
export 'web_storage_manager.dart';
|
||||
export 'web_storage_manager.dart';
|
||||
|
@ -50,8 +50,7 @@ class AndroidWebStorageManager {
|
||||
Future<int> getQuotaForOrigin({required String origin}) async {
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent("origin", () => origin);
|
||||
return await _staticChannel
|
||||
.invokeMethod('getQuotaForOrigin', args);
|
||||
return await _staticChannel.invokeMethod('getQuotaForOrigin', args);
|
||||
}
|
||||
|
||||
///Gets the amount of storage currently being used by both the Application Cache and Web SQL Database APIs by the given [origin].
|
||||
@ -59,7 +58,6 @@ class AndroidWebStorageManager {
|
||||
Future<int> getUsageForOrigin({required String origin}) async {
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent("origin", () => origin);
|
||||
return await _staticChannel
|
||||
.invokeMethod('getUsageForOrigin', args);
|
||||
return await _staticChannel.invokeMethod('getUsageForOrigin', args);
|
||||
}
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
export 'web_storage_manager.dart';
|
||||
export 'web_storage_manager.dart';
|
||||
|
@ -24,9 +24,9 @@ class IOSWebStorageManager {
|
||||
}
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent("dataTypes", () => dataTypesList);
|
||||
List<Map<dynamic, dynamic>> records = (await _staticChannel
|
||||
.invokeMethod('fetchDataRecords', args))
|
||||
.cast<Map<dynamic, dynamic>>();
|
||||
List<Map<dynamic, dynamic>> records =
|
||||
(await _staticChannel.invokeMethod('fetchDataRecords', args))
|
||||
.cast<Map<dynamic, dynamic>>();
|
||||
for (var record in records) {
|
||||
List<String> dataTypesString = record["dataTypes"].cast<String>();
|
||||
Set<IOSWKWebsiteDataType> dataTypes = Set();
|
||||
@ -84,7 +84,6 @@ class IOSWebStorageManager {
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent("dataTypes", () => dataTypesList);
|
||||
args.putIfAbsent("timestamp", () => timestamp);
|
||||
await _staticChannel
|
||||
.invokeMethod('removeDataModifiedSince', args);
|
||||
await _staticChannel.invokeMethod('removeDataModifiedSince', args);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
export 'web_storage.dart';
|
||||
export 'web_storage_manager.dart';
|
||||
export 'android/main.dart';
|
||||
export 'ios/main.dart';
|
||||
export 'ios/main.dart';
|
||||
|
@ -30,4 +30,4 @@ class WebStorageManager {
|
||||
}
|
||||
|
||||
static Future<dynamic> _handleMethod(MethodCall call) async {}
|
||||
}
|
||||
}
|
||||
|
@ -2,26 +2,25 @@ import 'dart:typed_data';
|
||||
import 'asn1_identifier.dart';
|
||||
|
||||
class ASN1DEREncoder {
|
||||
static Uint8List encodeSequence({required Uint8List content}) {
|
||||
var encoded = Uint8List.fromList([]);
|
||||
encoded.add(ASN1Identifier.constructedTag |
|
||||
ASN1IdentifierTagNumber.SEQUENCE.toValue());
|
||||
encoded.addAll(contentLength(size: content.length));
|
||||
encoded.addAll(content);
|
||||
return Uint8List.fromList(encoded);
|
||||
}
|
||||
|
||||
static Uint8List encodeSequence({required Uint8List content}) {
|
||||
var encoded = Uint8List.fromList([]);
|
||||
encoded.add(ASN1Identifier.constructedTag | ASN1IdentifierTagNumber.SEQUENCE.toValue());
|
||||
encoded.addAll(contentLength(size: content.length));
|
||||
encoded.addAll(content);
|
||||
return Uint8List.fromList(encoded);
|
||||
static Uint8List contentLength({required int size}) {
|
||||
if (size >= 128) {
|
||||
var lenBytes = Uint8List(size);
|
||||
while (lenBytes.first == 0) {
|
||||
lenBytes.removeAt(0);
|
||||
}
|
||||
int len = 0x80 | lenBytes.length;
|
||||
return Uint8List(len)..addAll(lenBytes);
|
||||
} else {
|
||||
return Uint8List(size);
|
||||
}
|
||||
|
||||
static Uint8List contentLength({required int size}) {
|
||||
if (size >= 128) {
|
||||
var lenBytes = Uint8List(size);
|
||||
while (lenBytes.first == 0) {
|
||||
lenBytes.removeAt(0);
|
||||
}
|
||||
int len = 0x80 | lenBytes.length;
|
||||
return Uint8List(len)..addAll(lenBytes);
|
||||
} else {
|
||||
return Uint8List(size);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -97,12 +97,12 @@ class ASN1DistinguishedNames {
|
||||
}
|
||||
|
||||
static String quote(String string) {
|
||||
var specialChars = [",", "+", "=", "\n", "<", ">", "#", ";", "\\"];
|
||||
for (var specialChar in specialChars) {
|
||||
if (string.contains(specialChar)) {
|
||||
return "\"" + string + "\"";
|
||||
}
|
||||
var specialChars = [",", "+", "=", "\n", "<", ">", "#", ";", "\\"];
|
||||
for (var specialChar in specialChars) {
|
||||
if (string.contains(specialChar)) {
|
||||
return "\"" + string + "\"";
|
||||
}
|
||||
return string;
|
||||
}
|
||||
return string;
|
||||
}
|
||||
}
|
||||
|
@ -13,8 +13,8 @@ class ASN1IdentifierClass {
|
||||
static ASN1IdentifierClass? fromValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return ASN1IdentifierClass.values.firstWhere(
|
||||
(element) => element.toValue() == value);
|
||||
return ASN1IdentifierClass.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
@ -90,8 +90,8 @@ class ASN1IdentifierTagNumber {
|
||||
static ASN1IdentifierTagNumber? fromValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return ASN1IdentifierTagNumber.values.firstWhere(
|
||||
(element) => element.toValue() == value);
|
||||
return ASN1IdentifierTagNumber.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
|
@ -18,7 +18,8 @@ class KeyUsage {
|
||||
static KeyUsage? fromIndex(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return KeyUsage.values.firstWhere((element) => element.toValue() == value);
|
||||
return KeyUsage.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
@ -28,7 +29,9 @@ class KeyUsage {
|
||||
|
||||
int toValue() => _value;
|
||||
|
||||
String name() => _KeyUsageMapName.containsKey(this._value) ? _KeyUsageMapName[this._value]! : "";
|
||||
String name() => _KeyUsageMapName.containsKey(this._value)
|
||||
? _KeyUsageMapName[this._value]!
|
||||
: "";
|
||||
|
||||
@override
|
||||
String toString() => "($_value, ${name()})";
|
||||
|
@ -9,4 +9,4 @@ export 'key_usage.dart';
|
||||
export 'x509_certificate.dart';
|
||||
export 'x509_extension.dart';
|
||||
export 'x509_public_key.dart';
|
||||
export 'asn1_der_encoder.dart';
|
||||
export 'asn1_der_encoder.dart';
|
||||
|
@ -120,7 +120,8 @@ class OID {
|
||||
|
||||
String toValue() => _value;
|
||||
|
||||
String name() => _oidMapName.containsKey(this._value) ? _oidMapName[this._value]! : "";
|
||||
String name() =>
|
||||
_oidMapName.containsKey(this._value) ? _oidMapName[this._value]! : "";
|
||||
|
||||
@override
|
||||
String toString() => "($_value, ${name()})";
|
||||
|
@ -96,7 +96,9 @@ class X509Certificate {
|
||||
}
|
||||
|
||||
String get description =>
|
||||
asn1?.fold("", (value, element) => (value ?? '') + element.description + '\n') ?? '';
|
||||
asn1?.fold(
|
||||
"", (value, element) => (value ?? '') + element.description + '\n') ??
|
||||
'';
|
||||
|
||||
///Checks that the given date is within the certificate's validity period.
|
||||
bool checkValidity({DateTime? date}) {
|
||||
@ -222,20 +224,22 @@ class X509Certificate {
|
||||
|
||||
///Gets the notAfter date from the validity period of the certificate.
|
||||
DateTime? get notAfter {
|
||||
var value = block1?.atIndex(X509BlockPosition.dateValidity)
|
||||
var value = block1
|
||||
?.atIndex(X509BlockPosition.dateValidity)
|
||||
?.subAtIndex(1)
|
||||
?.value as DateTime?;
|
||||
return value;
|
||||
}
|
||||
|
||||
///Gets the signature value (the raw signature bits) from the certificate.
|
||||
List<int>? get signature => asn1?[0].subAtIndex(2)?.value as List<int>;
|
||||
List<int>? get signature => asn1?[0].subAtIndex(2)?.value as List<int>;
|
||||
|
||||
///Gets the signature algorithm name for the certificate signature algorithm.
|
||||
String? get sigAlgName => OID.fromValue(sigAlgOID ?? '')?.name();
|
||||
|
||||
///Gets the signature algorithm OID string from the certificate.
|
||||
String? get sigAlgOID => block1?.subAtIndex(2)?.subAtIndex(0)?.value as String?;
|
||||
String? get sigAlgOID =>
|
||||
block1?.subAtIndex(2)?.subAtIndex(0)?.value as String?;
|
||||
|
||||
///Gets the DER-encoded signature algorithm parameters from this certificate's signature algorithm.
|
||||
List<int>? get sigAlgParams => null;
|
||||
@ -278,11 +282,13 @@ class X509Certificate {
|
||||
|
||||
///Gets a collection of subject alternative names from the SubjectAltName extension, (OID = 2.5.29.17).
|
||||
List<String> get subjectAlternativeNames =>
|
||||
extensionObject(oid: OID.subjectAltName)?.alternativeNameAsStrings ?? <String>[];
|
||||
extensionObject(oid: OID.subjectAltName)?.alternativeNameAsStrings ??
|
||||
<String>[];
|
||||
|
||||
///Gets a collection of issuer alternative names from the IssuerAltName extension, (OID = 2.5.29.18).
|
||||
List<String> get issuerAlternativeNames =>
|
||||
extensionObject(oid: OID.issuerAltName)?.alternativeNameAsStrings ?? <String>[];
|
||||
extensionObject(oid: OID.issuerAltName)?.alternativeNameAsStrings ??
|
||||
<String>[];
|
||||
|
||||
///Gets the informations of the public key from this certificate.
|
||||
X509PublicKey? get publicKey {
|
||||
@ -321,24 +327,35 @@ class X509Certificate {
|
||||
|
||||
///Gets the certificate constraints path length from the
|
||||
///critical BasicConstraints extension, (OID = 2.5.29.19).
|
||||
BasicConstraintExtension? get basicConstraints => extensionObject(oid: OID.basicConstraints) as BasicConstraintExtension?;
|
||||
BasicConstraintExtension? get basicConstraints =>
|
||||
extensionObject(oid: OID.basicConstraints) as BasicConstraintExtension?;
|
||||
|
||||
///Gets the raw bits from the Subject Key Identifier (SKID) extension, (OID = 2.5.29.14).
|
||||
SubjectKeyIdentifierExtension? get subjectKeyIdentifier => extensionObject(oid: OID.subjectKeyIdentifier) as SubjectKeyIdentifierExtension?;
|
||||
SubjectKeyIdentifierExtension? get subjectKeyIdentifier =>
|
||||
extensionObject(oid: OID.subjectKeyIdentifier)
|
||||
as SubjectKeyIdentifierExtension?;
|
||||
|
||||
///Gets the raw bits from the Authority Key Identifier extension, (OID = 2.5.29.35).
|
||||
AuthorityKeyIdentifierExtension? get authorityKeyIdentifier => extensionObject(oid: OID.authorityKeyIdentifier) as AuthorityKeyIdentifierExtension?;
|
||||
AuthorityKeyIdentifierExtension? get authorityKeyIdentifier =>
|
||||
extensionObject(oid: OID.authorityKeyIdentifier)
|
||||
as AuthorityKeyIdentifierExtension?;
|
||||
|
||||
///Gets the list of certificate policies from the CertificatePolicies extension, (OID = 2.5.29.32).
|
||||
CertificatePoliciesExtension? get certificatePolicies => extensionObject(oid: OID.certificatePolicies) as CertificatePoliciesExtension?;
|
||||
CertificatePoliciesExtension? get certificatePolicies =>
|
||||
extensionObject(oid: OID.certificatePolicies)
|
||||
as CertificatePoliciesExtension?;
|
||||
|
||||
///Gets the list of CRL distribution points from the CRLDistributionPoints extension, (OID = 2.5.29.31).
|
||||
CRLDistributionPointsExtension? get cRLDistributionPoints => extensionObject(oid: OID.cRLDistributionPoints) as CRLDistributionPointsExtension?;
|
||||
CRLDistributionPointsExtension? get cRLDistributionPoints =>
|
||||
extensionObject(oid: OID.cRLDistributionPoints)
|
||||
as CRLDistributionPointsExtension?;
|
||||
|
||||
///Gets the map of the format (as a key) and location (as a value) of additional information
|
||||
///about the CA who issued the certificate in which this extension appears
|
||||
///from the AuthorityInfoAccess extension, (OID = 1.3.6.1.5.5.5.7.1.1).
|
||||
AuthorityInfoAccessExtension? get authorityInfoAccess => extensionObject(oid: OID.authorityInfoAccess) as AuthorityInfoAccessExtension?;
|
||||
AuthorityInfoAccessExtension? get authorityInfoAccess =>
|
||||
extensionObject(oid: OID.authorityInfoAccess)
|
||||
as AuthorityInfoAccessExtension?;
|
||||
|
||||
List<ASN1Object>? get extensionBlocks =>
|
||||
block1?.atIndex(X509BlockPosition.extensions)?.subAtIndex(0)?.sub;
|
||||
@ -349,7 +366,8 @@ class X509Certificate {
|
||||
oidValue = oid.toValue();
|
||||
}
|
||||
if (oidValue != null) {
|
||||
var block = block1?.atIndex(X509BlockPosition.extensions)
|
||||
var block = block1
|
||||
?.atIndex(X509BlockPosition.extensions)
|
||||
?.findOid(oidValue: oidValue)
|
||||
?.parent;
|
||||
if (block != null) {
|
||||
|
@ -87,7 +87,7 @@ class X509Extension {
|
||||
for (var item in sub) {
|
||||
var name = generalName(item: item);
|
||||
if (name != null) {
|
||||
result.add(name);
|
||||
result.add(name);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@ -139,7 +139,8 @@ class X509Extension {
|
||||
class BasicConstraintExtension extends X509Extension {
|
||||
BasicConstraintExtension({required block}) : super(block: block);
|
||||
|
||||
bool get isCA => valueAsBlock?.subAtIndex(0)?.subAtIndex(0)?.value as bool? ?? false;
|
||||
bool get isCA =>
|
||||
valueAsBlock?.subAtIndex(0)?.subAtIndex(0)?.value as bool? ?? false;
|
||||
|
||||
int? get pathLenConstraint {
|
||||
var data = valueAsBlock?.subAtIndex(0)?.subAtIndex(0)?.value as List<int>?;
|
||||
@ -270,11 +271,12 @@ class AuthorityKeyIdentifierExtension extends X509Extension {
|
||||
List<int>? get keyIdentifier {
|
||||
var sequence = valueAsBlock?.subAtIndex(0)?.sub;
|
||||
if (sequence == null) {
|
||||
return null;
|
||||
return null;
|
||||
}
|
||||
ASN1Object? sub;
|
||||
try {
|
||||
sub = sequence.firstWhere((element) => element.identifier?.tagNumber().toValue() == 0);
|
||||
sub = sequence.firstWhere(
|
||||
(element) => element.identifier?.tagNumber().toValue() == 0);
|
||||
return sub.encoded;
|
||||
} catch (e) {}
|
||||
return null;
|
||||
@ -287,7 +289,8 @@ class AuthorityKeyIdentifierExtension extends X509Extension {
|
||||
}
|
||||
ASN1Object? sub;
|
||||
try {
|
||||
sub = sequence.firstWhere((element) => element.identifier?.tagNumber().toValue() == 1);
|
||||
sub = sequence.firstWhere(
|
||||
(element) => element.identifier?.tagNumber().toValue() == 1);
|
||||
List<String>? result;
|
||||
if (sub.sub != null) {
|
||||
result = <String>[];
|
||||
@ -310,7 +313,8 @@ class AuthorityKeyIdentifierExtension extends X509Extension {
|
||||
}
|
||||
ASN1Object? sub;
|
||||
try {
|
||||
sub = sequence.firstWhere((element) => element.identifier?.tagNumber().toValue() == 2);
|
||||
sub = sequence.firstWhere(
|
||||
(element) => element.identifier?.tagNumber().toValue() == 2);
|
||||
return sub.encoded;
|
||||
} catch (e) {}
|
||||
return null;
|
||||
@ -356,6 +360,7 @@ class CertificatePolicyQualifier {
|
||||
return toMap();
|
||||
}
|
||||
}
|
||||
|
||||
class CertificatePolicy {
|
||||
String oid;
|
||||
List<CertificatePolicyQualifier>? qualifiers;
|
||||
@ -472,4 +477,4 @@ class CRLDistributionPointsExtension extends X509Extension {
|
||||
Map<String, dynamic> toJson() {
|
||||
return toMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,9 +10,9 @@ environment:
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
uuid: ^3.0.0-nullsafety.0
|
||||
mime: ^1.0.0-nullsafety.0
|
||||
intl: ^0.17.0-nullsafety.2
|
||||
uuid: ^3.0.0-nullsafety.1
|
||||
mime: ^1.0.0
|
||||
intl: ^0.17.0
|
||||
device_info: ^2.0.0-nullsafety.2
|
||||
|
||||
dev_dependencies:
|
||||
|
Loading…
x
Reference in New Issue
Block a user