updated README.md

This commit is contained in:
pichillilorenzo 2018-10-22 02:11:26 +02:00
parent 7368ca07b5
commit 2c7e3c8cda
5 changed files with 96 additions and 78 deletions

123
.idea/workspace.xml generated
View File

@ -15,7 +15,10 @@
</component>
<component name="ChangeListManager">
<list default="true" id="9b41f7a2-a71e-4923-91fb-249d7815b3e7" name="Default" comment="">
<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$/lib/flutter_inappbrowser.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/flutter_inappbrowser.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pubspec.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/pubspec.yaml" afterDir="false" />
</list>
<ignored path="$PROJECT_DIR$/.dart_tool/" />
<ignored path="$PROJECT_DIR$/.idea/" />
@ -30,13 +33,37 @@
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="DockManager">
<window id="2">
<content type="file-editors">
<state>
<leaf>
<file leaf-file-name="README.md" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="51">
<caret line="44" column="61" lean-forward="true" selection-start-line="44" selection-start-column="61" selection-end-line="44" selection-end-column="61" />
</first_editor>
<second_editor>
<markdownNavigatorState />
</second_editor>
</state>
</provider>
</entry>
</file>
</leaf>
</state>
</content>
</window>
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="flutter_inappbrowser.dart" pinned="false" current-in-tab="false">
<file leaf-file-name="flutter_inappbrowser.dart" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/lib/flutter_inappbrowser.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="181">
<caret line="506" column="20" selection-start-line="506" selection-start-column="7" selection-end-line="506" selection-end-column="20" />
<state relative-caret-position="196">
<caret line="648" column="42" lean-forward="true" selection-start-line="648" selection-start-column="42" selection-end-line="648" selection-end-column="42" />
<folding>
<element signature="e#814#831#0" expanded="true" />
</folding>
@ -56,26 +83,12 @@
</provider>
</entry>
</file>
<file leaf-file-name="README.md" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="147">
<caret line="1058" column="39" lean-forward="true" selection-start-line="1058" selection-start-column="39" selection-end-line="1058" selection-end-column="39" />
</first_editor>
<second_editor>
<markdownNavigatorState />
</second_editor>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="CHANGELOG.md" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="390">
<caret line="26" column="34" selection-start-line="26" selection-start-column="34" selection-end-line="26" selection-end-column="34" />
<first_editor relative-caret-position="30">
<caret line="2" column="19" lean-forward="true" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" />
</first_editor>
<second_editor>
<markdownNavigatorState />
@ -87,8 +100,8 @@
<file leaf-file-name="pubspec.yaml" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/pubspec.yaml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="15">
<caret line="1" column="103" lean-forward="true" selection-start-line="1" selection-start-column="13" selection-end-line="1" selection-end-column="103" />
<state relative-caret-position="30">
<caret line="2" column="14" selection-start-line="2" selection-start-column="14" selection-end-line="2" selection-end-column="14" />
</state>
</provider>
</entry>
@ -104,9 +117,6 @@
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>isHidde</find>
<find>onWebViewCreated</find>
<find>WebViewCreatedCallback</find>
<find>MethodChannel</find>
<find>WebViewController</find>
<find>HashMap</find>
@ -134,6 +144,9 @@
<find>local</find>
<find>openWithSystemBrowser</find>
<find>__userAgent__</find>
<find>a</find>
<find>InApp</find>
<find>A [InApp</find>
</findStrings>
<replaceStrings>
<replace>activity.getPreferences(0)</replace>
@ -175,8 +188,8 @@
<option value="$PROJECT_DIR$/example/assets/index.html" />
<option value="$PROJECT_DIR$/example/ios/Flutter/Generated.xcconfig" />
<option value="$PROJECT_DIR$/example/pubspec.yaml" />
<option value="$PROJECT_DIR$/CHANGELOG.md" />
<option value="$PROJECT_DIR$/example/lib/main.dart" />
<option value="$PROJECT_DIR$/CHANGELOG.md" />
<option value="$PROJECT_DIR$/pubspec.yaml" />
<option value="$PROJECT_DIR$/lib/flutter_inappbrowser.dart" />
<option value="$PROJECT_DIR$/README.md" />
@ -395,13 +408,13 @@
<window_info anchor="bottom" id="Dart Analysis" order="14" weight="0.3276414" />
<window_info anchor="bottom" id="Run" order="2" sideWeight="0.49644473" weight="0.3564568" />
<window_info anchor="bottom" id="Version Control" order="9" />
<window_info active="true" anchor="bottom" id="Terminal" order="10" sideWeight="0.49644473" visible="true" weight="0.35005337" />
<window_info anchor="bottom" id="Terminal" order="10" sideWeight="0.49644473" visible="true" weight="0.35005337" />
<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 content_ui="combo" id="Project" order="0" sideWeight="0.49724367" visible="true" weight="0.14670487" />
<window_info active="true" content_ui="combo" id="Project" order="0" sideWeight="0.49724367" visible="true" weight="0.14670487" />
<window_info id="Structure" order="1" sideWeight="0.50275636" side_tool="true" weight="0.1910871" />
<window_info anchor="right" id="Device File Explorer" order="5" side_tool="true" />
<window_info anchor="right" id="Theme Preview" order="7" />
@ -506,11 +519,6 @@
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/flutter_plugin/lib/flutter_plugin.dart" />
<entry file="file://$PROJECT_DIR$/pubspec.lock">
<provider selected="true" editor-type-id="text-editor">
<state />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserFlutterPlugin.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1560">
@ -670,23 +678,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="390">
<caret line="26" column="34" selection-start-line="26" selection-start-column="34" selection-end-line="26" selection-end-column="34" />
</first_editor>
<second_editor>
<markdownNavigatorState />
</second_editor>
</state>
</provider>
<provider editor-type-id="text-editor">
<state relative-caret-position="30">
<caret line="2" column="69" lean-forward="true" selection-start-line="2" selection-start-column="2" selection-end-line="2" selection-end-column="73" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/lib/main.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="721">
@ -699,15 +690,37 @@
</entry>
<entry file="file://$PROJECT_DIR$/pubspec.yaml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="15">
<caret line="1" column="103" lean-forward="true" selection-start-line="1" selection-start-column="13" selection-end-line="1" selection-end-column="103" />
<state relative-caret-position="30">
<caret line="2" column="14" selection-start-line="2" selection-start-column="14" selection-end-line="2" selection-end-column="14" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pubspec.lock">
<provider selected="true" editor-type-id="text-editor">
<state />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="30">
<caret line="2" column="19" lean-forward="true" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" />
</first_editor>
<second_editor>
<markdownNavigatorState />
</second_editor>
</state>
</provider>
<provider editor-type-id="text-editor">
<state relative-caret-position="30">
<caret line="2" column="69" lean-forward="true" selection-start-line="2" selection-start-column="2" selection-end-line="2" selection-end-column="73" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/flutter_inappbrowser.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="181">
<caret line="506" column="20" selection-start-line="506" selection-start-column="7" selection-end-line="506" selection-end-column="20" />
<state relative-caret-position="196">
<caret line="648" column="42" lean-forward="true" selection-start-line="648" selection-start-column="42" selection-end-line="648" selection-end-column="42" />
<folding>
<element signature="e#814#831#0" expanded="true" />
</folding>
@ -717,8 +730,8 @@
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="147">
<caret line="1058" column="39" lean-forward="true" selection-start-line="1058" selection-start-column="39" selection-end-line="1058" selection-end-column="39" />
<first_editor relative-caret-position="51">
<caret line="44" column="61" lean-forward="true" selection-start-line="44" selection-start-column="61" selection-end-line="44" selection-end-column="61" />
</first_editor>
<second_editor>
<markdownNavigatorState />

View File

@ -1,3 +1,7 @@
## 0.5.1
- updated README.md
## 0.5.0
- added initial support for Inline WebViews using the `InAppWebView` widget

View File

@ -42,7 +42,8 @@ So, if you want use it, you can but you will have some limitation such as the in
**Available only for Android** ([AndroidView](https://docs.flutter.io/flutter/widgets/AndroidView-class.html)) at this moment.
Example
Use `InAppWebViewController` to control the WebView instance.
Example:
```dart
import 'dart:async';
import 'package:flutter/material.dart';
@ -295,7 +296,7 @@ InAppWebView(
```
#### Future\<void\> InAppWebView.loadUrl
#### Future\<void\> InAppWebViewController.loadUrl
Loads the given `url` with optional `headers` specified as a map from name to value.
@ -303,7 +304,7 @@ Loads the given `url` with optional `headers` specified as a map from name to va
inAppWebViewController.loadUrl(String url, {Map<String, String> headers = const {}});
```
#### Future\<void\> InAppWebView.loadFile
#### Future\<void\> InAppWebViewController.loadFile
Loads the given `assetFilePath` with optional `headers` specified as a map from name to value.
@ -339,7 +340,7 @@ inAppWebViewController.loadFile("assets/index.html");
inAppWebViewController.loadFile(String assetFilePath, {Map<String, String> headers = const {}});
```
#### Future\<void\> InAppWebView.reload
#### Future\<void\> InAppWebViewController.reload
Reloads the `InAppWebView` window.
@ -347,7 +348,7 @@ Reloads the `InAppWebView` window.
inAppWebViewController.reload();
```
#### Future\<void\> InAppWebView.goBack
#### Future\<void\> InAppWebViewController.goBack
Goes back in the history of the `InAppWebView` window.
@ -355,7 +356,7 @@ Goes back in the history of the `InAppWebView` window.
inAppWebViewController.goBack();
```
#### Future\<bool\> InAppWebView.canGoBack
#### Future\<bool\> InAppWebViewController.canGoBack
Returns a Boolean value indicating whether the `InAppWebView` can move backward.
@ -363,7 +364,7 @@ Returns a Boolean value indicating whether the `InAppWebView` can move backward.
inAppWebViewController.canGoBack();
```
#### Future\<void\> InAppWebView.goForward
#### Future\<void\> InAppWebViewController.goForward
Goes forward in the history of the `InAppWebView` window.
@ -371,7 +372,7 @@ Goes forward in the history of the `InAppWebView` window.
inAppWebViewController.goForward();
```
#### Future\<bool\> InAppWebView.canGoForward
#### Future\<bool\> InAppWebViewController.canGoForward
Returns a Boolean value indicating whether the `InAppWebView` can move forward.
@ -379,7 +380,7 @@ Returns a Boolean value indicating whether the `InAppWebView` can move forward.
inAppWebViewController.canGoForward();
```
#### Future\<bool\> InAppWebView.isLoading
#### Future\<bool\> InAppWebViewController.isLoading
Check if the Web View of the `InAppWebView` instance is in a loading state.
@ -387,7 +388,7 @@ Check if the Web View of the `InAppWebView` instance is in a loading state.
inAppWebViewController.isLoading();
```
#### Future\<void\> InAppWebView.stopLoading
#### Future\<void\> InAppWebViewController.stopLoading
Stops the Web View of the `InAppWebView` instance from loading.
@ -395,7 +396,7 @@ Stops the Web View of the `InAppWebView` instance from loading.
inAppWebViewController.stopLoading();
```
#### Future\<String\> InAppWebView.injectScriptCode
#### Future\<String\> InAppWebViewController.injectScriptCode
Injects JavaScript code into the `InAppWebView` window and returns the result of the evaluation.
@ -403,7 +404,7 @@ Injects JavaScript code into the `InAppWebView` window and returns the result of
inAppWebViewController.injectScriptCode(String source);
```
#### Future\<void\> InAppWebView.injectScriptFile
#### Future\<void\> InAppWebViewController.injectScriptFile
Injects a JavaScript file into the `InAppWebView` window.
@ -411,7 +412,7 @@ Injects a JavaScript file into the `InAppWebView` window.
inAppWebViewController.injectScriptFile(String urlFile);
```
#### Future\<void\> InAppWebView.injectStyleCode
#### Future\<void\> InAppWebViewController.injectStyleCode
Injects CSS into the `InAppWebView` window.
@ -419,7 +420,7 @@ Injects CSS into the `InAppWebView` window.
inAppWebViewController.injectStyleCode(String source);
```
#### Future\<void\> InAppWebView.injectStyleFile
#### Future\<void\> InAppWebViewController.injectStyleFile
Injects a CSS file into the `InAppWebView` window.
@ -427,7 +428,7 @@ Injects a CSS file into the `InAppWebView` window.
inAppWebViewController.injectStyleFile(String urlFile);
```
#### int InAppWebView.addJavaScriptHandler
#### int InAppWebViewController.addJavaScriptHandler
Adds/Appends a JavaScript message handler `callback` (`JavaScriptHandlerCallback`) that listen to post messages sent from JavaScript by the handler with name `handlerName`.
Returns the position `index` of the handler that can be used to remove it with the `removeJavaScriptHandler()` method.
@ -442,7 +443,7 @@ The `args` will be stringified automatically using `JSON.stringify(args)` method
inAppWebViewController.addJavaScriptHandler(String handlerName, JavaScriptHandlerCallback callback);
```
#### bool InAppWebView.removeJavaScriptHandler
#### bool InAppWebViewController.removeJavaScriptHandler
Removes a JavaScript message handler previously added with the `addJavaScriptHandler()` method in the `handlerName` list by its position `index`.
Returns `true` if the callback is removed, otherwise `false`.
@ -450,7 +451,7 @@ Returns `true` if the callback is removed, otherwise `false`.
inAppWebViewController.removeJavaScriptHandler(String handlerName, int index);
```
#### Future\<Uint8List\> InAppWebView.takeScreenshot
#### Future\<Uint8List\> InAppWebViewController.takeScreenshot
Takes a screenshot (in PNG format) of the WebView's visible viewport and returns a `Uint8List`. Returns `null` if it wasn't be able to take it.
@ -459,14 +460,14 @@ Takes a screenshot (in PNG format) of the WebView's visible viewport and returns
inAppWebViewController.takeScreenshot();
```
#### Future\<void\> InAppWebView.setOptions
#### Future\<void\> InAppWebViewController.setOptions
Sets the `InAppWebView` options with the new `options` and evaluates them.
```dart
inAppWebViewController.setOptions(Map<String, dynamic> options);
```
#### Future\<Map\<String, dynamic\>\> InAppWebView.getOptions
#### Future\<Map\<String, dynamic\>\> InAppWebViewController.getOptions
Gets the current `InAppWebView` options. Returns `null` if the options are not setted yet.
```dart

View File

@ -504,7 +504,7 @@ typedef void onWebViewLoadResourceCallback(InAppWebViewController controller, We
/// - __useShouldOverrideUrlLoading__: Set to `true` to be able to listen at the [InAppWebView.shouldOverrideUrlLoading()] event. The default value is `false`.
/// - __useOnLoadResource__: Set to `true` to be able to listen at the [InAppWebView.onLoadResource()] event. The default value is `false`.
/// - __clearCache__: Set to `true` to have all the browser's cache cleared before the new window is opened. The default value is `false`.
/// - __userAgent__: Set the custom WebView's user-agent.
/// - __userAgent___: Set the custom WebView's user-agent.
/// - __javaScriptEnabled__: Set to `true` to enable JavaScript. The default value is `true`.
/// - __javaScriptCanOpenWindowsAutomatically__: Set to `true` to allow JavaScript open windows without user interaction. The default value is `false`.
/// - __mediaPlaybackRequiresUserGesture__: Set to `true` to prevent HTML5 audio or video from autoplaying. The default value is `true`.
@ -643,9 +643,9 @@ class _InAppWebViewState extends State<InAppWebView> {
}
}
/// Controls an [InAppWebView].
/// Controls an [InAppWebView] widget instance.
///
/// A [InAppWebViewController] instance can be obtained by setting the [InAppWebView.onWebViewCreated]
/// An [InAppWebViewController] instance can be obtained by setting the [InAppWebView.onWebViewCreated]
/// callback for an [InAppWebView] widget.
class InAppWebViewController {

View File

@ -1,6 +1,6 @@
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).
version: 0.5.0
version: 0.5.1
author: Lorenzo Pichilli <pichillilorenzo@gmail.com>
homepage: https://github.com/pichillilorenzo/flutter_inappbrowser