Commit 2c7e3c8c authored by pichillilorenzo's avatar pichillilorenzo

updated README.md

parent 7368ca07
This diff is collapsed.
## 0.5.1
- updated README.md
## 0.5.0 ## 0.5.0
- added initial support for Inline WebViews using the `InAppWebView` widget - added initial support for Inline WebViews using the `InAppWebView` widget
......
...@@ -42,7 +42,8 @@ So, if you want use it, you can but you will have some limitation such as the in ...@@ -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. **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 ```dart
import 'dart:async'; import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
...@@ -295,7 +296,7 @@ InAppWebView( ...@@ -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. 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 ...@@ -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 {}}); 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. Loads the given `assetFilePath` with optional `headers` specified as a map from name to value.
...@@ -339,7 +340,7 @@ inAppWebViewController.loadFile("assets/index.html"); ...@@ -339,7 +340,7 @@ inAppWebViewController.loadFile("assets/index.html");
inAppWebViewController.loadFile(String assetFilePath, {Map<String, String> headers = const {}}); inAppWebViewController.loadFile(String assetFilePath, {Map<String, String> headers = const {}});
``` ```
#### Future\<void\> InAppWebView.reload #### Future\<void\> InAppWebViewController.reload
Reloads the `InAppWebView` window. Reloads the `InAppWebView` window.
...@@ -347,7 +348,7 @@ Reloads the `InAppWebView` window. ...@@ -347,7 +348,7 @@ Reloads the `InAppWebView` window.
inAppWebViewController.reload(); inAppWebViewController.reload();
``` ```
#### Future\<void\> InAppWebView.goBack #### Future\<void\> InAppWebViewController.goBack
Goes back in the history of the `InAppWebView` window. Goes back in the history of the `InAppWebView` window.
...@@ -355,7 +356,7 @@ Goes back in the history of the `InAppWebView` window. ...@@ -355,7 +356,7 @@ Goes back in the history of the `InAppWebView` window.
inAppWebViewController.goBack(); inAppWebViewController.goBack();
``` ```
#### Future\<bool\> InAppWebView.canGoBack #### Future\<bool\> InAppWebViewController.canGoBack
Returns a Boolean value indicating whether the `InAppWebView` can move backward. 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. ...@@ -363,7 +364,7 @@ Returns a Boolean value indicating whether the `InAppWebView` can move backward.
inAppWebViewController.canGoBack(); inAppWebViewController.canGoBack();
``` ```
#### Future\<void\> InAppWebView.goForward #### Future\<void\> InAppWebViewController.goForward
Goes forward in the history of the `InAppWebView` window. Goes forward in the history of the `InAppWebView` window.
...@@ -371,7 +372,7 @@ Goes forward in the history of the `InAppWebView` window. ...@@ -371,7 +372,7 @@ Goes forward in the history of the `InAppWebView` window.
inAppWebViewController.goForward(); inAppWebViewController.goForward();
``` ```
#### Future\<bool\> InAppWebView.canGoForward #### Future\<bool\> InAppWebViewController.canGoForward
Returns a Boolean value indicating whether the `InAppWebView` can move forward. 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. ...@@ -379,7 +380,7 @@ Returns a Boolean value indicating whether the `InAppWebView` can move forward.
inAppWebViewController.canGoForward(); inAppWebViewController.canGoForward();
``` ```
#### Future\<bool\> InAppWebView.isLoading #### Future\<bool\> InAppWebViewController.isLoading
Check if the Web View of the `InAppWebView` instance is in a loading state. 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. ...@@ -387,7 +388,7 @@ Check if the Web View of the `InAppWebView` instance is in a loading state.
inAppWebViewController.isLoading(); inAppWebViewController.isLoading();
``` ```
#### Future\<void\> InAppWebView.stopLoading #### Future\<void\> InAppWebViewController.stopLoading
Stops the Web View of the `InAppWebView` instance from loading. Stops the Web View of the `InAppWebView` instance from loading.
...@@ -395,7 +396,7 @@ 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(); inAppWebViewController.stopLoading();
``` ```
#### Future\<String\> InAppWebView.injectScriptCode #### Future\<String\> InAppWebViewController.injectScriptCode
Injects JavaScript code into the `InAppWebView` window and returns the result of the evaluation. 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 ...@@ -403,7 +404,7 @@ Injects JavaScript code into the `InAppWebView` window and returns the result of
inAppWebViewController.injectScriptCode(String source); inAppWebViewController.injectScriptCode(String source);
``` ```
#### Future\<void\> InAppWebView.injectScriptFile #### Future\<void\> InAppWebViewController.injectScriptFile
Injects a JavaScript file into the `InAppWebView` window. Injects a JavaScript file into the `InAppWebView` window.
...@@ -411,7 +412,7 @@ Injects a JavaScript file into the `InAppWebView` window. ...@@ -411,7 +412,7 @@ Injects a JavaScript file into the `InAppWebView` window.
inAppWebViewController.injectScriptFile(String urlFile); inAppWebViewController.injectScriptFile(String urlFile);
``` ```
#### Future\<void\> InAppWebView.injectStyleCode #### Future\<void\> InAppWebViewController.injectStyleCode
Injects CSS into the `InAppWebView` window. Injects CSS into the `InAppWebView` window.
...@@ -419,7 +420,7 @@ Injects CSS into the `InAppWebView` window. ...@@ -419,7 +420,7 @@ Injects CSS into the `InAppWebView` window.
inAppWebViewController.injectStyleCode(String source); inAppWebViewController.injectStyleCode(String source);
``` ```
#### Future\<void\> InAppWebView.injectStyleFile #### Future\<void\> InAppWebViewController.injectStyleFile
Injects a CSS file into the `InAppWebView` window. Injects a CSS file into the `InAppWebView` window.
...@@ -427,7 +428,7 @@ Injects a CSS file into the `InAppWebView` window. ...@@ -427,7 +428,7 @@ Injects a CSS file into the `InAppWebView` window.
inAppWebViewController.injectStyleFile(String urlFile); 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`. 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. 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 ...@@ -442,7 +443,7 @@ The `args` will be stringified automatically using `JSON.stringify(args)` method
inAppWebViewController.addJavaScriptHandler(String handlerName, JavaScriptHandlerCallback callback); 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`. 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`. Returns `true` if the callback is removed, otherwise `false`.
...@@ -450,7 +451,7 @@ 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); 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. 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 ...@@ -459,14 +460,14 @@ Takes a screenshot (in PNG format) of the WebView's visible viewport and returns
inAppWebViewController.takeScreenshot(); inAppWebViewController.takeScreenshot();
``` ```
#### Future\<void\> InAppWebView.setOptions #### Future\<void\> InAppWebViewController.setOptions
Sets the `InAppWebView` options with the new `options` and evaluates them. Sets the `InAppWebView` options with the new `options` and evaluates them.
```dart ```dart
inAppWebViewController.setOptions(Map<String, dynamic> options); 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. Gets the current `InAppWebView` options. Returns `null` if the options are not setted yet.
```dart ```dart
......
...@@ -504,7 +504,7 @@ typedef void onWebViewLoadResourceCallback(InAppWebViewController controller, We ...@@ -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`. /// - __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`. /// - __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`. /// - __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`. /// - __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`. /// - __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`. /// - __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> { ...@@ -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. /// callback for an [InAppWebView] widget.
class InAppWebViewController { class InAppWebViewController {
......
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: 0.5.0 version: 0.5.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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment