updated docs, updated README.md

This commit is contained in:
Lorenzo Pichilli 2019-11-25 23:04:17 +01:00
parent 3dd7d17574
commit 08b392e8b1
10 changed files with 779 additions and 1355 deletions

View File

@ -16,14 +16,15 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="9b41f7a2-a71e-4923-91fb-249d7815b3e7" name="Default" comment=""> <list default="true" id="9b41f7a2-a71e-4923-91fb-249d7815b3e7" name="Default" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserActivity.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserActivity.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserFlutterPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserFlutterPlugin.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/example/assets/certificate.pfx" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/example/assets/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/example/assets/index.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/ios/Flutter/flutter_export_environment.sh" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/Flutter/flutter_export_environment.sh" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/lib/chrome_safari_browser_example.screen.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/lib/chrome_safari_browser_example.screen.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/lib/in_app_browser_example.screen.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/lib/in_app_browser_example.screen.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/lib/in_app_webiew_example.screen.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/lib/in_app_webiew_example.screen.dart" afterDir="false" /> <change beforePath="$PROJECT_DIR$/example/lib/in_app_webiew_example.screen.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/lib/in_app_webiew_example.screen.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/lib/main.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/lib/main.dart" afterDir="false" /> <change beforePath="$PROJECT_DIR$/example/pubspec.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/example/pubspec.yaml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/chrome_safari_browser.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/chrome_safari_browser.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/cookie_manager.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/cookie_manager.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/in_app_browser.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/in_app_browser.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/in_app_webview.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/in_app_webview.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/webview_options.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/webview_options.dart" afterDir="false" />
</list> </list>
<ignored path="$PROJECT_DIR$/.dart_tool/" /> <ignored path="$PROJECT_DIR$/.dart_tool/" />
<ignored path="$PROJECT_DIR$/.idea/" /> <ignored path="$PROJECT_DIR$/.idea/" />
@ -43,11 +44,25 @@
<component name="ExecutionTargetManager" SELECTED_TARGET="Pixel_3_XL_API_24" /> <component name="ExecutionTargetManager" SELECTED_TARGET="Pixel_3_XL_API_24" />
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="349">
<caret line="303" column="38" lean-forward="true" selection-start-line="303" selection-start-column="38" selection-end-line="303" selection-end-column="38" />
<folding>
<element signature="e#0#20#0" expanded="true" />
<element signature="e#0#39#0" expanded="true" />
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/in_app_webview.dart"> <entry file="file://$PROJECT_DIR$/lib/src/in_app_webview.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="7854"> <state relative-caret-position="325">
<caret line="1362" column="38" selection-start-line="1362" selection-start-column="38" selection-end-line="1362" selection-end-column="38" /> <caret line="1176" column="41" selection-start-line="1176" selection-start-column="41" selection-end-line="1176" selection-end-column="41" />
<folding> <folding>
<element signature="e#0#17#0" expanded="true" /> <element signature="e#0#17#0" expanded="true" />
</folding> </folding>
@ -56,58 +71,10 @@
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/lib/in_app_webiew_example.screen.dart"> <entry file="file://$PROJECT_DIR$/pubspec.yaml">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="219"> <state relative-caret-position="120">
<caret line="33" column="24" selection-start-line="33" selection-start-column="24" selection-end-line="33" selection-end-column="24" /> <caret line="8" column="36" selection-start-line="8" selection-start-column="11" selection-end-line="8" selection-end-column="36" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/lib/in_app_browser_example.screen.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="195">
<caret line="13" column="11" selection-start-line="13" selection-start-column="11" selection-end-line="13" selection-end-column="11" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/lib/chrome_safari_browser_example.screen.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="345">
<caret line="23" selection-start-line="23" selection-end-line="23" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/example/assets/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="180">
<caret line="12" column="26" selection-start-line="12" selection-start-column="26" selection-end-line="12" selection-end-column="26" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/lib/main.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="130">
<caret line="16" column="15" selection-start-line="16" selection-start-column="7" selection-end-line="16" selection-end-column="15" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
@ -124,22 +91,6 @@
</component> </component>
<component name="FindInProjectRecents"> <component name="FindInProjectRecents">
<findStrings> <findStrings>
<find>onReceivedHttpAuthRequest</find>
<find>onLoadHtt</find>
<find>onLoadError</find>
<find>startSafeBrowsing</find>
<find>onSafeBrowsingHit</find>
<find>dispose</find>
<find>onSafe</find>
<find>192.1</find>
<find>flutter</find>
<find>InAppWebView</find>
<find>onFindResultReceived</find>
<find>highlighted</find>
<find>onLoadErr</find>
<find>InAppWebViewInitialFileTest</find>
<find>InAppWebViewInitialDataTest</find>
<find>Fetch</find>
<find>OnLoadHttpError</find> <find>OnLoadHttpError</find>
<find>ONnaviga</find> <find>ONnaviga</find>
<find>InAppWebViewOnNavigationChangeTest</find> <find>InAppWebViewOnNavigationChangeTest</find>
@ -154,12 +105,29 @@
<find>InAppWebViewOnConsoleMessageTest</find> <find>InAppWebViewOnConsoleMessageTest</find>
<find>Change:</find> <find>Change:</find>
<find>InAppWebViewOnScrollChangedTest</find> <find>InAppWebViewOnScrollChangedTest</find>
<find>for Android</find>
<find>Event fired</find>
<find>an re</find>
<find>Event fires</find>
<find>only for Android.</find>
<find>isOpened</find>
<find>initialScale</find>
<find>e spinner when the WebView is loading a page. The default value i</find>
<find>reload</find>
<find>methods</find>
<find>class</find>
<find>HttpAuthCredentialDatabase</find>
<find>###</find>
<find>#####</find>
<find>loadFile</find>
<find>window.</find>
</findStrings> </findStrings>
<replaceStrings> <replaceStrings>
<replace>activity.getPreferences(0)</replace> <replace>activity.getPreferences(0)</replace>
<replace>Log.</replace> <replace>Log.</replace>
<replace>com.pichillilorenzo.flutter_inappbrowser</replace> <replace>com.pichillilorenzo.flutter_inappbrowser</replace>
<replace>flutter_inappbrowser</replace> <replace>flutter_inappbrowser</replace>
<replace>Event fired</replace>
</replaceStrings> </replaceStrings>
<dirStrings> <dirStrings>
<dir>$PROJECT_DIR$/example/android</dir> <dir>$PROJECT_DIR$/example/android</dir>
@ -171,9 +139,6 @@
<component name="IdeDocumentHistory"> <component name="IdeDocumentHistory">
<option name="CHANGED_PATHS"> <option name="CHANGED_PATHS">
<list> <list>
<option value="$PROJECT_DIR$/example/test_assets/in_app_webview_on_target_blank_test.html" />
<option value="$PROJECT_DIR$/CHANGELOG.md" />
<option value="$PROJECT_DIR$/lib/src/in_app_browser.dart" />
<option value="$PROJECT_DIR$/tool/env.dart" /> <option value="$PROJECT_DIR$/tool/env.dart" />
<option value="$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/index.js" /> <option value="$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/index.js" />
<option value="$PROJECT_DIR$/example/test_assets/in_app_webview_on_navigation_change_test.html" /> <option value="$PROJECT_DIR$/example/test_assets/in_app_webview_on_navigation_change_test.html" />
@ -182,10 +147,8 @@
<option value="$PROJECT_DIR$/example/test_assets/in_app_webview_on_navigation_state_change_test.html" /> <option value="$PROJECT_DIR$/example/test_assets/in_app_webview_on_navigation_state_change_test.html" />
<option value="$PROJECT_DIR$/lib/src/content_blocker.dart" /> <option value="$PROJECT_DIR$/lib/src/content_blocker.dart" />
<option value="$PROJECT_DIR$/lib/src/types.dart" /> <option value="$PROJECT_DIR$/lib/src/types.dart" />
<option value="$PROJECT_DIR$/lib/src/cookie_manager.dart" />
<option value="$PROJECT_DIR$/example/test_driver/app.dart" /> <option value="$PROJECT_DIR$/example/test_driver/app.dart" />
<option value="$PROJECT_DIR$/example/test_driver/util_test.dart" /> <option value="$PROJECT_DIR$/example/test_driver/util_test.dart" />
<option value="$PROJECT_DIR$/lib/src/webview_options.dart" />
<option value="$PROJECT_DIR$/example/test_driver/custom_widget_test.dart" /> <option value="$PROJECT_DIR$/example/test_driver/custom_widget_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_initial_url_test.dart" /> <option value="$PROJECT_DIR$/example/test_driver/in_app_webview_initial_url_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_ajax_test.dart" /> <option value="$PROJECT_DIR$/example/test_driver/in_app_webview_ajax_test.dart" />
@ -215,13 +178,18 @@
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_ssl_request_test.dart" /> <option value="$PROJECT_DIR$/example/test_driver/in_app_webview_ssl_request_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_http_auth_credential_database_test.dart" /> <option value="$PROJECT_DIR$/example/test_driver/in_app_webview_http_auth_credential_database_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_load_http_error_test.dart" /> <option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_load_http_error_test.dart" />
<option value="$PROJECT_DIR$/lib/src/in_app_webview.dart" />
<option value="$PROJECT_DIR$/example/pubspec.yaml" />
<option value="$PROJECT_DIR$/example/lib/main.dart" />
<option value="$PROJECT_DIR$/example/lib/in_app_webiew_example.screen.dart" />
<option value="$PROJECT_DIR$/example/lib/in_app_browser_example.screen.dart" /> <option value="$PROJECT_DIR$/example/lib/in_app_browser_example.screen.dart" />
<option value="$PROJECT_DIR$/example/lib/chrome_safari_browser_example.screen.dart" /> <option value="$PROJECT_DIR$/example/lib/chrome_safari_browser_example.screen.dart" />
<option value="$PROJECT_DIR$/example/assets/index.html" /> <option value="$PROJECT_DIR$/example/assets/index.html" />
<option value="$PROJECT_DIR$/example/pubspec.yaml" />
<option value="$PROJECT_DIR$/lib/src/webview_options.dart" />
<option value="$PROJECT_DIR$/lib/src/in_app_browser.dart" />
<option value="$PROJECT_DIR$/example/lib/main.dart" />
<option value="$PROJECT_DIR$/lib/src/chrome_safari_browser.dart" />
<option value="$PROJECT_DIR$/example/lib/in_app_webiew_example.screen.dart" />
<option value="$PROJECT_DIR$/lib/src/cookie_manager.dart" />
<option value="$PROJECT_DIR$/README.md" />
<option value="$PROJECT_DIR$/lib/src/in_app_webview.dart" />
</list> </list>
</option> </option>
</component> </component>
@ -276,6 +244,7 @@
<select /> <select />
</subPane> </subPane>
</pane> </pane>
<pane id="PackagesPane" />
<pane id="ProjectPane"> <pane id="ProjectPane">
<subPane> <subPane>
<expand> <expand>
@ -283,23 +252,6 @@
<item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" /> <item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
<item name="flutter_inappbrowser" type="462c0819:PsiDirectoryNode" /> <item name="flutter_inappbrowser" type="462c0819:PsiDirectoryNode" />
</path> </path>
<path>
<item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
<item name="flutter_inappbrowser" type="462c0819:PsiDirectoryNode" />
<item name="example" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
<item name="flutter_inappbrowser" type="462c0819:PsiDirectoryNode" />
<item name="example" type="462c0819:PsiDirectoryNode" />
<item name="assets" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
<item name="flutter_inappbrowser" type="462c0819:PsiDirectoryNode" />
<item name="example" type="462c0819:PsiDirectoryNode" />
<item name="lib" type="462c0819:PsiDirectoryNode" />
</path>
<path> <path>
<item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" /> <item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
<item name="flutter_inappbrowser" type="462c0819:PsiDirectoryNode" /> <item name="flutter_inappbrowser" type="462c0819:PsiDirectoryNode" />
@ -311,11 +263,6 @@
<item name="lib" type="462c0819:PsiDirectoryNode" /> <item name="lib" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" /> <item name="src" type="462c0819:PsiDirectoryNode" />
</path> </path>
<path>
<item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
<item name="flutter_inappbrowser" type="462c0819:PsiDirectoryNode" />
<item name="tool" type="462c0819:PsiDirectoryNode" />
</path>
<path> <path>
<item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" /> <item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
<item name="External Libraries" type="cb654da1:ExternalLibrariesNode" /> <item name="External Libraries" type="cb654da1:ExternalLibrariesNode" />
@ -324,7 +271,6 @@
<select /> <select />
</subPane> </subPane>
</pane> </pane>
<pane id="PackagesPane" />
</panes> </panes>
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
@ -486,7 +432,7 @@
<window_info id="Resources Explorer" order="8" /> <window_info id="Resources Explorer" order="8" />
<window_info anchor="bottom" id="Message" order="0" /> <window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" weight="0.32745314" /> <window_info anchor="bottom" id="Find" order="1" weight="0.32745314" />
<window_info anchor="bottom" id="Run" order="2" sideWeight="0.49478307" visible="true" weight="0.4580311" /> <window_info anchor="bottom" id="Run" order="2" sideWeight="0.49478307" weight="0.4580311" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.34196892" /> <window_info anchor="bottom" id="Debug" order="3" weight="0.34196892" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" /> <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" /> <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
@ -494,7 +440,7 @@
<window_info anchor="bottom" id="Android Profiler" order="7" show_stripe_button="false" /> <window_info anchor="bottom" id="Android Profiler" order="7" show_stripe_button="false" />
<window_info anchor="bottom" id="Event Log" order="8" sideWeight="0.50532484" side_tool="true" weight="0.35751295" /> <window_info anchor="bottom" id="Event Log" order="8" sideWeight="0.50532484" side_tool="true" weight="0.35751295" />
<window_info anchor="bottom" id="Version Control" order="9" /> <window_info anchor="bottom" id="Version Control" order="9" />
<window_info anchor="bottom" id="Terminal" order="10" sideWeight="0.4946752" weight="0.38860103" /> <window_info anchor="bottom" id="Terminal" order="10" sideWeight="0.4946752" visible="true" weight="0.38860103" />
<window_info anchor="bottom" id="Logcat" order="11" weight="0.32953367" /> <window_info anchor="bottom" id="Logcat" order="11" weight="0.32953367" />
<window_info anchor="bottom" id="Messages" order="12" sideWeight="0.4968051" weight="0.33782384" /> <window_info anchor="bottom" id="Messages" order="12" sideWeight="0.4968051" weight="0.33782384" />
<window_info anchor="bottom" id="Dependency Viewer" order="13" weight="0.32800853" /> <window_info anchor="bottom" id="Dependency Viewer" order="13" weight="0.32800853" />
@ -524,41 +470,6 @@
</ignored-roots> </ignored-roots>
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/pubspec.yaml">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/test.sh">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="90">
<caret line="6" selection-start-line="6" selection-end-line="6" selection-end-column="38" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/flutter/packages/flutter/lib/src/widgets/framework.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-654">
<caret line="936" column="15" selection-start-line="936" selection-start-column="15" selection-end-line="936" selection-end-column="15" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/content_blocker.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2025">
<caret line="135" column="1" selection-start-line="135" selection-start-column="1" selection-end-line="135" selection-end-column="1" />
<folding>
<element signature="e#0#41#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/cookie_manager.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="633">
<caret line="71" column="19" selection-start-line="71" selection-start-column="19" selection-end-line="71" selection-end-column="19" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/util_test.dart" />
<entry file="file://$USER_HOME$/flutter/packages/flutter_driver/lib/src/driver/driver.dart"> <entry file="file://$USER_HOME$/flutter/packages/flutter_driver/lib/src/driver/driver.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="177"> <state relative-caret-position="177">
@ -566,16 +477,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/lib/src/webview_options.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="283">
<caret line="322" column="61" selection-start-line="322" selection-start-column="49" selection-end-line="322" selection-end-column="61" />
<folding>
<element signature="e#0#17#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_ajax_test.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_ajax_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="180"> <state relative-caret-position="180">
@ -586,16 +487,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_initial_url_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="202">
<caret line="21" column="30" lean-forward="true" selection-start-line="21" selection-start-column="30" selection-end-line="21" selection-end-column="30" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_content_blocker_test.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_content_blocker_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="315"> <state relative-caret-position="315">
@ -897,65 +788,25 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/lib/test.dart"> <entry file="file://$PROJECT_DIR$/example/lib/test.dart" />
<entry file="file://$PROJECT_DIR$/example/assets/index.html">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-5596"> <state relative-caret-position="180">
<folding> <caret line="12" column="26" selection-start-line="12" selection-start-column="26" selection-end-line="12" selection-end-column="26" />
<element signature="e#0#16431#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/in_app_localhost_server.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-845">
<folding>
<element signature="e#0#17#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/pubspec.yaml"> <entry file="file://$PROJECT_DIR$/example/pubspec.yaml">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="330"> <state relative-caret-position="319">
<caret line="22" column="23" selection-start-line="22" selection-start-column="23" selection-end-line="22" selection-end-column="23" /> <caret line="43" column="9" selection-start-line="43" selection-start-column="9" selection-end-line="43" selection-end-column="9" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/in_app_webview.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="7854">
<caret line="1362" column="38" selection-start-line="1362" selection-start-column="38" selection-end-line="1362" selection-end-column="38" />
<folding>
<element signature="e#0#17#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/lib/main.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="130">
<caret line="16" column="15" selection-start-line="16" selection-start-column="7" selection-end-line="16" selection-end-column="15" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/lib/in_app_webiew_example.screen.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="219">
<caret line="33" column="24" selection-start-line="33" selection-start-column="24" selection-end-line="33" selection-end-column="24" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/lib/in_app_browser_example.screen.dart"> <entry file="file://$PROJECT_DIR$/example/lib/in_app_browser_example.screen.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="195"> <state relative-caret-position="135">
<caret line="13" column="11" selection-start-line="13" selection-start-column="11" selection-end-line="13" selection-end-column="11" /> <caret line="9" column="25" selection-start-line="9" selection-start-column="9" selection-end-line="9" selection-end-column="25" />
<folding> <folding>
<element signature="e#0#20#0" expanded="true" /> <element signature="e#0#20#0" expanded="true" />
</folding> </folding>
@ -964,18 +815,126 @@
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/lib/chrome_safari_browser_example.screen.dart"> <entry file="file://$PROJECT_DIR$/example/lib/chrome_safari_browser_example.screen.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="345"> <state relative-caret-position="75">
<caret line="23" selection-start-line="23" selection-end-line="23" /> <caret line="5" selection-start-line="5" selection-end-line="22" selection-end-column="1" />
<folding> <folding>
<element signature="e#0#39#0" expanded="true" /> <element signature="e#0#39#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/assets/index.html"> <entry file="file://$PROJECT_DIR$/lib/src/in_app_browser.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="180"> <state relative-caret-position="178">
<caret line="12" column="26" selection-start-line="12" selection-start-column="26" selection-end-line="12" selection-end-column="26" /> <caret line="278" column="2" selection-start-line="278" selection-start-column="2" selection-end-line="278" selection-end-column="80" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/chrome_safari_browser.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="397">
<caret line="105" column="3" selection-start-line="92" selection-start-column="2" selection-end-line="105" selection-end-column="3" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_initial_url_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="202">
<caret line="21" column="30" selection-start-line="21" selection-start-column="30" selection-end-line="21" selection-end-column="30" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/lib/main.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="528">
<caret line="57" column="11" selection-start-line="57" selection-start-column="11" selection-end-line="57" selection-end-column="11" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/in_app_localhost_server.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-65">
<folding>
<element signature="e#0#17#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/cookie_manager.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="135">
<caret line="14" column="45" lean-forward="true" selection-start-line="14" selection-start-column="5" selection-end-line="14" selection-end-column="45" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/lib/in_app_webiew_example.screen.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="35" column="22" lean-forward="true" selection-start-line="35" selection-start-column="22" selection-end-line="35" selection-end-column="22" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http_auth_credentials_database.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="366">
<caret line="96" column="65" lean-forward="true" selection-start-line="96" selection-start-column="5" selection-end-line="96" selection-end-column="65" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/webview_options.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="141">
<caret line="606" column="95" selection-start-line="606" selection-start-column="30" selection-end-line="606" selection-end-column="95" />
<folding>
<element signature="e#0#17#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pubspec.yaml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="8" column="36" selection-start-line="8" selection-start-column="11" selection-end-line="8" selection-end-column="36" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/in_app_webview.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="325">
<caret line="1176" column="41" selection-start-line="1176" selection-start-column="41" selection-end-line="1176" selection-end-column="41" />
<folding>
<element signature="e#0#17#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="349">
<caret line="303" column="38" lean-forward="true" selection-start-line="303" selection-start-column="38" selection-end-line="303" selection-end-column="38" />
<folding>
<element signature="e#0#20#0" expanded="true" />
<element signature="e#0#39#0" expanded="true" />
<element signature="e#0#39#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>

