fix #56, some code cleanup
This commit is contained in:
parent
8db2a6b22a
commit
f3f0876f28
1
.idea/vcs.xml
generated
1
.idea/vcs.xml
generated
@ -2,5 +2,6 @@
|
|||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="VcsDirectoryMappings">
|
<component name="VcsDirectoryMappings">
|
||||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
<mapping directory="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser" vcs="Git" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
557
.idea/workspace.xml
generated
557
.idea/workspace.xml
generated
@ -15,13 +15,48 @@
|
|||||||
</component>
|
</component>
|
||||||
<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 afterPath="$PROJECT_DIR$/example/assets/page-1.html" afterDir="false" />
|
||||||
|
<change afterPath="$PROJECT_DIR$/example/assets/page-2.html" afterDir="false" />
|
||||||
|
<change afterPath="$PROJECT_DIR$/example/assets/page-3.html" afterDir="false" />
|
||||||
|
<change afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/assets/page-1.html" afterDir="false" />
|
||||||
|
<change afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/assets/page-2.html" afterDir="false" />
|
||||||
|
<change afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/assets/page-3.html" afterDir="false" />
|
||||||
<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$/CHANGELOG.md" beforeDir="false" afterPath="$PROJECT_DIR$/CHANGELOG.md" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/CHANGELOG.md" beforeDir="false" afterPath="$PROJECT_DIR$/CHANGELOG.md" 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/FlutterWebView.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/FlutterWebView.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/android/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/android/build.gradle" 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$/example/android/app/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/example/android/app/build.gradle" 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/android/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/example/android/build.gradle" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebView.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebView.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/example/android/gradle.properties" beforeDir="false" afterPath="$PROJECT_DIR$/example/android/gradle.properties" afterDir="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/.symlinks/plugins/flutter_inappbrowser/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/.idea/workspace.xml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/CHANGELOG.md" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/CHANGELOG.md" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/FlutterWebView.java" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/FlutterWebView.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserActivity.java" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserActivity.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserFlutterPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserFlutterPlugin.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebView.java" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebView.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/assets/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/assets/index.html" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/ios/Runner.xcodeproj/project.pbxproj" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/ios/Runner.xcodeproj/project.pbxproj" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/lib/chrome_safari_example.screen.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/lib/chrome_safari_example.screen.dart" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/lib/inline_example.screen.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/lib/inline_example.screen.dart" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/lib/main.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/lib/main.dart" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/lib/webview_example.screen.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/lib/webview_example.screen.dart" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/pubspec.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/pubspec.yaml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/flutter_inappbrowser.iml" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/flutter_inappbrowser.iml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/ios/Classes/FlutterWebViewController.swift" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/ios/Classes/FlutterWebViewController.swift" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/ios/Classes/InAppBrowserWebViewController.swift" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/ios/Classes/InAppBrowserWebViewController.swift" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/ios/Classes/InAppWebView.swift" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/ios/Classes/InAppWebView.swift" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/ios/Classes/SwiftFlutterPlugin.swift" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/ios/Classes/SwiftFlutterPlugin.swift" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/example/ios/Runner.xcodeproj/project.pbxproj" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/Runner.xcodeproj/project.pbxproj" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/example/lib/chrome_safari_example.screen.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/lib/chrome_safari_example.screen.dart" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/example/lib/inline_example.screen.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/lib/inline_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/lib/webview_example.screen.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/lib/webview_example.screen.dart" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/example/pubspec.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/example/pubspec.yaml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/flutter_inappbrowser.iml" beforeDir="false" afterPath="$PROJECT_DIR$/flutter_inappbrowser.iml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/ios/Classes/FlutterWebViewController.swift" beforeDir="false" afterPath="$PROJECT_DIR$/ios/Classes/FlutterWebViewController.swift" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/ios/Classes/InAppBrowserWebViewController.swift" beforeDir="false" afterPath="$PROJECT_DIR$/ios/Classes/InAppBrowserWebViewController.swift" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/ios/Classes/InAppWebView.swift" beforeDir="false" afterPath="$PROJECT_DIR$/ios/Classes/InAppWebView.swift" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/ios/Classes/SwiftFlutterPlugin.swift" beforeDir="false" afterPath="$PROJECT_DIR$/ios/Classes/SwiftFlutterPlugin.swift" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/pubspec.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/pubspec.yaml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/pubspec.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/pubspec.yaml" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<ignored path="$PROJECT_DIR$/.dart_tool/" />
|
<ignored path="$PROJECT_DIR$/.dart_tool/" />
|
||||||
@ -31,28 +66,37 @@
|
|||||||
<ignored path="$PROJECT_DIR$/example/.pub/" />
|
<ignored path="$PROJECT_DIR$/example/.pub/" />
|
||||||
<ignored path="$PROJECT_DIR$/example/build/" />
|
<ignored path="$PROJECT_DIR$/example/build/" />
|
||||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||||
<option name="TRACKING_ENABLED" value="true" />
|
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||||
</component>
|
</component>
|
||||||
|
<component name="FUSProjectUsageTrigger">
|
||||||
|
<session id="-1166585903">
|
||||||
|
<usages-collector id="statistics.lifecycle.project">
|
||||||
|
<counts>
|
||||||
|
<entry key="project.open.time.11" value="1" />
|
||||||
|
<entry key="project.opened" value="1" />
|
||||||
|
</counts>
|
||||||
|
</usages-collector>
|
||||||
|
</session>
|
||||||
|
</component>
|
||||||
<component name="FileEditorManager">
|
<component name="FileEditorManager">
|
||||||
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
|
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
|
||||||
<file leaf-file-name="build.gradle" pinned="false" current-in-tab="true">
|
<file pinned="false" current-in-tab="false">
|
||||||
<entry file="file://$PROJECT_DIR$/android/build.gradle">
|
<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="195">
|
<state relative-caret-position="45">
|
||||||
<caret line="13" selection-start-line="13" selection-end-line="14" selection-end-column="22" />
|
<caret line="3" column="24" selection-start-line="3" selection-start-column="24" selection-end-line="3" selection-end-column="24" />
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
</file>
|
</file>
|
||||||
<file leaf-file-name="build.gradle" pinned="false" current-in-tab="false">
|
<file pinned="false" current-in-tab="true">
|
||||||
<entry file="file://$PROJECT_DIR$/example/android/build.gradle">
|
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
|
||||||
<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="45">
|
||||||
<caret line="13" column="16" selection-start-line="13" selection-start-column="16" selection-end-line="13" selection-end-column="16" />
|
<caret line="3" column="19" lean-forward="true" selection-start-line="3" selection-start-column="19" selection-end-line="3" selection-end-column="19" />
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
@ -68,13 +112,6 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="FindInProjectRecents">
|
<component name="FindInProjectRecents">
|
||||||
<findStrings>
|
<findStrings>
|
||||||
<find>takeS</find>
|
|
||||||
<find>Completer</find>
|
|
||||||
<find>args.putIfAbsent('isLocalFile', () => true);</find>
|
|
||||||
<find>args.putIfAbsent('isLocalFile', () =></find>
|
|
||||||
<find>Opens the</find>
|
|
||||||
<find>_isOpened</find>
|
|
||||||
<find>initialFile</find>
|
|
||||||
<find>onBrowserCreated</find>
|
<find>onBrowserCreated</find>
|
||||||
<find>getUrl</find>
|
<find>getUrl</find>
|
||||||
<find>onScrollChanged</find>
|
<find>onScrollChanged</find>
|
||||||
@ -98,6 +135,13 @@
|
|||||||
<find>AndroidView</find>
|
<find>AndroidView</find>
|
||||||
<find>_uuidGenerator</find>
|
<find>_uuidGenerator</find>
|
||||||
<find>in the flutter</find>
|
<find>in the flutter</find>
|
||||||
|
<find>RELOAD</find>
|
||||||
|
<find>localhostServer</find>
|
||||||
|
<find>initialFile</find>
|
||||||
|
<find>loadFile</find>
|
||||||
|
<find>openFile</find>
|
||||||
|
<find>File</find>
|
||||||
|
<find>onExit</find>
|
||||||
</findStrings>
|
</findStrings>
|
||||||
<replaceStrings>
|
<replaceStrings>
|
||||||
<replace>activity.getPreferences(0)</replace>
|
<replace>activity.getPreferences(0)</replace>
|
||||||
@ -135,22 +179,27 @@
|
|||||||
<option value="$PROJECT_DIR$/example/html/css/style.css" />
|
<option value="$PROJECT_DIR$/example/html/css/style.css" />
|
||||||
<option value="$PROJECT_DIR$/example/html/index.html" />
|
<option value="$PROJECT_DIR$/example/html/index.html" />
|
||||||
<option value="$PROJECT_DIR$/example/assets/css/style.css" />
|
<option value="$PROJECT_DIR$/example/assets/css/style.css" />
|
||||||
<option value="$PROJECT_DIR$/example/assets/index.html" />
|
|
||||||
<option value="$PROJECT_DIR$/example/ios/Flutter/Generated.xcconfig" />
|
<option value="$PROJECT_DIR$/example/ios/Flutter/Generated.xcconfig" />
|
||||||
<option value="$PROJECT_DIR$/example/ios/Runner/Info.plist" />
|
<option value="$PROJECT_DIR$/example/ios/Runner/Info.plist" />
|
||||||
<option value="$PROJECT_DIR$/lib/flutter_inappbrowser.dart" />
|
<option value="$PROJECT_DIR$/lib/flutter_inappbrowser.dart" />
|
||||||
<option value="$PROJECT_DIR$/example/lib/webview_example.screen.dart" />
|
|
||||||
<option value="$PROJECT_DIR$/example/lib/test.dart" />
|
|
||||||
<option value="$PROJECT_DIR$/android/gradle/wrapper/gradle-wrapper.properties" />
|
<option value="$PROJECT_DIR$/android/gradle/wrapper/gradle-wrapper.properties" />
|
||||||
<option value="$PROJECT_DIR$/example/lib/main.dart" />
|
|
||||||
<option value="$PROJECT_DIR$/example/pubspec.yaml" />
|
|
||||||
<option value="$PROJECT_DIR$/pubspec.yaml" />
|
|
||||||
<option value="$PROJECT_DIR$/README.md" />
|
<option value="$PROJECT_DIR$/README.md" />
|
||||||
<option value="$PROJECT_DIR$/CHANGELOG.md" />
|
|
||||||
<option value="$PROJECT_DIR$/example/android/app/build.gradle" />
|
<option value="$PROJECT_DIR$/example/android/app/build.gradle" />
|
||||||
<option value="$PROJECT_DIR$/example/android/gradle.properties" />
|
<option value="$PROJECT_DIR$/example/android/gradle.properties" />
|
||||||
<option value="$PROJECT_DIR$/android/build.gradle" />
|
<option value="$PROJECT_DIR$/android/build.gradle" />
|
||||||
<option value="$PROJECT_DIR$/example/android/build.gradle" />
|
<option value="$PROJECT_DIR$/example/android/build.gradle" />
|
||||||
|
<option value="$PROJECT_DIR$/example/pubspec.yaml" />
|
||||||
|
<option value="$PROJECT_DIR$/example/assets/index.html" />
|
||||||
|
<option value="$PROJECT_DIR$/example/assets/page-1.html" />
|
||||||
|
<option value="$PROJECT_DIR$/example/assets/page-2.html" />
|
||||||
|
<option value="$PROJECT_DIR$/example/assets/page-3.html" />
|
||||||
|
<option value="$PROJECT_DIR$/example/lib/main.dart" />
|
||||||
|
<option value="$PROJECT_DIR$/example/lib/chrome_safari_example.screen.dart" />
|
||||||
|
<option value="$PROJECT_DIR$/example/lib/test.dart" />
|
||||||
|
<option value="$PROJECT_DIR$/example/lib/webview_example.screen.dart" />
|
||||||
|
<option value="$PROJECT_DIR$/example/lib/inline_example.screen.dart" />
|
||||||
|
<option value="$PROJECT_DIR$/pubspec.yaml" />
|
||||||
|
<option value="$PROJECT_DIR$/CHANGELOG.md" />
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
@ -165,7 +214,6 @@
|
|||||||
<foldersAlwaysOnTop value="true" />
|
<foldersAlwaysOnTop value="true" />
|
||||||
</navigator>
|
</navigator>
|
||||||
<panes>
|
<panes>
|
||||||
<pane id="PackagesPane" />
|
|
||||||
<pane id="Scope">
|
<pane id="Scope">
|
||||||
<subPane subId="Project Files">
|
<subPane subId="Project Files">
|
||||||
<expand>
|
<expand>
|
||||||
@ -206,6 +254,7 @@
|
|||||||
<select />
|
<select />
|
||||||
</subPane>
|
</subPane>
|
||||||
</pane>
|
</pane>
|
||||||
|
<pane id="PackagesPane" />
|
||||||
<pane id="ProjectPane">
|
<pane id="ProjectPane">
|
||||||
<subPane>
|
<subPane>
|
||||||
<expand>
|
<expand>
|
||||||
@ -213,22 +262,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="android" 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" />
|
|
||||||
</path>
|
|
||||||
<path>
|
|
||||||
<item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
|
|
||||||
<item name="flutter_inappbrowser" type="462c0819:PsiDirectoryNode" />
|
|
||||||
<item name="example" type="462c0819:PsiDirectoryNode" />
|
|
||||||
<item name="android" 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" />
|
||||||
@ -257,13 +290,14 @@
|
|||||||
<property name="show.migrate.to.gradle.popup" value="false" />
|
<property name="show.migrate.to.gradle.popup" value="false" />
|
||||||
</component>
|
</component>
|
||||||
<component name="RecentsManager">
|
<component name="RecentsManager">
|
||||||
<key name="MoveFile.RECENT_KEYS">
|
|
||||||
<recent name="$PROJECT_DIR$/android/src/main/java" />
|
|
||||||
</key>
|
|
||||||
<key name="CopyFile.RECENT_KEYS">
|
<key name="CopyFile.RECENT_KEYS">
|
||||||
|
<recent name="$PROJECT_DIR$/example/assets" />
|
||||||
<recent name="$PROJECT_DIR$/example/assets/images" />
|
<recent name="$PROJECT_DIR$/example/assets/images" />
|
||||||
<recent name="$PROJECT_DIR$/android/libs" />
|
<recent name="$PROJECT_DIR$/android/libs" />
|
||||||
</key>
|
</key>
|
||||||
|
<key name="MoveFile.RECENT_KEYS">
|
||||||
|
<recent name="$PROJECT_DIR$/android/src/main/java" />
|
||||||
|
</key>
|
||||||
</component>
|
</component>
|
||||||
<component name="RunDashboard">
|
<component name="RunDashboard">
|
||||||
<option name="ruleStates">
|
<option name="ruleStates">
|
||||||
@ -278,24 +312,29 @@
|
|||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="RunManager">
|
<component name="RunManager">
|
||||||
<configuration default="true" type="AndroidJUnit" factoryName="Android JUnit">
|
<configuration name="<template>" type="Applet" default="true" selected="false">
|
||||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
<option name="MAIN_CLASS_NAME" />
|
||||||
<option name="ALTERNATIVE_JRE_PATH" />
|
<option name="HTML_FILE_NAME" />
|
||||||
<option name="PACKAGE_NAME" />
|
<option name="HTML_USED" value="false" />
|
||||||
|
<option name="WIDTH" value="400" />
|
||||||
|
<option name="HEIGHT" value="300" />
|
||||||
|
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
|
||||||
|
<option name="VM_PARAMETERS" />
|
||||||
|
</configuration>
|
||||||
|
<configuration name="<template>" type="JUnit" default="true" selected="false">
|
||||||
<option name="MAIN_CLASS_NAME" />
|
<option name="MAIN_CLASS_NAME" />
|
||||||
<option name="METHOD_NAME" />
|
|
||||||
<option name="TEST_OBJECT" value="class" />
|
|
||||||
<option name="VM_PARAMETERS" value="-ea" />
|
<option name="VM_PARAMETERS" value="-ea" />
|
||||||
<option name="PARAMETERS" />
|
<option name="PARAMETERS" />
|
||||||
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
|
<option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
|
||||||
<option name="PASS_PARENT_ENVS" value="true" />
|
</configuration>
|
||||||
<option name="TEST_SEARCH_SCOPE">
|
<configuration name="<template>" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" default="true" selected="false">
|
||||||
<value defaultName="singleModule" />
|
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
||||||
</option>
|
|
||||||
<patterns />
|
|
||||||
</configuration>
|
</configuration>
|
||||||
<configuration default="true" type="Application" factoryName="Application">
|
<configuration default="true" type="Application" factoryName="Application">
|
||||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||||
|
<method v="2">
|
||||||
|
<option name="Make" enabled="true" />
|
||||||
|
</method>
|
||||||
</configuration>
|
</configuration>
|
||||||
<configuration default="true" type="JetRunConfigurationType" factoryName="Kotlin">
|
<configuration default="true" type="JetRunConfigurationType" factoryName="Kotlin">
|
||||||
<module name="flutter_webview" />
|
<module name="flutter_webview" />
|
||||||
@ -306,6 +345,9 @@
|
|||||||
<option name="PASS_PARENT_ENVS" value="true" />
|
<option name="PASS_PARENT_ENVS" value="true" />
|
||||||
<option name="MAIN_CLASS_NAME" />
|
<option name="MAIN_CLASS_NAME" />
|
||||||
<option name="WORKING_DIRECTORY" />
|
<option name="WORKING_DIRECTORY" />
|
||||||
|
<method v="2">
|
||||||
|
<option name="Make" enabled="true" />
|
||||||
|
</method>
|
||||||
</configuration>
|
</configuration>
|
||||||
<configuration default="true" type="KotlinStandaloneScriptRunConfigurationType" factoryName="Kotlin script">
|
<configuration default="true" type="KotlinStandaloneScriptRunConfigurationType" factoryName="Kotlin script">
|
||||||
<module name="flutter_webview" />
|
<module name="flutter_webview" />
|
||||||
@ -339,46 +381,17 @@
|
|||||||
<option name="PASS_PARENT_ENVS" value="true" />
|
<option name="PASS_PARENT_ENVS" value="true" />
|
||||||
<option name="MAIN_CLASS_NAME" />
|
<option name="MAIN_CLASS_NAME" />
|
||||||
<option name="WORKING_DIRECTORY" />
|
<option name="WORKING_DIRECTORY" />
|
||||||
|
<method v="2">
|
||||||
|
<option name="Make" enabled="true" />
|
||||||
|
</method>
|
||||||
</configuration>
|
</configuration>
|
||||||
<configuration default="true" type="TestNG" factoryName="TestNG">
|
<configuration default="true" type="TestNG" factoryName="TestNG">
|
||||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
|
||||||
<option name="ALTERNATIVE_JRE_PATH" />
|
|
||||||
<option name="SUITE_NAME" />
|
|
||||||
<option name="PACKAGE_NAME" />
|
|
||||||
<option name="MAIN_CLASS_NAME" />
|
|
||||||
<option name="METHOD_NAME" />
|
|
||||||
<option name="GROUP_NAME" />
|
|
||||||
<option name="TEST_OBJECT" value="CLASS" />
|
|
||||||
<option name="VM_PARAMETERS" value="-ea" />
|
|
||||||
<option name="PARAMETERS" />
|
|
||||||
<option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
|
<option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
|
||||||
<option name="OUTPUT_DIRECTORY" />
|
|
||||||
<option name="PASS_PARENT_ENVS" value="true" />
|
|
||||||
<option name="TEST_SEARCH_SCOPE">
|
|
||||||
<value defaultName="singleModule" />
|
|
||||||
</option>
|
|
||||||
<option name="USE_DEFAULT_REPORTERS" value="false" />
|
|
||||||
<option name="PROPERTIES_FILE" />
|
|
||||||
<properties />
|
<properties />
|
||||||
<listeners />
|
<listeners />
|
||||||
</configuration>
|
<method v="2">
|
||||||
<configuration name="<template>" type="Applet" default="true" selected="false">
|
<option name="Make" enabled="true" />
|
||||||
<option name="MAIN_CLASS_NAME" />
|
</method>
|
||||||
<option name="HTML_FILE_NAME" />
|
|
||||||
<option name="HTML_USED" value="false" />
|
|
||||||
<option name="WIDTH" value="400" />
|
|
||||||
<option name="HEIGHT" value="300" />
|
|
||||||
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
|
|
||||||
<option name="VM_PARAMETERS" />
|
|
||||||
</configuration>
|
|
||||||
<configuration name="<template>" type="JUnit" default="true" selected="false">
|
|
||||||
<option name="MAIN_CLASS_NAME" />
|
|
||||||
<option name="VM_PARAMETERS" value="-ea" />
|
|
||||||
<option name="PARAMETERS" />
|
|
||||||
<option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
|
|
||||||
</configuration>
|
|
||||||
<configuration name="<template>" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" default="true" selected="false">
|
|
||||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
|
||||||
</configuration>
|
</configuration>
|
||||||
</component>
|
</component>
|
||||||
<component name="SvnConfiguration">
|
<component name="SvnConfiguration">
|
||||||
@ -396,40 +409,42 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="ToolWindowManager">
|
<component name="ToolWindowManager">
|
||||||
<frame x="0" y="23" width="1920" height="1057" extended-state="0" />
|
<frame x="0" y="23" width="1920" height="1057" extended-state="0" />
|
||||||
|
<editor active="true" />
|
||||||
<layout>
|
<layout>
|
||||||
<window_info anchor="bottom" id="Android Profiler" order="7" show_stripe_button="false" />
|
<window_info active="true" content_ui="combo" id="Project" order="0" sideWeight="0.6496815" visible="true" weight="0.18210863" />
|
||||||
<window_info anchor="bottom" id="TODO" order="6" />
|
<window_info id="Structure" order="1" sideWeight="0.35031846" side_tool="true" visible="true" weight="0.18210863" />
|
||||||
<window_info anchor="right" id="Palette	" order="9" />
|
|
||||||
<window_info id="Image Layers" order="7" />
|
|
||||||
<window_info id="Build Variants" order="3" side_tool="true" />
|
|
||||||
<window_info anchor="right" id="Capture Analysis" order="4" />
|
|
||||||
<window_info anchor="bottom" id="Event Log" order="8" sideWeight="0.5052169" side_tool="true" weight="0.34068358" />
|
|
||||||
<window_info anchor="bottom" id="Dart Analysis" order="14" weight="0.32745314" />
|
|
||||||
<window_info anchor="bottom" id="Run" order="2" sideWeight="0.49478307" weight="0.36926362" />
|
|
||||||
<window_info anchor="bottom" id="Version Control" order="9" />
|
|
||||||
<window_info active="true" anchor="bottom" id="Terminal" order="10" sideWeight="0.49533224" visible="true" weight="0.34471717" />
|
|
||||||
<window_info anchor="right" id="Flutter Outline" order="6" weight="0.32922077" />
|
|
||||||
<window_info anchor="bottom" id="Logcat" order="11" />
|
|
||||||
<window_info id="Captures" order="4" weight="0.32936507" />
|
|
||||||
<window_info id="Capture Tool" order="6" />
|
|
||||||
<window_info id="Designer" order="2" />
|
<window_info id="Designer" order="2" />
|
||||||
<window_info content_ui="combo" id="Project" order="0" sideWeight="0.6547231" visible="true" weight="0.18210863" />
|
<window_info id="Build Variants" order="3" side_tool="true" />
|
||||||
<window_info id="Structure" order="1" sideWeight="0.34527686" side_tool="true" visible="true" weight="0.18210863" />
|
<window_info id="Captures" order="4" side_tool="true" weight="0.32936507" />
|
||||||
<window_info anchor="right" id="Device File Explorer" order="5" side_tool="true" />
|
|
||||||
<window_info anchor="right" id="Theme Preview" order="7" />
|
|
||||||
<window_info anchor="bottom" id="Debug" order="3" weight="0.34288865" />
|
|
||||||
<window_info id="Favorites" order="5" side_tool="true" />
|
<window_info id="Favorites" order="5" side_tool="true" />
|
||||||
<window_info anchor="right" id="Flutter Inspector" order="3" weight="0.32938388" />
|
<window_info id="Capture Tool" order="6" />
|
||||||
<window_info anchor="bottom" id="Messages" order="12" weight="0.23585913" />
|
<window_info id="Image Layers" order="7" />
|
||||||
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
|
<window_info anchor="bottom" id="Flutter Performance" side_tool="true" />
|
||||||
<window_info anchor="right" id="Commander" order="0" weight="0.4" />
|
|
||||||
<window_info anchor="right" id="Assistant" order="8" visible="true" weight="0.3295129" />
|
|
||||||
<window_info anchor="bottom" id="Message" order="0" />
|
<window_info anchor="bottom" id="Message" order="0" />
|
||||||
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
|
|
||||||
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
|
|
||||||
<window_info anchor="bottom" id="Dependency Viewer" order="13" weight="0.32800853" />
|
|
||||||
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
|
|
||||||
<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" weight="0.30522946" />
|
||||||
|
<window_info anchor="bottom" id="Debug" order="3" weight="0.34288865" />
|
||||||
|
<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="TODO" order="6" />
|
||||||
|
<window_info anchor="bottom" id="Android Profiler" order="7" show_stripe_button="false" />
|
||||||
|
<window_info anchor="bottom" id="Event Log" order="8" sideWeight="0.5052169" side_tool="true" weight="0.34068358" />
|
||||||
|
<window_info anchor="bottom" id="Version Control" order="9" />
|
||||||
|
<window_info anchor="bottom" id="Terminal" order="10" sideWeight="0.49533224" weight="0.2113127" />
|
||||||
|
<window_info anchor="bottom" id="Logcat" order="11" />
|
||||||
|
<window_info anchor="bottom" id="Messages" order="12" weight="0.23585913" />
|
||||||
|
<window_info anchor="bottom" id="Dependency Viewer" order="13" weight="0.32800853" />
|
||||||
|
<window_info anchor="bottom" id="Dart Analysis" order="14" weight="0.32657418" />
|
||||||
|
<window_info anchor="right" id="Commander" order="0" weight="0.4" />
|
||||||
|
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
|
||||||
|
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
|
||||||
|
<window_info anchor="right" id="Flutter Inspector" order="3" weight="0.3290735" />
|
||||||
|
<window_info anchor="right" id="Capture Analysis" order="4" />
|
||||||
|
<window_info anchor="right" id="Device File Explorer" order="5" side_tool="true" />
|
||||||
|
<window_info anchor="right" id="Flutter Outline" order="6" weight="0.32922077" />
|
||||||
|
<window_info anchor="right" id="Theme Preview" order="7" />
|
||||||
|
<window_info anchor="right" id="Assistant" order="8" weight="0.3290735" />
|
||||||
|
<window_info anchor="right" id="Palette	" order="9" />
|
||||||
</layout>
|
</layout>
|
||||||
</component>
|
</component>
|
||||||
<component name="UnknownFeatures">
|
<component name="UnknownFeatures">
|
||||||
@ -438,21 +453,7 @@
|
|||||||
<component name="VcsContentAnnotationSettings">
|
<component name="VcsContentAnnotationSettings">
|
||||||
<option name="myLimit" value="2678400000" />
|
<option name="myLimit" value="2678400000" />
|
||||||
</component>
|
</component>
|
||||||
<component name="XDebuggerManager">
|
|
||||||
<breakpoint-manager>
|
|
||||||
<option name="time" value="15" />
|
|
||||||
</breakpoint-manager>
|
|
||||||
</component>
|
|
||||||
<component name="editorHistoryManager">
|
<component name="editorHistoryManager">
|
||||||
<entry file="file://$PROJECT_DIR$/android/gradlew.bat" />
|
|
||||||
<entry file="file://$PROJECT_DIR$/flutter_inappbrowser_android.iml">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="420">
|
|
||||||
<caret line="28" column="14" lean-forward="true" selection-start-line="28" selection-start-column="14" selection-end-line="28" selection-end-column="14" />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/android/flutter_inappbrowser.iml" />
|
|
||||||
<entry file="file://$PROJECT_DIR$/.idea/workspace.xml">
|
<entry file="file://$PROJECT_DIR$/.idea/workspace.xml">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state relative-caret-position="-10645" />
|
<state relative-caret-position="-10645" />
|
||||||
@ -466,16 +467,7 @@
|
|||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/example/assets/images/dart.svg">
|
<entry file="file://$PROJECT_DIR$/example/assets/images/dart.svg">
|
||||||
<provider selected="true" editor-type-id="images">
|
<provider selected="true" editor-type-id="images" />
|
||||||
<state />
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/example/assets/css/style.css">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="75">
|
|
||||||
<caret line="5" column="20" selection-start-line="5" selection-start-column="20" selection-end-line="5" selection-end-column="20" />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/flutter_inappbrowser.iml">
|
<entry file="file://$PROJECT_DIR$/flutter_inappbrowser.iml">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
@ -485,39 +477,25 @@
|
|||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/example/ios/ServiceDefinitions.json">
|
<entry file="file://$PROJECT_DIR$/example/ios/ServiceDefinitions.json">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor" />
|
||||||
<state />
|
|
||||||
</provider>
|
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/example/flutter_webview_example.iml">
|
<entry file="file://$PROJECT_DIR$/example/flutter_webview_example.iml">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor" />
|
||||||
<state />
|
|
||||||
</provider>
|
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/example/flutter_webview_example_android.iml">
|
<entry file="file://$PROJECT_DIR$/example/flutter_webview_example_android.iml">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor" />
|
||||||
<state />
|
|
||||||
</provider>
|
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/example/ios/Pods/Target Support Files/flutter_inappbrowser/flutter_inappbrowser-prefix.pch">
|
<entry file="file://$PROJECT_DIR$/example/ios/Pods/Target Support Files/flutter_inappbrowser/flutter_inappbrowser-prefix.pch">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor" />
|
||||||
<state />
|
|
||||||
</provider>
|
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/example/ios/Pods/Target Support Files/flutter_inappbrowser/flutter_inappbrowser-dummy.m">
|
<entry file="file://$PROJECT_DIR$/example/ios/Pods/Target Support Files/flutter_inappbrowser/flutter_inappbrowser-dummy.m">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor" />
|
||||||
<state />
|
|
||||||
</provider>
|
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/example/ios/Pods/Target Support Files/flutter_inappbrowser/flutter_inappbrowser.xcconfig">
|
<entry file="file://$PROJECT_DIR$/example/ios/Pods/Target Support Files/flutter_inappbrowser/flutter_inappbrowser.xcconfig">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor" />
|
||||||
<state />
|
|
||||||
</provider>
|
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/example/ios/Pods/Target Support Files/flutter_inappbrowser/flutter_inappbrowser-umbrella.h">
|
<entry file="file://$PROJECT_DIR$/example/ios/Pods/Target Support Files/flutter_inappbrowser/flutter_inappbrowser-umbrella.h">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor" />
|
||||||
<state />
|
|
||||||
</provider>
|
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/example/ios/Pods/Target Support Files/flutter_inappbrowser/Info.plist">
|
<entry file="file://$PROJECT_DIR$/example/ios/Pods/Target Support Files/flutter_inappbrowser/Info.plist">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
@ -535,16 +513,7 @@
|
|||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/example/README.md" />
|
<entry file="file://$PROJECT_DIR$/example/README.md" />
|
||||||
<entry file="file://$PROJECT_DIR$/pubspec.lock">
|
<entry file="file://$PROJECT_DIR$/pubspec.lock">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor" />
|
||||||
<state />
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/example/assets/index.html">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state>
|
|
||||||
<caret selection-end-line="33" selection-end-column="7" />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebView.java">
|
<entry file="file://$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebView.java">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
@ -553,31 +522,8 @@
|
|||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/ios/flutter_inappbrowser.podspec">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="330">
|
|
||||||
<caret line="22" selection-start-line="22" selection-end-line="22" />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/example/lib/webview_example.screen.dart">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="254">
|
|
||||||
<caret line="63" column="2" selection-start-line="63" selection-start-column="2" selection-end-line="63" selection-end-column="2" />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/example/lib/test.dart">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="590">
|
|
||||||
<caret line="475" selection-start-line="343" selection-end-line="475" />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/android/local.properties">
|
<entry file="file://$PROJECT_DIR$/android/local.properties">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor" />
|
||||||
<state />
|
|
||||||
</provider>
|
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/example/android/gradle/wrapper/gradle-wrapper.properties">
|
<entry file="file://$PROJECT_DIR$/example/android/gradle/wrapper/gradle-wrapper.properties">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
@ -601,19 +547,13 @@
|
|||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/example/ios/Flutter/App.framework/Info.plist">
|
<entry file="file://$PROJECT_DIR$/example/ios/Flutter/App.framework/Info.plist">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor" />
|
||||||
<state />
|
|
||||||
</provider>
|
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/example/ios/Flutter/Flutter.framework/Info.plist">
|
<entry file="file://$PROJECT_DIR$/example/ios/Flutter/Flutter.framework/Info.plist">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor" />
|
||||||
<state />
|
|
||||||
</provider>
|
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/example/ios/Flutter/AppFrameworkInfo.plist">
|
<entry file="file://$PROJECT_DIR$/example/ios/Flutter/AppFrameworkInfo.plist">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor" />
|
||||||
<state />
|
|
||||||
</provider>
|
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/example/ios/Runner/Info.plist">
|
<entry file="file://$PROJECT_DIR$/example/ios/Runner/Info.plist">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
@ -637,45 +577,16 @@
|
|||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/example/.packages">
|
<entry file="file://$PROJECT_DIR$/example/.packages">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor" />
|
||||||
<state />
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/example/lib/inline_example.screen.dart">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="210">
|
|
||||||
<caret line="14" column="20" selection-start-line="14" selection-start-column="20" selection-end-line="14" selection-end-column="20" />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/example/lib/chrome_safari_example.screen.dart">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="360">
|
|
||||||
<caret line="24" column="80" selection-start-line="24" selection-start-column="68" selection-end-line="24" selection-end-column="80" />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/android/.idea/gradle.xml">
|
<entry file="file://$PROJECT_DIR$/android/.idea/gradle.xml">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor" />
|
||||||
<state />
|
|
||||||
</provider>
|
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/android/.idea/misc.xml">
|
<entry file="file://$PROJECT_DIR$/android/.idea/misc.xml">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor" />
|
||||||
<state />
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/pubspec.yaml">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="45">
|
|
||||||
<caret line="3" column="52" selection-start-line="3" selection-start-column="52" selection-end-line="3" selection-end-column="52" />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/example/build/app/intermediates/incremental/mergeDebugResources/merged.dir/values-v28/values-v28.xml">
|
<entry file="file://$PROJECT_DIR$/example/build/app/intermediates/incremental/mergeDebugResources/merged.dir/values-v28/values-v28.xml">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor" />
|
||||||
<state />
|
|
||||||
</provider>
|
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/example/android/app/build.gradle">
|
<entry file="file://$PROJECT_DIR$/example/android/app/build.gradle">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
@ -698,41 +609,6 @@
|
|||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="15">
|
|
||||||
<caret line="1" selection-start-line="1" selection-end-line="1" />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/lib/flutter_inappbrowser.dart">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state>
|
|
||||||
<caret line="429" column="25" selection-start-line="429" selection-start-column="11" selection-end-line="429" selection-end-column="25" />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/example/lib/main.dart">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="15">
|
|
||||||
<caret line="4" column="44" selection-start-line="4" selection-start-column="16" selection-end-line="4" selection-end-column="44" />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/example/pubspec.yaml">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="15">
|
|
||||||
<caret line="24" column="16" selection-start-line="24" selection-start-column="16" selection-end-line="24" selection-end-column="16" />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/README.md">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="113">
|
|
||||||
<caret line="19" column="185" selection-start-line="19" selection-end-line="19" selection-end-column="185" />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/example/android/build.gradle">
|
<entry file="file://$PROJECT_DIR$/example/android/build.gradle">
|
||||||
<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="195">
|
||||||
@ -740,13 +616,132 @@
|
|||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/README.md">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="15">
|
||||||
|
<caret line="24" column="39" selection-start-line="24" selection-start-column="39" selection-end-line="24" selection-end-column="39" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/android/build.gradle">
|
<entry file="file://$PROJECT_DIR$/android/build.gradle">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state relative-caret-position="195">
|
<state>
|
||||||
<caret line="13" selection-start-line="13" selection-end-line="14" selection-end-column="22" />
|
<caret line="13" selection-start-line="13" selection-end-line="14" selection-end-column="22" />
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/ios/flutter_inappbrowser.podspec">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="330">
|
||||||
|
<caret line="22" selection-start-line="22" selection-end-line="22" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/example/pubspec.yaml">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="315">
|
||||||
|
<caret line="44" column="19" selection-start-line="44" selection-start-column="19" selection-end-line="44" selection-end-column="19" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/example/assets/page-2.html">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="270">
|
||||||
|
<caret line="18" column="30" selection-start-line="18" selection-start-column="30" selection-end-line="18" selection-end-column="30" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/example/assets/page-3.html">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="270">
|
||||||
|
<caret line="18" column="30" selection-start-line="18" selection-start-column="30" selection-end-line="18" selection-end-column="30" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/example/assets/page-1.html">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="270">
|
||||||
|
<caret line="18" column="30" selection-start-line="18" selection-start-column="30" selection-end-line="18" selection-end-column="30" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/example/assets/index.html">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="270">
|
||||||
|
<caret line="18" column="28" selection-start-line="18" selection-start-column="28" selection-end-line="18" selection-end-column="28" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/example/assets/css/style.css">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="75">
|
||||||
|
<caret line="5" column="20" selection-start-line="5" selection-start-column="20" selection-end-line="5" selection-end-column="20" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/example/lib/chrome_safari_example.screen.dart">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="435">
|
||||||
|
<caret line="32" column="22" lean-forward="true" selection-start-line="32" selection-start-column="22" selection-end-line="32" selection-end-column="22" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/lib/flutter_inappbrowser.dart">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="205">
|
||||||
|
<caret line="371" column="13" selection-start-line="371" selection-start-column="7" selection-end-line="371" selection-end-column="13" />
|
||||||
|
<folding>
|
||||||
|
<element signature="e#0#65617#0" expanded="true" />
|
||||||
|
<element signature="e#814#831#0" expanded="true" />
|
||||||
|
</folding>
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/example/lib/webview_example.screen.dart">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="-217">
|
||||||
|
<caret line="19" column="33" lean-forward="true" selection-start-line="19" selection-start-column="33" selection-end-line="19" selection-end-column="33" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/example/lib/inline_example.screen.dart">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="371">
|
||||||
|
<caret line="67" column="37" lean-forward="true" selection-start-line="67" selection-start-column="37" selection-end-line="67" selection-end-column="37" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/example/lib/test.dart">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="184">
|
||||||
|
<caret line="110" column="8" selection-start-line="110" selection-start-column="8" selection-end-line="138" selection-end-column="123" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/example/lib/main.dart">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="210">
|
||||||
|
<caret line="14" column="27" selection-start-line="14" selection-start-column="27" selection-end-line="14" selection-end-column="27" />
|
||||||
|
<folding>
|
||||||
|
<element signature="e#0#20#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="45">
|
||||||
|
<caret line="3" column="24" selection-start-line="3" selection-start-column="24" selection-end-line="3" selection-end-column="24" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="45">
|
||||||
|
<caret line="3" column="19" lean-forward="true" selection-start-line="3" selection-start-column="19" selection-end-line="3" selection-end-column="19" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
</component>
|
</component>
|
||||||
<component name="masterDetails">
|
<component name="masterDetails">
|
||||||
<states>
|
<states>
|
||||||
|
@ -1,7 +1,12 @@
|
|||||||
|
## 1.0.1
|
||||||
|
|
||||||
|
- Fixed Unable to load initialFile on iOS #56
|
||||||
|
- Some code cleanup
|
||||||
|
|
||||||
## 1.0.0
|
## 1.0.0
|
||||||
|
|
||||||
Breaking changes:
|
Breaking changes:
|
||||||
- Fixed [Flutter AndroidX compatibility](https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility), the latest version that doesn't use `AndroidX` is `0.6.0`.
|
- Fixed [Flutter AndroidX compatibility](https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility), the latest version that doesn't use `AndroidX` is `0.6.0` (thanks to [juicycleff](https://github.com/juicycleff)).
|
||||||
|
|
||||||
## 0.6.0
|
## 0.6.0
|
||||||
|
|
||||||
|
@ -13,6 +13,8 @@ This plugin is inspired by the popular [cordova-plugin-inappbrowser](https://git
|
|||||||
### Requirements
|
### Requirements
|
||||||
- Dart sdk: ">=2.1.0-dev.7.1 <3.0.0"
|
- Dart sdk: ">=2.1.0-dev.7.1 <3.0.0"
|
||||||
- Flutter: ">=0.10.1 <2.0.0"
|
- Flutter: ">=0.10.1 <2.0.0"
|
||||||
|
- Android: `minSdkVersion 17`
|
||||||
|
- iOS: `--ios-language swift`
|
||||||
|
|
||||||
### Note for Android
|
### Note for Android
|
||||||
During the build, if Android fails with `Error: uses-sdk:minSdkVersion 16 cannot be smaller than version 17 declared in library`, it means that you need to update the `minSdkVersion` of your `build.gradle` file to at least `17`.
|
During the build, if Android fails with `Error: uses-sdk:minSdkVersion 16 cannot be smaller than version 17 declared in library`, it means that you need to update the `minSdkVersion` of your `build.gradle` file to at least `17`.
|
||||||
|
@ -128,8 +128,7 @@ public class FlutterWebView implements PlatformView, MethodCallHandler {
|
|||||||
case "injectScriptCode":
|
case "injectScriptCode":
|
||||||
if (webView != null) {
|
if (webView != null) {
|
||||||
source = call.argument("source").toString();
|
source = call.argument("source").toString();
|
||||||
jsWrapper = "(function(){return JSON.stringify(eval(%s));})();";
|
webView.injectScriptCode(source, result);
|
||||||
webView.injectDeferredObject(source, jsWrapper, result);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
result.success("");
|
result.success("");
|
||||||
@ -138,24 +137,21 @@ public class FlutterWebView implements PlatformView, MethodCallHandler {
|
|||||||
case "injectScriptFile":
|
case "injectScriptFile":
|
||||||
if (webView != null) {
|
if (webView != null) {
|
||||||
urlFile = call.argument("urlFile").toString();
|
urlFile = call.argument("urlFile").toString();
|
||||||
jsWrapper = "(function(d) { var c = d.createElement('script'); c.src = %s; d.body.appendChild(c); })(document);";
|
webView.injectScriptFile(urlFile);
|
||||||
webView.injectDeferredObject(urlFile, jsWrapper, null);
|
|
||||||
}
|
}
|
||||||
result.success(true);
|
result.success(true);
|
||||||
break;
|
break;
|
||||||
case "injectStyleCode":
|
case "injectStyleCode":
|
||||||
if (webView != null) {
|
if (webView != null) {
|
||||||
source = call.argument("source").toString();
|
source = call.argument("source").toString();
|
||||||
jsWrapper = "(function(d) { var c = d.createElement('style'); c.innerHTML = %s; d.body.appendChild(c); })(document);";
|
webView.injectStyleCode(source);
|
||||||
webView.injectDeferredObject(source, jsWrapper, null);
|
|
||||||
}
|
}
|
||||||
result.success(true);
|
result.success(true);
|
||||||
break;
|
break;
|
||||||
case "injectStyleFile":
|
case "injectStyleFile":
|
||||||
if (webView != null) {
|
if (webView != null) {
|
||||||
urlFile = call.argument("urlFile").toString();
|
urlFile = call.argument("urlFile").toString();
|
||||||
jsWrapper = "(function(d) { var c = d.createElement('link'); c.rel='stylesheet'; c.type='text/css'; c.href = %s; d.head.appendChild(c); })(document);";
|
webView.injectStyleFile(urlFile);
|
||||||
webView.injectDeferredObject(urlFile, jsWrapper, null);
|
|
||||||
}
|
}
|
||||||
result.success(true);
|
result.success(true);
|
||||||
break;
|
break;
|
||||||
|
@ -198,7 +198,7 @@ public class InAppBrowserActivity extends AppCompatActivity {
|
|||||||
if (webView != null) {
|
if (webView != null) {
|
||||||
webView.loadUrl(url, result);
|
webView.loadUrl(url, result);
|
||||||
} else {
|
} else {
|
||||||
result.error(LOG_TAG, "Cannot load url " + url, null);
|
result.error(LOG_TAG, "webView is null", null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,7 +206,7 @@ public class InAppBrowserActivity extends AppCompatActivity {
|
|||||||
if (webView != null) {
|
if (webView != null) {
|
||||||
webView.loadUrl(url, headers, result);
|
webView.loadUrl(url, headers, result);
|
||||||
} else {
|
} else {
|
||||||
result.error(LOG_TAG, "Cannot load url " + url, null);
|
result.error(LOG_TAG, "webView is null", null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,7 +214,7 @@ public class InAppBrowserActivity extends AppCompatActivity {
|
|||||||
if (webView != null) {
|
if (webView != null) {
|
||||||
webView.postUrl(url, postData, result);
|
webView.postUrl(url, postData, result);
|
||||||
} else {
|
} else {
|
||||||
result.error(LOG_TAG, "Cannot load url " + url, null);
|
result.error(LOG_TAG, "webView is null", null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,7 +222,7 @@ public class InAppBrowserActivity extends AppCompatActivity {
|
|||||||
if (webView != null) {
|
if (webView != null) {
|
||||||
webView.loadData(data, mimeType, encoding, baseUrl, result);
|
webView.loadData(data, mimeType, encoding, baseUrl, result);
|
||||||
} else {
|
} else {
|
||||||
result.error(LOG_TAG, "Cannot load data", null);
|
result.error(LOG_TAG, "webView is null", null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,7 +230,7 @@ public class InAppBrowserActivity extends AppCompatActivity {
|
|||||||
if (webView != null) {
|
if (webView != null) {
|
||||||
webView.loadFile(url, result);
|
webView.loadFile(url, result);
|
||||||
} else {
|
} else {
|
||||||
result.error(LOG_TAG, "Cannot load file " + url, null);
|
result.error(LOG_TAG, "webView is null", null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,7 +238,7 @@ public class InAppBrowserActivity extends AppCompatActivity {
|
|||||||
if (webView != null) {
|
if (webView != null) {
|
||||||
webView.loadFile(url, headers, result);
|
webView.loadFile(url, headers, result);
|
||||||
} else {
|
} else {
|
||||||
result.error(LOG_TAG, "Cannot load file " + url, null);
|
result.error(LOG_TAG, "webView is null", null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -420,13 +420,28 @@ public class InAppBrowserActivity extends AppCompatActivity {
|
|||||||
return optionsMap;
|
return optionsMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void injectDeferredObject(String source, String jsWrapper, MethodChannel.Result result) {
|
public void injectScriptCode(String source, MethodChannel.Result result) {
|
||||||
if (webView != null)
|
if (webView != null)
|
||||||
webView.injectDeferredObject(source, jsWrapper, result);
|
webView.injectScriptCode(source, result);
|
||||||
else
|
else
|
||||||
result.success("");
|
result.success("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void injectScriptFile(String urlFile) {
|
||||||
|
if (webView != null)
|
||||||
|
webView.injectScriptFile(urlFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void injectStyleCode(String source) {
|
||||||
|
if (webView != null)
|
||||||
|
webView.injectStyleCode(source);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void injectStyleFile(String urlFile) {
|
||||||
|
if (webView != null)
|
||||||
|
webView.injectStyleFile(urlFile);
|
||||||
|
}
|
||||||
|
|
||||||
public HashMap<String, Object> getCopyBackForwardList() {
|
public HashMap<String, Object> getCopyBackForwardList() {
|
||||||
if (webView != null)
|
if (webView != null)
|
||||||
return webView.getCopyBackForwardList();
|
return webView.getCopyBackForwardList();
|
||||||
|
@ -212,25 +212,21 @@ public class InAppBrowserFlutterPlugin implements MethodCallHandler {
|
|||||||
break;
|
break;
|
||||||
case "injectScriptCode":
|
case "injectScriptCode":
|
||||||
source = call.argument("source").toString();
|
source = call.argument("source").toString();
|
||||||
jsWrapper = "(function(){return JSON.stringify(eval(%s));})();";
|
injectScriptCode(uuid, source, result);
|
||||||
injectDeferredObject(uuid, source, jsWrapper, result);
|
|
||||||
break;
|
break;
|
||||||
case "injectScriptFile":
|
case "injectScriptFile":
|
||||||
urlFile = call.argument("urlFile").toString();
|
urlFile = call.argument("urlFile").toString();
|
||||||
jsWrapper = "(function(d) { var c = d.createElement('script'); c.src = %s; d.body.appendChild(c); })(document);";
|
injectScriptFile(uuid, urlFile);
|
||||||
injectDeferredObject(uuid, urlFile, jsWrapper, null);
|
|
||||||
result.success(true);
|
result.success(true);
|
||||||
break;
|
break;
|
||||||
case "injectStyleCode":
|
case "injectStyleCode":
|
||||||
source = call.argument("source").toString();
|
source = call.argument("source").toString();
|
||||||
jsWrapper = "(function(d) { var c = d.createElement('style'); c.innerHTML = %s; d.body.appendChild(c); })(document);";
|
injectStyleCode(uuid, source);
|
||||||
injectDeferredObject(uuid, source, jsWrapper, null);
|
|
||||||
result.success(true);
|
result.success(true);
|
||||||
break;
|
break;
|
||||||
case "injectStyleFile":
|
case "injectStyleFile":
|
||||||
urlFile = call.argument("urlFile").toString();
|
urlFile = call.argument("urlFile").toString();
|
||||||
jsWrapper = "(function(d) { var c = d.createElement('link'); c.rel='stylesheet'; c.type='text/css'; c.href = %s; d.head.appendChild(c); })(document);";
|
injectStyleFile(uuid, urlFile);
|
||||||
injectDeferredObject(uuid, urlFile, jsWrapper, null);
|
|
||||||
result.success(true);
|
result.success(true);
|
||||||
break;
|
break;
|
||||||
case "show":
|
case "show":
|
||||||
@ -307,12 +303,33 @@ public class InAppBrowserFlutterPlugin implements MethodCallHandler {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void injectDeferredObject(String uuid, String source, String jsWrapper, final Result result) {
|
private void injectScriptCode(String uuid, String source, final Result result) {
|
||||||
final InAppBrowserActivity inAppBrowserActivity = webViewActivities.get(uuid);
|
final InAppBrowserActivity inAppBrowserActivity = webViewActivities.get(uuid);
|
||||||
if (inAppBrowserActivity != null) {
|
if (inAppBrowserActivity != null) {
|
||||||
inAppBrowserActivity.injectDeferredObject(source, jsWrapper, result);
|
inAppBrowserActivity.injectScriptCode(source, result);
|
||||||
} else {
|
} else {
|
||||||
Log.d(LOG_TAG, "Can't inject code into the system browser");
|
Log.d(LOG_TAG, "webView is null");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void injectScriptFile(String uuid, String urlFile) {
|
||||||
|
final InAppBrowserActivity inAppBrowserActivity = webViewActivities.get(uuid);
|
||||||
|
if (inAppBrowserActivity != null) {
|
||||||
|
inAppBrowserActivity.injectScriptFile(urlFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void injectStyleCode(String uuid, String source) {
|
||||||
|
final InAppBrowserActivity inAppBrowserActivity = webViewActivities.get(uuid);
|
||||||
|
if (inAppBrowserActivity != null) {
|
||||||
|
inAppBrowserActivity.injectStyleCode(source);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void injectStyleFile(String uuid, String urlFile) {
|
||||||
|
final InAppBrowserActivity inAppBrowserActivity = webViewActivities.get(uuid);
|
||||||
|
if (inAppBrowserActivity != null) {
|
||||||
|
inAppBrowserActivity.injectStyleFile(urlFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -406,6 +406,26 @@ public class InAppWebView extends WebView {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void injectScriptCode(String source, MethodChannel.Result result) {
|
||||||
|
String jsWrapper = "(function(){return JSON.stringify(eval(%s));})();";
|
||||||
|
injectDeferredObject(source, jsWrapper, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void injectScriptFile(String urlFile) {
|
||||||
|
String jsWrapper = "(function(d) { var c = d.createElement('script'); c.src = %s; d.body.appendChild(c); })(document);";
|
||||||
|
injectDeferredObject(urlFile, jsWrapper, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void injectStyleCode(String source) {
|
||||||
|
String jsWrapper = "(function(d) { var c = d.createElement('style'); c.innerHTML = %s; d.body.appendChild(c); })(document);";
|
||||||
|
injectDeferredObject(source, jsWrapper, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void injectStyleFile(String urlFile) {
|
||||||
|
String jsWrapper = "(function(d) { var c = d.createElement('link'); c.rel='stylesheet'; c.type='text/css'; c.href = %s; d.head.appendChild(c); })(document);";
|
||||||
|
injectDeferredObject(urlFile, jsWrapper, null);
|
||||||
|
}
|
||||||
|
|
||||||
public HashMap<String, Object> getCopyBackForwardList() {
|
public HashMap<String, Object> getCopyBackForwardList() {
|
||||||
WebBackForwardList currentList = copyBackForwardList();
|
WebBackForwardList currentList = copyBackForwardList();
|
||||||
int currentSize = currentList.getSize();
|
int currentSize = currentList.getSize();
|
||||||
|
@ -16,13 +16,13 @@
|
|||||||
<img src="images/dart.svg" alt="dart logo">
|
<img src="images/dart.svg" alt="dart logo">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
One of three columns
|
<a href="page-1.html">PAGE 1</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
One of three columns
|
<a href="page-2.html">PAGE 2</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
One of three columns
|
<a href="page-3.html">PAGE 3</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
31
example/assets/page-1.html
Normal file
31
example/assets/page-1.html
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport"
|
||||||
|
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
<title>Document</title>
|
||||||
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
|
||||||
|
<link rel="stylesheet" href="css/style.css">
|
||||||
|
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<div class="container">
|
||||||
|
<img src="images/dart.svg" alt="dart logo">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm">
|
||||||
|
<a href="index.html">GO BACK HOME</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<h1>PAGE 1</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
console.log("page 1");
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
31
example/assets/page-2.html
Normal file
31
example/assets/page-2.html
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport"
|
||||||
|
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
<title>Document</title>
|
||||||
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
|
||||||
|
<link rel="stylesheet" href="css/style.css">
|
||||||
|
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<div class="container">
|
||||||
|
<img src="images/dart.svg" alt="dart logo">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm">
|
||||||
|
<a href="index.html">GO BACK HOME</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<h1>PAGE 2</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
console.log("page 2");
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
31
example/assets/page-3.html
Normal file
31
example/assets/page-3.html
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport"
|
||||||
|
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
<title>Document</title>
|
||||||
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
|
||||||
|
<link rel="stylesheet" href="css/style.css">
|
||||||
|
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<div class="container">
|
||||||
|
<img src="images/dart.svg" alt="dart logo">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm">
|
||||||
|
<a href="index.html">GO BACK HOME</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<h1>PAGE 3</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
console.log("page 3");
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -9,7 +9,6 @@
|
|||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||||
25A517508F43E58C47090625 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E8D91E403808A7540F18B75D /* Pods_Runner.framework */; };
|
25A517508F43E58C47090625 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E8D91E403808A7540F18B75D /* Pods_Runner.framework */; };
|
||||||
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; };
|
|
||||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||||
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
|
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
|
||||||
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||||
@ -39,7 +38,6 @@
|
|||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
||||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
||||||
2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
|
|
||||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
||||||
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
|
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
|
||||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||||
@ -88,7 +86,6 @@
|
|||||||
9740EEB11CF90186004384FC /* Flutter */ = {
|
9740EEB11CF90186004384FC /* Flutter */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
2D5378251FAA1A9400D5DBA9 /* flutter_assets */,
|
|
||||||
3B80C3931E831B6300D905FE /* App.framework */,
|
3B80C3931E831B6300D905FE /* App.framework */,
|
||||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
|
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
|
||||||
9740EEBA1CF902C7004384FC /* Flutter.framework */,
|
9740EEBA1CF902C7004384FC /* Flutter.framework */,
|
||||||
@ -209,7 +206,6 @@
|
|||||||
EDC1147F21735BC200D2247A /* Main.storyboard in Resources */,
|
EDC1147F21735BC200D2247A /* Main.storyboard in Resources */,
|
||||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
|
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
|
||||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
|
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
|
||||||
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,
|
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
@ -38,7 +38,7 @@ class _ChromeSafariExampleScreenState extends State<ChromeSafariExampleScreen> {
|
|||||||
return new Center(
|
return new Center(
|
||||||
child: new RaisedButton(
|
child: new RaisedButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await widget.browser.open("https://flutter.io/");
|
await widget.browser.open("https://flutter.dev/");
|
||||||
},
|
},
|
||||||
child: Text("Open Chrome Safari Browser")),
|
child: Text("Open Chrome Safari Browser")),
|
||||||
);
|
);
|
||||||
|
@ -40,9 +40,12 @@ class _InlineExampleScreenState extends State<InlineExampleScreen> {
|
|||||||
decoration:
|
decoration:
|
||||||
BoxDecoration(border: Border.all(color: Colors.blueAccent)),
|
BoxDecoration(border: Border.all(color: Colors.blueAccent)),
|
||||||
child: InAppWebView(
|
child: InAppWebView(
|
||||||
initialUrl: "https://flutter.io/",
|
initialUrl: "https://flutter.dev/",
|
||||||
initialHeaders: {},
|
initialHeaders: {},
|
||||||
initialOptions: {},
|
initialOptions: {
|
||||||
|
"useShouldOverrideUrlLoading": true,
|
||||||
|
"useOnLoadResource": true
|
||||||
|
},
|
||||||
onWebViewCreated: (InAppWebViewController controller) {
|
onWebViewCreated: (InAppWebViewController controller) {
|
||||||
webView = controller;
|
webView = controller;
|
||||||
},
|
},
|
||||||
@ -52,12 +55,22 @@ class _InlineExampleScreenState extends State<InlineExampleScreen> {
|
|||||||
this.url = url;
|
this.url = url;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
onLoadStop: (InAppWebViewController controller, String url) {
|
||||||
|
print("stopped $url");
|
||||||
|
},
|
||||||
onProgressChanged:
|
onProgressChanged:
|
||||||
(InAppWebViewController controller, int progress) {
|
(InAppWebViewController controller, int progress) {
|
||||||
setState(() {
|
setState(() {
|
||||||
this.progress = progress / 100;
|
this.progress = progress / 100;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
shouldOverrideUrlLoading: (InAppWebViewController controller, String url) {
|
||||||
|
print("override $url");
|
||||||
|
controller.loadUrl(url);
|
||||||
|
},
|
||||||
|
onLoadResource: (InAppWebViewController controller, WebResourceResponse response, WebResourceRequest request) {
|
||||||
|
print("resource " + request.url);
|
||||||
|
}
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -5,7 +5,10 @@ import 'package:flutter_inappbrowser_example/chrome_safari_example.screen.dart';
|
|||||||
import 'package:flutter_inappbrowser_example/inline_example.screen.dart';
|
import 'package:flutter_inappbrowser_example/inline_example.screen.dart';
|
||||||
import 'package:flutter_inappbrowser_example/webview_example.screen.dart';
|
import 'package:flutter_inappbrowser_example/webview_example.screen.dart';
|
||||||
|
|
||||||
|
// InAppLocalhostServer localhostServer = new InAppLocalhostServer();
|
||||||
|
|
||||||
Future main() async {
|
Future main() async {
|
||||||
|
// await localhostServer.start();
|
||||||
runApp(new MyApp());
|
runApp(new MyApp());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ class MyInappBrowser extends InAppBrowser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class WebviewExampleScreen extends StatefulWidget {
|
class WebviewExampleScreen extends StatefulWidget {
|
||||||
final InAppBrowser browser = new MyInappBrowser();
|
final MyInappBrowser browser = new MyInappBrowser();
|
||||||
@override
|
@override
|
||||||
_WebviewExampleScreenState createState() => new _WebviewExampleScreenState();
|
_WebviewExampleScreenState createState() => new _WebviewExampleScreenState();
|
||||||
}
|
}
|
||||||
@ -81,7 +81,10 @@ class _WebviewExampleScreenState extends State<WebviewExampleScreen> {
|
|||||||
return new Center(
|
return new Center(
|
||||||
child: new RaisedButton(
|
child: new RaisedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
widget.browser.open(url:"https://flutter.io/");
|
widget.browser.open(url: "https://flutter.dev/", options: {
|
||||||
|
"useShouldOverrideUrlLoading": true,
|
||||||
|
"useOnLoadResource": true
|
||||||
|
});
|
||||||
},
|
},
|
||||||
child: Text("Open Webview Browser")),
|
child: Text("Open Webview Browser")),
|
||||||
);
|
);
|
||||||
|
@ -40,6 +40,9 @@ flutter:
|
|||||||
|
|
||||||
assets:
|
assets:
|
||||||
- assets/index.html
|
- assets/index.html
|
||||||
|
- assets/page-1.html
|
||||||
|
- assets/page-2.html
|
||||||
|
- assets/page-3.html
|
||||||
- assets/css/
|
- assets/css/
|
||||||
- assets/images/
|
- assets/images/
|
||||||
|
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/.dart_tool" />
|
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/.dart_tool" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/.pub" />
|
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/.pub" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/build" />
|
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/build" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/ios/Flutter/App.framework/flutter_assets/packages" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/ios/Flutter/flutter_assets/packages" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/example/ios/Flutter/App.framework/flutter_assets/packages" />
|
<excludeFolder url="file://$MODULE_DIR$/example/ios/Flutter/App.framework/flutter_assets/packages" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/example/ios/Flutter/flutter_assets/packages" />
|
<excludeFolder url="file://$MODULE_DIR$/example/ios/Flutter/flutter_assets/packages" />
|
||||||
</content>
|
</content>
|
||||||
|
@ -24,7 +24,7 @@ public class FlutterWebViewController: NSObject, FlutterPlatformView {
|
|||||||
self.channel = FlutterMethodChannel(name: channelName, binaryMessenger: registrar.messenger())
|
self.channel = FlutterMethodChannel(name: channelName, binaryMessenger: registrar.messenger())
|
||||||
self.channel?.setMethodCallHandler(self.handle)
|
self.channel?.setMethodCallHandler(self.handle)
|
||||||
|
|
||||||
var initialUrl = (args["initialUrl"] as? String)!
|
let initialUrl = (args["initialUrl"] as? String)!
|
||||||
let initialFile = args["initialFile"] as? String
|
let initialFile = args["initialFile"] as? String
|
||||||
let initialData = args["initialData"] as? [String: String]
|
let initialData = args["initialData"] as? [String: String]
|
||||||
let initialHeaders = (args["initialHeaders"] as? [String: String])!
|
let initialHeaders = (args["initialHeaders"] as? [String: String])!
|
||||||
@ -134,35 +134,29 @@ public class FlutterWebViewController: NSObject, FlutterPlatformView {
|
|||||||
webView!.injectScriptCode(source: source, result: result)
|
webView!.injectScriptCode(source: source, result: result)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
result(false)
|
result("")
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case "injectScriptFile":
|
case "injectScriptFile":
|
||||||
if webView != nil {
|
if webView != nil {
|
||||||
let urlFile = (arguments!["urlFile"] as? String)!
|
let urlFile = (arguments!["urlFile"] as? String)!
|
||||||
webView!.injectScriptFile(urlFile: urlFile, result: result)
|
webView!.injectScriptFile(urlFile: urlFile)
|
||||||
}
|
|
||||||
else {
|
|
||||||
result(false)
|
|
||||||
}
|
}
|
||||||
|
result(true)
|
||||||
break
|
break
|
||||||
case "injectStyleCode":
|
case "injectStyleCode":
|
||||||
if webView != nil {
|
if webView != nil {
|
||||||
let source = (arguments!["source"] as? String)!
|
let source = (arguments!["source"] as? String)!
|
||||||
webView!.injectStyleCode(source: source, result: result)
|
webView!.injectStyleCode(source: source)
|
||||||
}
|
|
||||||
else {
|
|
||||||
result(false)
|
|
||||||
}
|
}
|
||||||
|
result(true)
|
||||||
break
|
break
|
||||||
case "injectStyleFile":
|
case "injectStyleFile":
|
||||||
if webView != nil {
|
if webView != nil {
|
||||||
let urlFile = (arguments!["urlFile"] as? String)!
|
let urlFile = (arguments!["urlFile"] as? String)!
|
||||||
webView!.injectStyleFile(urlFile: urlFile, result: result)
|
webView!.injectStyleFile(urlFile: urlFile)
|
||||||
}
|
|
||||||
else {
|
|
||||||
result(false)
|
|
||||||
}
|
}
|
||||||
|
result(true)
|
||||||
break
|
break
|
||||||
case "reload":
|
case "reload":
|
||||||
if webView != nil {
|
if webView != nil {
|
||||||
|
@ -154,7 +154,7 @@ class InAppBrowserWebViewController: UIViewController, UIScrollViewDelegate, WKU
|
|||||||
loadUrl(url: self.initURL!, headers: self.initHeaders)
|
loadUrl(url: self.initURL!, headers: self.initHeaders)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
loadData(data: initData!, mimeType: initMimeType!, encoding: initEncoding!, baseUrl: initBaseUrl!)
|
webView.loadData(data: initData!, mimeType: initMimeType!, encoding: initEncoding!, baseUrl: initBaseUrl!)
|
||||||
}
|
}
|
||||||
|
|
||||||
navigationDelegate?.onBrowserCreated(uuid: uuid, webView: webView)
|
navigationDelegate?.onBrowserCreated(uuid: uuid, webView: webView)
|
||||||
@ -225,16 +225,6 @@ class InAppBrowserWebViewController: UIViewController, UIScrollViewDelegate, WKU
|
|||||||
updateUrlTextField(url: (webView.currentURL?.absoluteString)!)
|
updateUrlTextField(url: (webView.currentURL?.absoluteString)!)
|
||||||
}
|
}
|
||||||
|
|
||||||
func loadData(data: String, mimeType: String, encoding: String, baseUrl: String) {
|
|
||||||
webView.loadData(data: data, mimeType: mimeType, encoding: encoding, baseUrl: baseUrl)
|
|
||||||
}
|
|
||||||
|
|
||||||
func postUrl(url: URL, postData: Data, result: @escaping FlutterResult) {
|
|
||||||
webView.postUrl(url: url, postData: postData, completionHandler: { () -> Void in
|
|
||||||
result(true)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load user requested url
|
// Load user requested url
|
||||||
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
|
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
|
||||||
textField.resignFirstResponder()
|
textField.resignFirstResponder()
|
||||||
|
@ -279,8 +279,7 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, WKNavi
|
|||||||
if assetURL == nil {
|
if assetURL == nil {
|
||||||
throw NSError(domain: url + " asset file cannot be found!", code: 0)
|
throw NSError(domain: url + " asset file cannot be found!", code: 0)
|
||||||
}
|
}
|
||||||
let absoluteUrl = URL(string: url)!.absoluteURL
|
loadUrl(url: assetURL!, headers: headers)
|
||||||
loadUrl(url: absoluteUrl, headers: headers)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func setOptions(newOptions: InAppWebViewOptions, newOptionsMap: [String: Any]) {
|
func setOptions(newOptions: InAppWebViewOptions, newOptionsMap: [String: Any]) {
|
||||||
@ -440,19 +439,19 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, WKNavi
|
|||||||
injectDeferredObject(source: source, withWrapper: jsWrapper, result: result)
|
injectDeferredObject(source: source, withWrapper: jsWrapper, result: result)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func injectScriptFile(urlFile: String, result: FlutterResult?) {
|
public func injectScriptFile(urlFile: String) {
|
||||||
let jsWrapper = "(function(d) { var c = d.createElement('script'); c.src = %@; d.body.appendChild(c); })(document);"
|
let jsWrapper = "(function(d) { var c = d.createElement('script'); c.src = %@; d.body.appendChild(c); })(document);"
|
||||||
injectDeferredObject(source: urlFile, withWrapper: jsWrapper, result: result)
|
injectDeferredObject(source: urlFile, withWrapper: jsWrapper, result: nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func injectStyleCode(source: String, result: FlutterResult?) {
|
public func injectStyleCode(source: String) {
|
||||||
let jsWrapper = "(function(d) { var c = d.createElement('style'); c.innerHTML = %@; d.body.appendChild(c); })(document);"
|
let jsWrapper = "(function(d) { var c = d.createElement('style'); c.innerHTML = %@; d.body.appendChild(c); })(document);"
|
||||||
injectDeferredObject(source: source, withWrapper: jsWrapper, result: result)
|
injectDeferredObject(source: source, withWrapper: jsWrapper, result: nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func injectStyleFile(urlFile: String, result: FlutterResult?) {
|
public func injectStyleFile(urlFile: String) {
|
||||||
let jsWrapper = "(function(d) { var c = d.createElement('link'); c.rel='stylesheet', c.type='text/css'; c.href = %@; d.body.appendChild(c); })(document);"
|
let jsWrapper = "(function(d) { var c = d.createElement('link'); c.rel='stylesheet', c.type='text/css'; c.href = %@; d.body.appendChild(c); })(document);"
|
||||||
injectDeferredObject(source: urlFile, withWrapper: jsWrapper, result: result)
|
injectDeferredObject(source: urlFile, withWrapper: jsWrapper, result: nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func getCopyBackForwardList() -> [String: Any] {
|
public func getCopyBackForwardList() -> [String: Any] {
|
||||||
|
@ -198,15 +198,15 @@ public class SwiftFlutterPlugin: NSObject, FlutterPlugin {
|
|||||||
self.injectScriptCode(uuid: uuid, arguments: arguments!, result: result)
|
self.injectScriptCode(uuid: uuid, arguments: arguments!, result: result)
|
||||||
break
|
break
|
||||||
case "injectScriptFile":
|
case "injectScriptFile":
|
||||||
self.injectScriptFile(uuid: uuid, arguments: arguments!, result: nil)
|
self.injectScriptFile(uuid: uuid, arguments: arguments!)
|
||||||
result(true)
|
result(true)
|
||||||
break
|
break
|
||||||
case "injectStyleCode":
|
case "injectStyleCode":
|
||||||
self.injectStyleCode(uuid: uuid, arguments: arguments!, result: nil)
|
self.injectStyleCode(uuid: uuid, arguments: arguments!)
|
||||||
result(true)
|
result(true)
|
||||||
break
|
break
|
||||||
case "injectStyleFile":
|
case "injectStyleFile":
|
||||||
self.injectStyleFile(uuid: uuid, arguments: arguments!, result: nil)
|
self.injectStyleFile(uuid: uuid, arguments: arguments!)
|
||||||
result(true)
|
result(true)
|
||||||
break
|
break
|
||||||
case "takeScreenshot":
|
case "takeScreenshot":
|
||||||
@ -496,7 +496,7 @@ public class SwiftFlutterPlugin: NSObject, FlutterPlugin {
|
|||||||
if browserOptions.hidden {
|
if browserOptions.hidden {
|
||||||
webViewController.view.isHidden = true
|
webViewController.view.isHidden = true
|
||||||
tmpController.present(webViewController, animated: false, completion: {() -> Void in
|
tmpController.present(webViewController, animated: false, completion: {() -> Void in
|
||||||
webViewController.loadData(data: data, mimeType: mimeType, encoding: encoding, baseUrl: baseUrl)
|
webViewController.webView.loadData(data: data, mimeType: mimeType, encoding: encoding, baseUrl: baseUrl)
|
||||||
})
|
})
|
||||||
webViewController.presentingViewController?.dismiss(animated: false, completion: {() -> Void in
|
webViewController.presentingViewController?.dismiss(animated: false, completion: {() -> Void in
|
||||||
self.tmpWindow?.windowLevel = 0.0
|
self.tmpWindow?.windowLevel = 0.0
|
||||||
@ -505,66 +505,23 @@ public class SwiftFlutterPlugin: NSObject, FlutterPlugin {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
tmpController.present(webViewController, animated: true, completion: {() -> Void in
|
tmpController.present(webViewController, animated: true, completion: {() -> Void in
|
||||||
webViewController.loadData(data: data, mimeType: mimeType, encoding: encoding, baseUrl: baseUrl)
|
webViewController.webView.loadData(data: data, mimeType: mimeType, encoding: encoding, baseUrl: baseUrl)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func loadUrl(uuid: String, arguments: NSDictionary, result: @escaping FlutterResult) {
|
func open(inSystem url: URL, result: @escaping FlutterResult) {
|
||||||
let webViewController: InAppBrowserWebViewController = self.webViewControllers[uuid] as! InAppBrowserWebViewController
|
if !UIApplication.shared.canOpenURL(url) {
|
||||||
if let url = arguments["url"] as? String {
|
result(FlutterError(code: "InAppBrowserFlutterPlugin", message: url.absoluteString + " cannot be opened!", details: nil))
|
||||||
let headers = (arguments["headers"] as? [String: String])!
|
return
|
||||||
let absoluteUrl = URL(string: url)!.absoluteURL
|
|
||||||
webViewController.loadUrl(url: absoluteUrl, headers: headers)
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
result(FlutterError(code: "InAppBrowserFlutterPlugin", message: "url is empty", details: nil))
|
if #available(iOS 10.0, *) {
|
||||||
return
|
UIApplication.shared.open(url, options: [:], completionHandler: nil)
|
||||||
|
} else {
|
||||||
|
UIApplication.shared.openURL(url)
|
||||||
}
|
}
|
||||||
result(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
public func loadData(uuid: String, arguments: NSDictionary, result: @escaping FlutterResult) {
|
|
||||||
let webViewController: InAppBrowserWebViewController = self.webViewControllers[uuid] as! InAppBrowserWebViewController
|
|
||||||
let data = (arguments["data"] as? String)!
|
|
||||||
let mimeType = (arguments["mimeType"] as? String)!
|
|
||||||
let encoding = (arguments["encoding"] as? String)!
|
|
||||||
let baseUrl = (arguments["baseUrl"] as? String)!
|
|
||||||
webViewController.loadData(data: data, mimeType: mimeType, encoding: encoding, baseUrl: baseUrl)
|
|
||||||
result(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
public func postUrl(uuid: String, arguments: NSDictionary, result: @escaping FlutterResult) {
|
|
||||||
let webViewController: InAppBrowserWebViewController = self.webViewControllers[uuid] as! InAppBrowserWebViewController
|
|
||||||
if let url = arguments["url"] as? String {
|
|
||||||
let postData = (arguments["postData"] as? FlutterStandardTypedData)!
|
|
||||||
let absoluteUrl = URL(string: url)!.absoluteURL
|
|
||||||
webViewController.postUrl(url: absoluteUrl, postData: postData.data, result: result)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
result(FlutterError(code: "InAppBrowserFlutterPlugin", message: "url is empty", details: nil))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public func loadFile(uuid: String, arguments: NSDictionary, result: @escaping FlutterResult) {
|
|
||||||
let webViewController: InAppBrowserWebViewController = self.webViewControllers[uuid] as! InAppBrowserWebViewController
|
|
||||||
if let url = arguments["url"] as? String {
|
|
||||||
let headers = (arguments["headers"] as? [String: String])!
|
|
||||||
|
|
||||||
let key = SwiftFlutterPlugin.registrar!.lookupKey(forAsset: url)
|
|
||||||
let assetURL = Bundle.main.url(forResource: key, withExtension: nil)
|
|
||||||
if assetURL == nil {
|
|
||||||
result(FlutterError(code: "InAppBrowserFlutterPlugin", message: url + " asset file cannot be found!", details: nil))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
let absoluteUrl = URL(string: url)!.absoluteURL
|
|
||||||
webViewController.loadUrl(url: absoluteUrl, headers: headers)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
result(FlutterError(code: "InAppBrowserFlutterPlugin", message: "url is empty", details: nil))
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
result(true)
|
result(true)
|
||||||
}
|
}
|
||||||
@ -616,88 +573,106 @@ public class SwiftFlutterPlugin: NSObject, FlutterPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func open(inSystem url: URL, result: @escaping FlutterResult) {
|
public func loadUrl(uuid: String, arguments: NSDictionary, result: @escaping FlutterResult) {
|
||||||
if !UIApplication.shared.canOpenURL(url) {
|
if let webViewController = self.webViewControllers[uuid] {
|
||||||
result(FlutterError(code: "InAppBrowserFlutterPlugin", message: url.absoluteString + " cannot be opened!", details: nil))
|
if let url = arguments["url"] as? String {
|
||||||
return
|
let headers = (arguments["headers"] as? [String: String])!
|
||||||
|
let absoluteUrl = URL(string: url)!.absoluteURL
|
||||||
|
webViewController!.loadUrl(url: absoluteUrl, headers: headers)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if #available(iOS 10.0, *) {
|
result(FlutterError(code: "InAppBrowserFlutterPlugin", message: "url is empty", details: nil))
|
||||||
UIApplication.shared.open(url, options: [:], completionHandler: nil)
|
return
|
||||||
} else {
|
|
||||||
UIApplication.shared.openURL(url)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
result(true)
|
result(true)
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
result(FlutterError(code: "InAppBrowserFlutterPlugin", message: "webView is null", details: nil))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// This is a helper method for the inject{Script|Style}{Code|File} API calls, which
|
public func loadData(uuid: String, arguments: NSDictionary, result: @escaping FlutterResult) {
|
||||||
// provides a consistent method for injecting JavaScript code into the document.
|
|
||||||
//
|
|
||||||
// If a wrapper string is supplied, then the source string will be JSON-encoded (adding
|
|
||||||
// quotes) and wrapped using string formatting. (The wrapper string should have a single
|
|
||||||
// '%@' marker).
|
|
||||||
//
|
|
||||||
// If no wrapper is supplied, then the source string is executed directly.
|
|
||||||
func injectDeferredObject(uuid: String, source: String, withWrapper jsWrapper: String, result: FlutterResult?) {
|
|
||||||
if let webViewController = self.webViewControllers[uuid] {
|
if let webViewController = self.webViewControllers[uuid] {
|
||||||
let jsonData: Data? = try? JSONSerialization.data(withJSONObject: [source], options: [])
|
let data = (arguments["data"] as? String)!
|
||||||
let sourceArrayString = String(data: jsonData!, encoding: String.Encoding.utf8)
|
let mimeType = (arguments["mimeType"] as? String)!
|
||||||
if sourceArrayString != nil {
|
let encoding = (arguments["encoding"] as? String)!
|
||||||
let sourceString: String? = (sourceArrayString! as NSString).substring(with: NSRange(location: 1, length: (sourceArrayString?.count ?? 0) - 2))
|
let baseUrl = (arguments["baseUrl"] as? String)!
|
||||||
let jsToInject = String(format: jsWrapper, sourceString!)
|
webViewController!.webView.loadData(data: data, mimeType: mimeType, encoding: encoding, baseUrl: baseUrl)
|
||||||
|
result(true)
|
||||||
webViewController?.webView?.evaluateJavaScript(jsToInject, completionHandler: {(value, error) in
|
|
||||||
if result == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if error != nil {
|
|
||||||
let userInfo = (error! as NSError).userInfo
|
|
||||||
self.onConsoleMessage(uuid: uuid, sourceURL: (userInfo["WKJavaScriptExceptionSourceURL"] as? URL)?.absoluteString ?? "", lineNumber: userInfo["WKJavaScriptExceptionLineNumber"] as! Int, message: userInfo["WKJavaScriptExceptionMessage"] as! String, messageLevel: "ERROR")
|
|
||||||
}
|
|
||||||
|
|
||||||
if value == nil {
|
|
||||||
result!("")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
do {
|
|
||||||
let data: Data = ("[" + String(describing: value!) + "]").data(using: String.Encoding.utf8, allowLossyConversion: false)!
|
|
||||||
let json: Array<Any> = try JSONSerialization.jsonObject(with: data, options: []) as! Array<Any>
|
|
||||||
if json[0] is String {
|
|
||||||
result!(json[0])
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
result!(value)
|
result(FlutterError(code: "InAppBrowserFlutterPlugin", message: "webView is null", details: nil))
|
||||||
}
|
}
|
||||||
} catch let error as NSError {
|
|
||||||
result!(FlutterError(code: "InAppBrowserFlutterPlugin", message: "Failed to load: \(error.localizedDescription)", details: error))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public func postUrl(uuid: String, arguments: NSDictionary, result: @escaping FlutterResult) {
|
||||||
|
if let webViewController = self.webViewControllers[uuid] {
|
||||||
|
if let url = arguments["url"] as? String {
|
||||||
|
let postData = (arguments["postData"] as? FlutterStandardTypedData)!
|
||||||
|
let absoluteUrl = URL(string: url)!.absoluteURL
|
||||||
|
webViewController!.webView.postUrl(url: absoluteUrl, postData: postData.data, completionHandler: { () -> Void in
|
||||||
|
result(true)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
result(FlutterError(code: "InAppBrowserFlutterPlugin", message: "url is empty", details: nil))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
result(FlutterError(code: "InAppBrowserFlutterPlugin", message: "webView is null", details: nil))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func injectScriptCode(uuid: String, arguments: NSDictionary, result: FlutterResult?) {
|
public func loadFile(uuid: String, arguments: NSDictionary, result: @escaping FlutterResult) {
|
||||||
let jsWrapper = "(function(){return JSON.stringify(eval(%@));})();"
|
if let webViewController = self.webViewControllers[uuid] {
|
||||||
injectDeferredObject(uuid: uuid, source: arguments["source"] as! String, withWrapper: jsWrapper, result: result)
|
if let url = arguments["url"] as? String {
|
||||||
|
let headers = (arguments["headers"] as? [String: String])!
|
||||||
|
do {
|
||||||
|
try webViewController!.webView.loadFile(url: url, headers: headers)
|
||||||
|
}
|
||||||
|
catch let error as NSError {
|
||||||
|
dump(error)
|
||||||
|
result(FlutterError(code: "InAppBrowserFlutterPlugin", message: error.localizedDescription, details: nil))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
result(FlutterError(code: "InAppBrowserFlutterPlugin", message: "url is empty", details: nil))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
result(true)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
result(FlutterError(code: "InAppBrowserFlutterPlugin", message: "webView is null", details: nil))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func injectScriptFile(uuid: String, arguments: NSDictionary, result: FlutterResult?) {
|
public func injectScriptCode(uuid: String, arguments: NSDictionary, result: @escaping FlutterResult) {
|
||||||
let jsWrapper = "(function(d) { var c = d.createElement('script'); c.src = %@; d.body.appendChild(c); })(document);"
|
if let webViewController = self.webViewControllers[uuid] {
|
||||||
injectDeferredObject(uuid: uuid, source: arguments["urlFile"] as! String, withWrapper: jsWrapper, result: result)
|
webViewController!.webView.injectScriptCode(source: arguments["source"] as! String, result: result)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
result(FlutterError(code: "InAppBrowserFlutterPlugin", message: "webView is null", details: nil))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func injectStyleCode(uuid: String, arguments: NSDictionary, result: FlutterResult?) {
|
public func injectScriptFile(uuid: String, arguments: NSDictionary) {
|
||||||
let jsWrapper = "(function(d) { var c = d.createElement('style'); c.innerHTML = %@; d.body.appendChild(c); })(document);"
|
if let webViewController = self.webViewControllers[uuid] {
|
||||||
injectDeferredObject(uuid: uuid, source: arguments["source"] as! String, withWrapper: jsWrapper, result: result)
|
webViewController!.webView.injectScriptFile(urlFile: arguments["urlFile"] as! String)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func injectStyleFile(uuid: String, arguments: NSDictionary, result: FlutterResult?) {
|
public func injectStyleCode(uuid: String, arguments: NSDictionary) {
|
||||||
let jsWrapper = "(function(d) { var c = d.createElement('link'); c.rel='stylesheet', c.type='text/css'; c.href = %@; d.body.appendChild(c); })(document);"
|
if let webViewController = self.webViewControllers[uuid] {
|
||||||
injectDeferredObject(uuid: uuid, source: arguments["urlFile"] as! String, withWrapper: jsWrapper, result: result)
|
webViewController!.webView.injectStyleCode(source: arguments["source"] as! String)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public func injectStyleFile(uuid: String, arguments: NSDictionary) {
|
||||||
|
if let webViewController = self.webViewControllers[uuid] {
|
||||||
|
webViewController!.webView.injectStyleFile(urlFile: arguments["urlFile"] as! String)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func onBrowserCreated(uuid: String, webView: WKWebView) {
|
func onBrowserCreated(uuid: String, webView: WKWebView) {
|
||||||
@ -706,84 +681,10 @@ public class SwiftFlutterPlugin: NSObject, FlutterPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func onLoadStart(uuid: String, webView: WKWebView) {
|
|
||||||
if let webViewController = self.webViewControllers[uuid] {
|
|
||||||
let url: String = webViewController!.webView.currentURL!.absoluteString
|
|
||||||
SwiftFlutterPlugin.channel!.invokeMethod("onLoadStart", arguments: ["uuid": uuid, "url": url])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func onLoadStop(uuid: String, webView: WKWebView) {
|
|
||||||
if let webViewController = self.webViewControllers[uuid] {
|
|
||||||
let url: String = webViewController!.webView.currentURL!.absoluteString
|
|
||||||
SwiftFlutterPlugin.channel!.invokeMethod("onLoadStop", arguments: ["uuid": uuid, "url": url])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func onLoadError(uuid: String, webView: WKWebView, error: Error) {
|
|
||||||
if let webViewController = self.webViewControllers[uuid] {
|
|
||||||
let url: String = webViewController!.webView.currentURL!.absoluteString
|
|
||||||
let arguments = ["uuid": uuid, "url": url, "code": error._code, "message": error.localizedDescription] as [String : Any]
|
|
||||||
SwiftFlutterPlugin.channel!.invokeMethod("onLoadError", arguments: arguments)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func onProgressChanged(uuid: String, webView: WKWebView, progress: Int) {
|
|
||||||
if let webViewController = self.webViewControllers[uuid] {
|
|
||||||
SwiftFlutterPlugin.channel!.invokeMethod("onProgressChanged", arguments: ["uuid": uuid, "progress": progress])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func onLoadResource(uuid: String, webView: WKWebView, response: URLResponse, fromRequest request: URLRequest?, withData data: Data, startTime: Int64, duration: Int64) {
|
|
||||||
if self.webViewControllers[uuid] != nil {
|
|
||||||
var headersResponse = (response as! HTTPURLResponse).allHeaderFields as! [String: String]
|
|
||||||
headersResponse.lowercaseKeys()
|
|
||||||
|
|
||||||
var headersRequest = request!.allHTTPHeaderFields! as [String: String]
|
|
||||||
headersRequest.lowercaseKeys()
|
|
||||||
|
|
||||||
let arguments: [String : Any] = [
|
|
||||||
"uuid": uuid,
|
|
||||||
"response": [
|
|
||||||
"url": response.url!.absoluteString,
|
|
||||||
"statusCode": (response as! HTTPURLResponse).statusCode,
|
|
||||||
"headers": headersResponse,
|
|
||||||
"startTime": startTime,
|
|
||||||
"duration": duration,
|
|
||||||
"data": data
|
|
||||||
],
|
|
||||||
"request": [
|
|
||||||
"url": request!.url!.absoluteString,
|
|
||||||
"headers": headersRequest,
|
|
||||||
"method": request!.httpMethod!
|
|
||||||
]
|
|
||||||
]
|
|
||||||
SwiftFlutterPlugin.channel!.invokeMethod("onLoadResource", arguments: arguments)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func onScrollChanged(uuid: String, webView: WKWebView, x: Int, y: Int) {
|
|
||||||
if let webViewController = self.webViewControllers[uuid] {
|
|
||||||
SwiftFlutterPlugin.channel!.invokeMethod("onScrollChanged", arguments: ["uuid": uuid, "x": x, "y": y])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func onExit(uuid: String) {
|
func onExit(uuid: String) {
|
||||||
SwiftFlutterPlugin.channel!.invokeMethod("onExit", arguments: ["uuid": uuid])
|
SwiftFlutterPlugin.channel!.invokeMethod("onExit", arguments: ["uuid": uuid])
|
||||||
}
|
}
|
||||||
|
|
||||||
func shouldOverrideUrlLoading(uuid: String, webView: WKWebView, url: URL) {
|
|
||||||
if self.webViewControllers[uuid] != nil {
|
|
||||||
SwiftFlutterPlugin.channel!.invokeMethod("shouldOverrideUrlLoading", arguments: ["uuid": uuid, "url": url.absoluteString])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func onConsoleMessage(uuid: String, sourceURL: String, lineNumber: Int, message: String, messageLevel: String) {
|
|
||||||
if self.webViewControllers[uuid] != nil {
|
|
||||||
SwiftFlutterPlugin.channel!.invokeMethod("onConsoleMessage", arguments: ["uuid": uuid, "sourceURL": sourceURL, "lineNumber": lineNumber, "message": message, "messageLevel": messageLevel])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func onChromeSafariBrowserOpened(uuid: String) {
|
func onChromeSafariBrowserOpened(uuid: String) {
|
||||||
if self.safariViewControllers[uuid] != nil {
|
if self.safariViewControllers[uuid] != nil {
|
||||||
SwiftFlutterPlugin.channel!.invokeMethod("onChromeSafariBrowserOpened", arguments: ["uuid": uuid])
|
SwiftFlutterPlugin.channel!.invokeMethod("onChromeSafariBrowserOpened", arguments: ["uuid": uuid])
|
||||||
@ -800,10 +701,6 @@ public class SwiftFlutterPlugin: NSObject, FlutterPlugin {
|
|||||||
SwiftFlutterPlugin.channel!.invokeMethod("onChromeSafariBrowserClosed", arguments: ["uuid": uuid])
|
SwiftFlutterPlugin.channel!.invokeMethod("onChromeSafariBrowserClosed", arguments: ["uuid": uuid])
|
||||||
}
|
}
|
||||||
|
|
||||||
func onCallJsHandler(uuid: String, webView: WKWebView, handlerName: String, args: String) {
|
|
||||||
SwiftFlutterPlugin.channel!.invokeMethod("onCallJsHandler", arguments: ["uuid": uuid, "handlerName": handlerName, "args": args])
|
|
||||||
}
|
|
||||||
|
|
||||||
func safariExit(uuid: String) {
|
func safariExit(uuid: String) {
|
||||||
if let safariViewController = self.safariViewControllers[uuid] {
|
if let safariViewController = self.safariViewControllers[uuid] {
|
||||||
if #available(iOS 9.0, *) {
|
if #available(iOS 9.0, *) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: flutter_inappbrowser
|
name: flutter_inappbrowser
|
||||||
description: A Flutter plugin that allows you to add an inline webview or open an in-app browser window (inspired by the popular cordova-plugin-inappbrowser).
|
description: A Flutter plugin that allows you to add an inline webview or open an in-app browser window (inspired by the popular cordova-plugin-inappbrowser).
|
||||||
version: 1.0.0
|
version: 1.0.1
|
||||||
author: Lorenzo Pichilli <pichillilorenzo@gmail.com>
|
author: Lorenzo Pichilli <pichillilorenzo@gmail.com>
|
||||||
homepage: https://github.com/pichillilorenzo/flutter_inappbrowser
|
homepage: https://github.com/pichillilorenzo/flutter_inappbrowser
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user