1450
README.md

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -14,8 +14,6 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
String url = ""; String url = "";
double progress = 0; double progress = 0;
TextEditingController _textFieldController = TextEditingController();
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -24,93 +22,91 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
_textFieldController.dispose();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text( title: Text("InAppWebView")
"InAppWebView", ),
)),
drawer: myDrawer(context: context), drawer: myDrawer(context: context),
body: Container( body: Container(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Container( Container(
padding: EdgeInsets.all(20.0), padding: EdgeInsets.all(20.0),
child: Text( child: Text(
"CURRENT URL\n${(url.length > 50) ? url.substring(0, 50) + "..." : url}"), "CURRENT URL\n${(url.length > 50) ? url.substring(0, 50) + "..." : url}"),
), ),
Container( Container(
padding: EdgeInsets.all(10.0), padding: EdgeInsets.all(10.0),
child: progress < 1.0 child: progress < 1.0
? LinearProgressIndicator(value: progress) ? LinearProgressIndicator(value: progress)
: Container()), : Container()),
Expanded( Expanded(
child: Container( child: Container(
margin: const EdgeInsets.all(10.0), margin: const EdgeInsets.all(10.0),
decoration: decoration:
BoxDecoration(border: Border.all(color: Colors.blueAccent)), BoxDecoration(border: Border.all(color: Colors.blueAccent)),
child: InAppWebView( child: InAppWebView(
initialUrl: "https://flutter.dev/", initialUrl: "https://flutter.dev/",
initialHeaders: {}, initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions( initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions( inAppWebViewOptions: InAppWebViewOptions(
debuggingEnabled: true, debuggingEnabled: true,
clearCache: true )
)
),
onWebViewCreated: (InAppWebViewController controller) {
webView = controller;
},
onLoadStart: (InAppWebViewController controller, String url) {
setState(() {
this.url = url;
});
},
onLoadStop: (InAppWebViewController controller, String url) async {
setState(() {
this.url = url;
});
},
onProgressChanged: (InAppWebViewController controller, int progress) {
setState(() {
this.progress = progress / 100;
});
},
), ),
onWebViewCreated: (InAppWebViewController controller) {
webView = controller;
},
onLoadStart: (InAppWebViewController controller, String url) {
setState(() {
this.url = url;
});
},
onLoadStop: (InAppWebViewController controller, String url) async {
setState(() {
this.url = url;
});
},
onProgressChanged: (InAppWebViewController controller, int progress) {
setState(() {
this.progress = progress / 100;
});
},
), ),
), ),
ButtonBar( ),
alignment: MainAxisAlignment.center, ButtonBar(
children: <Widget>[ alignment: MainAxisAlignment.center,
RaisedButton( children: <Widget>[
child: Icon(Icons.arrow_back), RaisedButton(
onPressed: () { child: Icon(Icons.arrow_back),
if (webView != null) { onPressed: () {
webView.goBack(); if (webView != null) {
} webView.goBack();
}, }
), },
RaisedButton( ),
child: Icon(Icons.arrow_forward), RaisedButton(
onPressed: () { child: Icon(Icons.arrow_forward),
if (webView != null) { onPressed: () {
webView.goForward(); if (webView != null) {
} webView.goForward();
}, }
), },
RaisedButton( ),
child: Icon(Icons.refresh), RaisedButton(
onPressed: () { child: Icon(Icons.refresh),
if (webView != null) { onPressed: () {
webView.reload(); if (webView != null) {
} webView.reload();
}, }
), },
], ),
), ],
]))); ),
]))
);
} }
} }

View File

@ -42,7 +42,6 @@ flutter:
uses-material-design: true uses-material-design: true
assets: assets:
- assets/certificate.pfx
- assets/index.html - assets/index.html
- assets/page-1.html - assets/page-1.html
- assets/page-2.html - assets/page-2.html

View File

@ -105,6 +105,7 @@ class ChromeSafariBrowser {
} }
///Returns `true` if the [ChromeSafariBrowser] instance is opened, otherwise `false`.
bool isOpened() { bool isOpened() {
return this._isOpened; return this._isOpened;
} }

View File

@ -5,13 +5,14 @@ import 'package:flutter/services.dart';
import 'types.dart'; import 'types.dart';
///Manages the cookies used by WebView instances. ///CookieManager class implements a singleton object (shared instance) which manages the cookies used by WebView instances.
/// ///
///**NOTE for iOS**: available from iOS 11.0+. ///**NOTE for iOS**: available from iOS 11.0+.
class CookieManager { class CookieManager {
static CookieManager _instance; static CookieManager _instance;
static const MethodChannel _channel = const MethodChannel('com.pichillilorenzo/flutter_inappbrowser_cookiemanager'); static const MethodChannel _channel = const MethodChannel('com.pichillilorenzo/flutter_inappbrowser_cookiemanager');
///Gets the cookie manager shared instance.
static CookieManager instance() { static CookieManager instance() {
return (_instance != null) ? _instance : _init(); return (_instance != null) ? _instance : _init();
} }

View File

@ -281,27 +281,32 @@ class InAppBrowser {
return this._isOpened; return this._isOpened;
} }
///Event fires when the [InAppBrowser] is created. ///Event fired when the [InAppBrowser] is created.
void onBrowserCreated() { void onBrowserCreated() {
} }
///Event fires when the [InAppBrowser] starts to load an [url]. ///Event fired when the [InAppBrowser] window is closed.
void onExit() {
}
///Event fired when the [InAppBrowser] starts to load an [url].
void onLoadStart(String url) { void onLoadStart(String url) {
} }
///Event fires when the [InAppBrowser] finishes loading an [url]. ///Event fired when the [InAppBrowser] finishes loading an [url].
void onLoadStop(String url) { void onLoadStop(String url) {
} }
///Event fires when the [InAppBrowser] encounters an error loading an [url]. ///Event fired when the [InAppBrowser] encounters an error loading an [url].
void onLoadError(String url, int code, String message) { void onLoadError(String url, int code, String message) {
} }
///Event fires when the [InAppBrowser] main page receives an HTTP error. ///Event fired when the [InAppBrowser] main page receives an HTTP error.
/// ///
///[url] represents the url of the main page that received the HTTP error. ///[url] represents the url of the main page that received the HTTP error.
/// ///
@ -314,17 +319,12 @@ class InAppBrowser {
} }
///Event fires when the current [progress] (range 0-100) of loading a page is changed. ///Event fired when the current [progress] (range 0-100) of loading a page is changed.
void onProgressChanged(int progress) { void onProgressChanged(int progress) {
} }
///Event fires when the [InAppBrowser] window is closed. ///Event fired when the [InAppBrowser] webview receives a [ConsoleMessage].
void onExit() {
}
///Event fires when the [InAppBrowser] webview receives a [ConsoleMessage].
void onConsoleMessage(ConsoleMessage consoleMessage) { void onConsoleMessage(ConsoleMessage consoleMessage) {
} }
@ -336,14 +336,14 @@ class InAppBrowser {
} }
///Event fires when the [InAppBrowser] webview loads a resource. ///Event fired when the [InAppBrowser] webview loads a resource.
/// ///
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewOptions.useOnLoadResource] and [InAppWebViewOptions.javaScriptEnabled] options to `true`. ///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewOptions.useOnLoadResource] and [InAppWebViewOptions.javaScriptEnabled] options to `true`.
void onLoadResource(LoadedResource resource) { void onLoadResource(LoadedResource resource) {
} }
///Event fires when the [InAppBrowser] webview scrolls. ///Event fired when the [InAppBrowser] webview scrolls.
/// ///
///[x] represents the current horizontal scroll origin in pixels. ///[x] represents the current horizontal scroll origin in pixels.
/// ///
@ -352,7 +352,7 @@ class InAppBrowser {
} }
///Event fires when [InAppBrowser] recognizes and starts a downloadable file. ///Event fired when [InAppBrowser] recognizes and starts a downloadable file.
/// ///
///[url] represents the url of the file. ///[url] represents the url of the file.
/// ///
@ -361,7 +361,7 @@ class InAppBrowser {
} }
///Event fires when the [InAppBrowser] webview finds the `custom-scheme` while loading a resource. Here you can handle the url request and return a [CustomSchemeResponse] to load a specific resource encoded to `base64`. ///Event fired when the [InAppBrowser] webview finds the `custom-scheme` while loading a resource. Here you can handle the url request and return a [CustomSchemeResponse] to load a specific resource encoded to `base64`.
/// ///
///[scheme] represents the scheme of the url. ///[scheme] represents the scheme of the url.
/// ///
@ -371,7 +371,7 @@ class InAppBrowser {
} }
///Event fires when the [InAppBrowser] webview tries to open a link with `target="_blank"`. ///Event fired when the [InAppBrowser] webview tries to open a link with `target="_blank"`.
/// ///
///[url] represents the url of the link. ///[url] represents the url of the link.
/// ///
@ -386,13 +386,13 @@ class InAppBrowser {
/// ///
///[origin] represents the origin of the web content attempting to use the Geolocation API. ///[origin] represents the origin of the web content attempting to use the Geolocation API.
/// ///
///**NOTE**: available only for Android. ///**NOTE**: available only on Android.
// ignore: missing_return // ignore: missing_return
Future<GeolocationPermissionShowPromptResponse> onGeolocationPermissionsShowPrompt (String origin) { Future<GeolocationPermissionShowPromptResponse> onGeolocationPermissionsShowPrompt (String origin) {
} }
///Event fires when javascript calls the `alert()` method to display an alert dialog. ///Event fired when javascript calls the `alert()` method to display an alert dialog.
///If [JsAlertResponse.handledByClient] is `true`, the webview will assume that the client will handle the dialog. ///If [JsAlertResponse.handledByClient] is `true`, the webview will assume that the client will handle the dialog.
/// ///
///[message] represents the message to be displayed in the alert dialog. ///[message] represents the message to be displayed in the alert dialog.
@ -401,7 +401,7 @@ class InAppBrowser {
} }
///Event fires when javascript calls the `confirm()` method to display a confirm dialog. ///Event fired when javascript calls the `confirm()` method to display a confirm dialog.
///If [JsConfirmResponse.handledByClient] is `true`, the webview will assume that the client will handle the dialog. ///If [JsConfirmResponse.handledByClient] is `true`, the webview will assume that the client will handle the dialog.
/// ///
///[message] represents the message to be displayed in the alert dialog. ///[message] represents the message to be displayed in the alert dialog.
@ -410,7 +410,7 @@ class InAppBrowser {
} }
///Event fires when javascript calls the `prompt()` method to display a prompt dialog. ///Event fired when javascript calls the `prompt()` method to display a prompt dialog.
///If [JsPromptResponse.handledByClient] is `true`, the webview will assume that the client will handle the dialog. ///If [JsPromptResponse.handledByClient] is `true`, the webview will assume that the client will handle the dialog.
/// ///
///[message] represents the message to be displayed in the alert dialog. ///[message] represents the message to be displayed in the alert dialog.
@ -420,20 +420,20 @@ class InAppBrowser {
} }
///Event fires when the webview notifies that a loading URL has been flagged by Safe Browsing. ///Event fired when the webview notifies that a loading URL has been flagged by Safe Browsing.
///The default behavior is to show an interstitial to the user, with the reporting checkbox visible. ///The default behavior is to show an interstitial to the user, with the reporting checkbox visible.
/// ///
///[url] represents the url of the request. ///[url] represents the url of the request.
/// ///
///[threatType] represents the reason the resource was caught by Safe Browsing, corresponding to a [SafeBrowsingThreat]. ///[threatType] represents the reason the resource was caught by Safe Browsing, corresponding to a [SafeBrowsingThreat].
/// ///
///**NOTE**: available only for Android. ///**NOTE**: available only on Android.
// ignore: missing_return // ignore: missing_return
Future<SafeBrowsingResponse> onSafeBrowsingHit(String url, SafeBrowsingThreat threatType) { Future<SafeBrowsingResponse> onSafeBrowsingHit(String url, SafeBrowsingThreat threatType) {
} }
///Event fires when the WebView received an HTTP authentication request. The default behavior is to cancel the request. ///Event fired when the WebView received an HTTP authentication request. The default behavior is to cancel the request.
/// ///
///[challenge] contains data about host, port, protocol, realm, etc. as specified in the [HttpAuthChallenge]. ///[challenge] contains data about host, port, protocol, realm, etc. as specified in the [HttpAuthChallenge].
// ignore: missing_return // ignore: missing_return
@ -441,7 +441,7 @@ class InAppBrowser {
} }
///Event fires when the WebView need to perform server trust authentication (certificate validation). ///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]. ///The host application must return either [ServerTrustAuthResponse] instance with [ServerTrustAuthResponseAction.CANCEL] or [ServerTrustAuthResponseAction.PROCEED].
/// ///
///[challenge] contains data about host, port, protocol, realm, etc. as specified in the [ServerTrustChallenge]. ///[challenge] contains data about host, port, protocol, realm, etc. as specified in the [ServerTrustChallenge].
@ -506,7 +506,7 @@ class InAppBrowser {
} }
///Event fired when an request is sent to a server through [Fetch API](https://developer.mozilla.org/it/docs/Web/API/Fetch_API). ///Event fired when a request is sent to a server through [Fetch API](https://developer.mozilla.org/it/docs/Web/API/Fetch_API).
///It gives the host application a chance to take control over the request before sending it. ///It gives the host application a chance to take control over the request before sending it.
/// ///
///[fetchRequest] represents a resource request. ///[fetchRequest] represents a resource request.

View File

@ -23,19 +23,19 @@ const javaScriptHandlerForbiddenNames = ["onLoadResource", "shouldInterceptAjaxR
///Flutter Widget for adding an **inline native WebView** integrated in the flutter widget tree. ///Flutter Widget for adding an **inline native WebView** integrated in the flutter widget tree.
class InAppWebView extends StatefulWidget { class InAppWebView extends StatefulWidget {
///Event fires when the [InAppWebView] is created. ///Event fired when the [InAppWebView] is created.
final void Function(InAppWebViewController controller) onWebViewCreated; final void Function(InAppWebViewController controller) onWebViewCreated;
///Event fires when the [InAppWebView] starts to load an [url]. ///Event fired when the [InAppWebView] starts to load an [url].
final void Function(InAppWebViewController controller, String url) onLoadStart; final void Function(InAppWebViewController controller, String url) onLoadStart;
///Event fires when the [InAppWebView] finishes loading an [url]. ///Event fired when the [InAppWebView] finishes loading an [url].
final void Function(InAppWebViewController controller, String url) onLoadStop; final void Function(InAppWebViewController controller, String url) onLoadStop;
///Event fires when the [InAppWebView] encounters an error loading an [url]. ///Event fired when the [InAppWebView] encounters an error loading an [url].
final void Function(InAppWebViewController controller, String url, int code, String message) onLoadError; final void Function(InAppWebViewController controller, String url, int code, String message) onLoadError;
///Event fires when the [InAppWebView] main page receives an HTTP error. ///Event fired when the [InAppWebView] main page receives an HTTP error.
/// ///
///[url] represents the url of the main page that received the HTTP error. ///[url] represents the url of the main page that received the HTTP error.
/// ///
@ -46,10 +46,10 @@ class InAppWebView extends StatefulWidget {
///**NOTE**: available on Android 23+. ///**NOTE**: available on Android 23+.
final void Function(InAppWebViewController controller, String url, int statusCode, String description) onLoadHttpError; final void Function(InAppWebViewController controller, String url, int statusCode, String description) onLoadHttpError;
///Event fires when the current [progress] of loading a page is changed. ///Event fired when the current [progress] of loading a page is changed.
final void Function(InAppWebViewController controller, int progress) onProgressChanged; final void Function(InAppWebViewController controller, int progress) onProgressChanged;
///Event fires when the [InAppWebView] receives a [ConsoleMessage]. ///Event fired when the [InAppWebView] receives a [ConsoleMessage].
final void Function(InAppWebViewController controller, ConsoleMessage consoleMessage) onConsoleMessage; final void Function(InAppWebViewController controller, ConsoleMessage consoleMessage) onConsoleMessage;
///Give the host application a chance to take control when a URL is about to be loaded in the current WebView. ///Give the host application a chance to take control when a URL is about to be loaded in the current WebView.
@ -57,33 +57,33 @@ class InAppWebView extends StatefulWidget {
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewOptions.useShouldOverrideUrlLoading] option to `true`. ///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewOptions.useShouldOverrideUrlLoading] option to `true`.
final void Function(InAppWebViewController controller, String url) shouldOverrideUrlLoading; final void Function(InAppWebViewController controller, String url) shouldOverrideUrlLoading;
///Event fires when the [InAppWebView] loads a resource. ///Event fired when the [InAppWebView] loads a resource.
/// ///
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewOptions.useOnLoadResource] and [InAppWebViewOptions.javaScriptEnabled] options to `true`. ///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewOptions.useOnLoadResource] and [InAppWebViewOptions.javaScriptEnabled] options to `true`.
final void Function(InAppWebViewController controller, LoadedResource resource) onLoadResource; final void Function(InAppWebViewController controller, LoadedResource resource) onLoadResource;
///Event fires when the [InAppWebView] scrolls. ///Event fired when the [InAppWebView] scrolls.
/// ///
///[x] represents the current horizontal scroll origin in pixels. ///[x] represents the current horizontal scroll origin in pixels.
/// ///
///[y] represents the current vertical scroll origin in pixels. ///[y] represents the current vertical scroll origin in pixels.
final void Function(InAppWebViewController controller, int x, int y) onScrollChanged; final void Function(InAppWebViewController controller, int x, int y) onScrollChanged;
///Event fires when [InAppWebView] recognizes and starts a downloadable file. ///Event fired when [InAppWebView] recognizes and starts a downloadable file.
/// ///
///[url] represents the url of the file. ///[url] represents the url of the file.
/// ///
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewOptions.useOnDownloadStart] option to `true`. ///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewOptions.useOnDownloadStart] option to `true`.
final void Function(InAppWebViewController controller, String url) onDownloadStart; final void Function(InAppWebViewController controller, String url) onDownloadStart;
///Event fires when the [InAppWebView] finds the `custom-scheme` while loading a resource. Here you can handle the url request and return a [CustomSchemeResponse] to load a specific resource encoded to `base64`. ///Event fired when the [InAppWebView] finds the `custom-scheme` while loading a resource. Here you can handle the url request and return a [CustomSchemeResponse] to load a specific resource encoded to `base64`.
/// ///
///[scheme] represents the scheme of the url. ///[scheme] represents the scheme of the url.
/// ///
///[url] represents the url of the request. ///[url] represents the url of the request.
final Future<CustomSchemeResponse> Function(InAppWebViewController controller, String scheme, String url) onLoadResourceCustomScheme; final Future<CustomSchemeResponse> Function(InAppWebViewController controller, String scheme, String url) onLoadResourceCustomScheme;
///Event fires when the [InAppWebView] tries to open a link with `target="_blank"`. ///Event fired when the [InAppWebView] tries to open a link with `target="_blank"`.
/// ///
///[url] represents the url of the link. ///[url] represents the url of the link.
/// ///
@ -96,22 +96,22 @@ class InAppWebView extends StatefulWidget {
/// ///
///[origin] represents the origin of the web content attempting to use the Geolocation API. ///[origin] represents the origin of the web content attempting to use the Geolocation API.
/// ///
///**NOTE**: available only for Android. ///**NOTE**: available only on Android.
final Future<GeolocationPermissionShowPromptResponse> Function(InAppWebViewController controller, String origin) onGeolocationPermissionsShowPrompt; final Future<GeolocationPermissionShowPromptResponse> Function(InAppWebViewController controller, String origin) onGeolocationPermissionsShowPrompt;
///Event fires when javascript calls the `alert()` method to display an alert dialog. ///Event fired when javascript calls the `alert()` method to display an alert dialog.
///If [JsAlertResponse.handledByClient] is `true`, the webview will assume that the client will handle the dialog. ///If [JsAlertResponse.handledByClient] is `true`, the webview will assume that the client will handle the dialog.
/// ///
///[message] represents the message to be displayed in the alert dialog. ///[message] represents the message to be displayed in the alert dialog.
final Future<JsAlertResponse> Function(InAppWebViewController controller, String message) onJsAlert; final Future<JsAlertResponse> Function(InAppWebViewController controller, String message) onJsAlert;
///Event fires when javascript calls the `confirm()` method to display a confirm dialog. ///Event fired when javascript calls the `confirm()` method to display a confirm dialog.
///If [JsConfirmResponse.handledByClient] is `true`, the webview will assume that the client will handle the dialog. ///If [JsConfirmResponse.handledByClient] is `true`, the webview will assume that the client will handle the dialog.
/// ///
///[message] represents the message to be displayed in the alert dialog. ///[message] represents the message to be displayed in the alert dialog.
final Future<JsConfirmResponse> Function(InAppWebViewController controller, String message) onJsConfirm; final Future<JsConfirmResponse> Function(InAppWebViewController controller, String message) onJsConfirm;
///Event fires when javascript calls the `prompt()` method to display a prompt dialog. ///Event fired when javascript calls the `prompt()` method to display a prompt dialog.
///If [JsPromptResponse.handledByClient] is `true`, the webview will assume that the client will handle the dialog. ///If [JsPromptResponse.handledByClient] is `true`, the webview will assume that the client will handle the dialog.
/// ///
///[message] represents the message to be displayed in the alert dialog. ///[message] represents the message to be displayed in the alert dialog.
@ -119,22 +119,22 @@ class InAppWebView extends StatefulWidget {
///[defaultValue] represents the default value displayed in the prompt dialog. ///[defaultValue] represents the default value displayed in the prompt dialog.
final Future<JsPromptResponse> Function(InAppWebViewController controller, String message, String defaultValue) onJsPrompt; final Future<JsPromptResponse> Function(InAppWebViewController controller, String message, String defaultValue) onJsPrompt;
///Event fires when the webview notifies that a loading URL has been flagged by Safe Browsing. ///Event fired when the webview notifies that a loading URL has been flagged by Safe Browsing.
///The default behavior is to show an interstitial to the user, with the reporting checkbox visible. ///The default behavior is to show an interstitial to the user, with the reporting checkbox visible.
/// ///
///[url] represents the url of the request. ///[url] represents the url of the request.
/// ///
///[threatType] represents the reason the resource was caught by Safe Browsing, corresponding to a [SafeBrowsingThreat]. ///[threatType] represents the reason the resource was caught by Safe Browsing, corresponding to a [SafeBrowsingThreat].
/// ///
///**NOTE**: available only for Android. ///**NOTE**: available only on Android.
final Future<SafeBrowsingResponse> Function(InAppWebViewController controller, String url, SafeBrowsingThreat threatType) onSafeBrowsingHit; final Future<SafeBrowsingResponse> Function(InAppWebViewController controller, String url, SafeBrowsingThreat threatType) onSafeBrowsingHit;
///Event fires when the WebView received an HTTP authentication request. The default behavior is to cancel the request. ///Event fired when the WebView received an HTTP authentication request. The default behavior is to cancel the request.
/// ///
///[challenge] contains data about host, port, protocol, realm, etc. as specified in the [HttpAuthChallenge]. ///[challenge] contains data about host, port, protocol, realm, etc. as specified in the [HttpAuthChallenge].
final Future<HttpAuthResponse> Function(InAppWebViewController controller, HttpAuthChallenge challenge) onReceivedHttpAuthRequest; final Future<HttpAuthResponse> Function(InAppWebViewController controller, HttpAuthChallenge challenge) onReceivedHttpAuthRequest;
///Event fires when the WebView need to perform server trust authentication (certificate validation). ///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]. ///The host application must return either [ServerTrustAuthResponse] instance with [ServerTrustAuthResponseAction.CANCEL] or [ServerTrustAuthResponseAction.PROCEED].
/// ///
///[challenge] contains data about host, port, protocol, realm, etc. as specified in the [ServerTrustChallenge]. ///[challenge] contains data about host, port, protocol, realm, etc. as specified in the [ServerTrustChallenge].
@ -194,7 +194,7 @@ class InAppWebView extends StatefulWidget {
///Inside the `window.addEventListener("flutterInAppBrowserPlatformReady")` event, the ajax requests will be intercept for sure. ///Inside the `window.addEventListener("flutterInAppBrowserPlatformReady")` event, the ajax requests will be intercept for sure.
final Future<AjaxRequestAction> Function(InAppWebViewController controller, AjaxRequest ajaxRequest) onAjaxProgress; final Future<AjaxRequestAction> Function(InAppWebViewController controller, AjaxRequest ajaxRequest) onAjaxProgress;
///Event fired when an request is sent to a server through [Fetch API](https://developer.mozilla.org/it/docs/Web/API/Fetch_API). ///Event fired when a request is sent to a server through [Fetch API](https://developer.mozilla.org/it/docs/Web/API/Fetch_API).
///It gives the host application a chance to take control over the request before sending it. ///It gives the host application a chance to take control over the request before sending it.
/// ///
///[fetchRequest] represents a resource request. ///[fetchRequest] represents a resource request.
@ -979,7 +979,7 @@ class InAppWebViewController {
await _channel.invokeMethod('loadFile', args); await _channel.invokeMethod('loadFile', args);
} }
///Reloads the [InAppWebView]. ///Reloads the WebView.
Future<void> reload() async { Future<void> reload() async {
Map<String, dynamic> args = <String, dynamic>{}; Map<String, dynamic> args = <String, dynamic>{};
if (_inAppBrowserUuid != null && _inAppBrowser != null) { if (_inAppBrowserUuid != null && _inAppBrowser != null) {
@ -989,7 +989,7 @@ class InAppWebViewController {
await _channel.invokeMethod('reload', args); await _channel.invokeMethod('reload', args);
} }
///Goes back in the history of the [InAppWebView]. ///Goes back in the history of the WebView.
Future<void> goBack() async { Future<void> goBack() async {
Map<String, dynamic> args = <String, dynamic>{}; Map<String, dynamic> args = <String, dynamic>{};
if (_inAppBrowserUuid != null && _inAppBrowser != null) { if (_inAppBrowserUuid != null && _inAppBrowser != null) {
@ -999,7 +999,7 @@ class InAppWebViewController {
await _channel.invokeMethod('goBack', args); await _channel.invokeMethod('goBack', args);
} }
///Returns a boolean value indicating whether the [InAppWebView] can move backward. ///Returns a boolean value indicating whether the WebView can move backward.
Future<bool> canGoBack() async { Future<bool> canGoBack() async {
Map<String, dynamic> args = <String, dynamic>{}; Map<String, dynamic> args = <String, dynamic>{};
if (_inAppBrowserUuid != null && _inAppBrowser != null) { if (_inAppBrowserUuid != null && _inAppBrowser != null) {
@ -1009,7 +1009,7 @@ class InAppWebViewController {
return await _channel.invokeMethod('canGoBack', args); return await _channel.invokeMethod('canGoBack', args);
} }
///Goes forward in the history of the [InAppWebView]. ///Goes forward in the history of the WebView.
Future<void> goForward() async { Future<void> goForward() async {
Map<String, dynamic> args = <String, dynamic>{}; Map<String, dynamic> args = <String, dynamic>{};
if (_inAppBrowserUuid != null && _inAppBrowser != null) { if (_inAppBrowserUuid != null && _inAppBrowser != null) {
@ -1019,7 +1019,7 @@ class InAppWebViewController {
await _channel.invokeMethod('goForward', args); await _channel.invokeMethod('goForward', args);
} }
///Returns a boolean value indicating whether the [InAppWebView] can move forward. ///Returns a boolean value indicating whether the WebView can move forward.
Future<bool> canGoForward() async { Future<bool> canGoForward() async {
Map<String, dynamic> args = <String, dynamic>{}; Map<String, dynamic> args = <String, dynamic>{};
if (_inAppBrowserUuid != null && _inAppBrowser != null) { if (_inAppBrowserUuid != null && _inAppBrowser != null) {
@ -1148,7 +1148,7 @@ class InAppWebViewController {
///The `args` will be stringified automatically using `JSON.stringify(args)` method and then they will be decoded on the Dart side. ///The `args` will be stringified automatically using `JSON.stringify(args)` method and then they will be decoded on the Dart side.
/// ///
///In order to call `window.flutter_inappbrowser.callHandler(handlerName <String>, ...args)` properly, you need to wait and listen the JavaScript event `flutterInAppBrowserPlatformReady`. ///In order to call `window.flutter_inappbrowser.callHandler(handlerName <String>, ...args)` properly, you need to wait and listen the JavaScript event `flutterInAppBrowserPlatformReady`.
///This event will be dispatch as soon as the platform (Android or iOS) is ready to handle the `callHandler` method. ///This event will be dispatched as soon as the platform (Android or iOS) is ready to handle the `callHandler` method.
///```javascript ///```javascript
/// window.addEventListener("flutterInAppBrowserPlatformReady", function(event) { /// window.addEventListener("flutterInAppBrowserPlatformReady", function(event) {
/// console.log("ready"); /// console.log("ready");
@ -1164,13 +1164,11 @@ class InAppWebViewController {
///<script> ///<script>
/// window.addEventListener("flutterInAppBrowserPlatformReady", function(event) { /// window.addEventListener("flutterInAppBrowserPlatformReady", function(event) {
/// window.flutter_inappbrowser.callHandler('handlerFoo').then(function(result) { /// window.flutter_inappbrowser.callHandler('handlerFoo').then(function(result) {
/// console.log(result, typeof result); /// console.log(result);
/// console.log(JSON.stringify(result));
/// }); /// });
/// ///
/// window.flutter_inappbrowser.callHandler('handlerFooWithArgs', 1, true, ['bar', 5], {foo: 'baz'}).then(function(result) { /// window.flutter_inappbrowser.callHandler('handlerFooWithArgs', 1, true, ['bar', 5], {foo: 'baz'}).then(function(result) {
/// console.log(result, typeof result); /// console.log(result);
/// console.log(JSON.stringify(result));
/// }); /// });
/// }); /// });
///</script> ///</script>
@ -1284,7 +1282,7 @@ class InAppWebViewController {
///This should not be called if Safe Browsing has been disabled by manifest tag ///This should not be called if Safe Browsing has been disabled by manifest tag
///or [AndroidInAppWebViewOptions.safeBrowsingEnabled]. This prepares resources used for Safe Browsing. ///or [AndroidInAppWebViewOptions.safeBrowsingEnabled]. This prepares resources used for Safe Browsing.
/// ///
///**NOTE**: available on Android 27+. ///**NOTE**: available only on Android 27+.
Future<bool> startSafeBrowsing() async { Future<bool> startSafeBrowsing() async {
Map<String, dynamic> args = <String, dynamic>{}; Map<String, dynamic> args = <String, dynamic>{};
if (_inAppBrowserUuid != null && _inAppBrowser != null) { if (_inAppBrowserUuid != null && _inAppBrowser != null) {
@ -1308,7 +1306,7 @@ class InAppWebViewController {
/// ///
///[hosts] represents the list of hosts. This value must never be null. ///[hosts] represents the list of hosts. This value must never be null.
/// ///
///**NOTE**: available on Android 27+. ///**NOTE**: available only on Android 27+.
Future<bool> setSafeBrowsingWhitelist({@required List<String> hosts}) async { Future<bool> setSafeBrowsingWhitelist({@required List<String> hosts}) async {
assert(hosts != null); assert(hosts != null);
Map<String, dynamic> args = <String, dynamic>{}; Map<String, dynamic> args = <String, dynamic>{};
@ -1322,7 +1320,7 @@ class InAppWebViewController {
///Returns a URL pointing to the privacy policy for Safe Browsing reporting. This value will never be `null`. ///Returns a URL pointing to the privacy policy for Safe Browsing reporting. This value will never be `null`.
/// ///
///**NOTE**: available on Android 27+. ///**NOTE**: available only on Android 27+.
Future<String> getSafeBrowsingPrivacyPolicyUrl() async { Future<String> getSafeBrowsingPrivacyPolicyUrl() async {
Map<String, dynamic> args = <String, dynamic>{}; Map<String, dynamic> args = <String, dynamic>{};
if (_inAppBrowserUuid != null && _inAppBrowser != null) { if (_inAppBrowserUuid != null && _inAppBrowser != null) {
@ -1332,7 +1330,7 @@ class InAppWebViewController {
return await _channel.invokeMethod('getSafeBrowsingPrivacyPolicyUrl', args); return await _channel.invokeMethod('getSafeBrowsingPrivacyPolicyUrl', args);
} }
///Clears all the webview's cache ///Clears all the webview's cache.
Future<void> clearCache() async { Future<void> clearCache() async {
Map<String, dynamic> args = <String, dynamic>{}; Map<String, dynamic> args = <String, dynamic>{};
if (_inAppBrowserUuid != null && _inAppBrowser != null) { if (_inAppBrowserUuid != null && _inAppBrowser != null) {

View File

@ -193,7 +193,7 @@ class InAppWebViewOptions implements WebViewOptions, BrowserOptions, AndroidOpti
///This class represents all the Android-only WebView options available. ///This class represents all the Android-only WebView options available.
class AndroidInAppWebViewOptions implements WebViewOptions, BrowserOptions, AndroidOptions { class AndroidInAppWebViewOptions implements WebViewOptions, BrowserOptions, AndroidOptions {
///Sets the text zoom of the page in percent. The default is `100`. ///Sets the text zoom of the page in percent. The default value is `100`.
int textZoom; int textZoom;
///Set to `true` to have the session cookie cache cleared before the new window is opened. ///Set to `true` to have the session cookie cache cleared before the new window is opened.
bool clearSessionCache; bool clearSessionCache;
@ -278,7 +278,7 @@ class AndroidInAppWebViewOptions implements WebViewOptions, BrowserOptions, Andr
bool loadsImagesAutomatically; bool loadsImagesAutomatically;
///Sets the minimum logical font size. The default is `8`. ///Sets the minimum logical font size. The default is `8`.
int minimumLogicalFontSize; int minimumLogicalFontSize;
///Sets the initial scale for this WebView. 0 means default.The behavior for the default scale depends on the state of [useWideViewPort] and [loadWithOverviewMode]. ///Sets the initial scale for this WebView. 0 means default. The behavior for the default scale depends on the state of [useWideViewPort] and [loadWithOverviewMode].
///If the content fits into the WebView control by width, then the zoom is set to 100%. For wide content, the behavior depends on the state of [loadWithOverviewMode]. ///If the content fits into the WebView control by width, then the zoom is set to 100%. For wide content, the behavior depends on the state of [loadWithOverviewMode].
///If its value is true, the content will be zoomed out to be fit by width into the WebView control, otherwise not. ///If its value is true, the content will be zoomed out to be fit by width into the WebView control, otherwise not.
///If initial scale is greater than 0, WebView starts with this value as initial scale. ///If initial scale is greater than 0, WebView starts with this value as initial scale.