diff --git a/.analysis_options b/.analysis_options
deleted file mode 100644
index 518eb901..00000000
--- a/.analysis_options
+++ /dev/null
@@ -1,2 +0,0 @@
-analyzer:
- strong-mode: true
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 731501dd..77e266aa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
.DS_Store
.atom/
.idea
+.vscode
.packages
.pub/
build/
@@ -9,3 +10,8 @@ packages
pubspec.lock
example/ios/Podfile.lock
+**/Flutter/App.framework/
+**/Flutter/Flutter.framework/
+**/Flutter/Generated.xcconfig/
+**/Flutter/flutter_assets/
+
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 49f348c4..639c7b48 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,83 @@
+# 0.3.0
+
+- Fixes rect capture issue. Ensures WebView remains in the correct place on screen even when keyboard appears.
+- Fixed iOS crash issue with Flutter `>= 0.10.2`.
+- Added new `clearCookies` feature.
+- Added support for `hidden` and `initialChild` feature to show page loading view.
+- Added supportMultipleWindows: enables Multiple Window Support on Android.
+- Added appCacheEnabled: enables Application Caches API on Android.
+- Added allowFileURLs: allows `file://` local file URLs.
+- iOS Now supports: `reload`, `goBack`, and `goForward`.
+- iOS Bug fix `didFailNavigation` #77
+- Updated Android `compileSdkVersion` to `27` matching offical Flutter plugins.
+- Fixed Android `reloadUrl` so settings are not cleared.
+- Enabled compatible `Mixed Content Mode` on Android.
+
+# 0.2.1
+
+- Added webview scrolling listener
+- Added stopLoading() method
+
+# 0.2.0
+
+- update sdk
+- prevent negative webview height in scaffold
+- handle type error in getCookies
+- Support file upload via WebView on Android
+- fix WebviewScaffold crash on iOS
+- Scrollbar functionality to Web view
+- Add support of HTTP errors
+- Add headers when loading url
+
+# 0.1.6
+
+- fix onStateChanged
+- Taking safe areas into account for bottom bars
+- iOS
+ + withLocalUrl option for iOS > 9.0
+- Android
+ + add reload, goBack and foForward function
+
+# 0.1.5
+
+- iOS use WKWebView instead of UIWebView
+
+# 0.1.4
+
+- support localstorage for ANDROID
+
+# 0.1.3
+
+- support zoom in webview
+
+# 0.1.2
+
+- support bottomNavigationBar and persistentFooterButtons on webview scaffold
+
+# 0.1.1
+- support back button navigation for Android
+ + if cannot go back, it will trigger onDestroy
+- support preview dart2
+
+# 0.1.0+1
+
+- fix Android close webview
+
+# 0.1.0
+
+- iOS && Android:
+ - get cookies
+ - eval javascript
+ - user agent setting
+ - state change event
+ - embed in rectangle or fullscreen if null
+ - hidden webview
+
+- Android
+ - adding Activity in manifest is not needed anymore
+
+- Add `WebviewScaffold`
+
# 0.0.9
- Android: remove the need to use FlutterActivity as base activity
diff --git a/LICENSE b/LICENSE
index 86928f65..2fe58f3d 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-// Copyright 2017 Your Company. All rights reserved.
+// Copyright 2017 Hadrien Lejard. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
@@ -10,7 +10,7 @@
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
-// * Neither the name of Your Company nor the names of its
+// * Neither the name of Hadrien Lejard nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
diff --git a/README.md b/README.md
index bccca4fc..6626d3f2 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,16 @@
-# flutter_webview_plugin
+
-Plugin that allow Flutter to communicate with a native WebView.
+[Flutter Community](https://github.com/fluttercommunity/community)
-***For Android, it will launch a new Activity inside the App with the Webview inside. Does not allow to integrate a Webview inside a Flutter Widget***
+# Flutter WebView Plugin
-***For IOS, it will launch a new UIViewController inside the App with the UIWebView inside. Does not allow to integrate a Webview inside a Flutter Widget***
+[](https://pub.dartlang.org/packages/flutter_webview_plugin)
- - [x] Android
- - [x] IOS
+Plugin that allows Flutter to communicate with a native WebView.
+
+**_Warning:_**
+The webview is not integrated in the widget tree, it is a native view on top of the flutter view.
+you won't be able to use snackbars, dialogs ...
## Getting Started
@@ -15,44 +18,192 @@ For help getting started with Flutter, view our online [documentation](http://fl
### How it works
-#### Launch WebView with variable url
+#### Launch WebView Fullscreen with Flutter navigation
+
+```dart
+new MaterialApp(
+ routes: {
+ "/": (_) => new WebviewScaffold(
+ url: "https://www.google.com",
+ appBar: new AppBar(
+ title: new Text("Widget webview"),
+ ),
+ ),
+ },
+ );
+```
+
+Optional parameters `hidden` and `initialChild` are available so that you can show something else while waiting for the page to load.
+If you set `hidden` to true it will show a default CircularProgressIndicator. If you additionally specify a Widget for initialChild
+you can have it display whatever you like till page-load.
+
+e.g. The following will show a read screen with the text 'waiting.....'.
+```dart
+return new MaterialApp(
+ title: 'Flutter WebView Demo',
+ theme: new ThemeData(
+ primarySwatch: Colors.blue,
+ ),
+ routes: {
+ '/': (_) => const MyHomePage(title: 'Flutter WebView Demo'),
+ '/widget': (_) => new WebviewScaffold(
+ url: selectedUrl,
+ appBar: new AppBar(
+ title: const Text('Widget webview'),
+ ),
+ withZoom: true,
+ withLocalStorage: true,
+ hidden: true,
+ initialChild: Container(
+ color: Colors.redAccent,
+ child: const Center(
+ child: Text('Waiting.....'),
+ ),
+ ),
+ ),
+ },
+);
+```
+
+`FlutterWebviewPlugin` provide a singleton instance linked to one unique webview,
+so you can take control of the webview from anywhere in the app
+
+listen for events
+
+```dart
+final flutterWebviewPlugin = new FlutterWebviewPlugin();
+
+flutterWebviewPlugin.onUrlChanged.listen((String url) {
+
+});
+```
+
+#### Listen for scroll event in webview
+
+```dart
+final flutterWebviewPlugin = new FlutterWebviewPlugin();
+flutterWebviewPlugin.onScrollYChanged.listen((double offsetY) { // latest offset value in vertical scroll
+ // compare vertical scroll changes here with old value
+});
+
+flutterWebviewPlugin.onScrollXChanged.listen((double offsetX) { // latest offset value in horizontal scroll
+ // compare horizontal scroll changes here with old value
+});
+
+````
+
+Note: Do note there is a slight difference is scroll distance between ios and android. Android scroll value difference tends to be larger than ios devices.
+
+
+#### Hidden WebView
+
+```dart
+final flutterWebviewPlugin = new FlutterWebviewPlugin();
+
+flutterWebviewPlugin.launch(url, hidden: true);
+```
+
+#### Close launched WebView
+
+```dart
+flutterWebviewPlugin.close();
+```
+
+#### Webview inside custom Rectangle
+
+```dart
+final flutterWebviewPlugin = new FlutterWebviewPlugin();
+
+flutterWebviewPlugin.launch(url,
+ fullScreen: false,
+ rect: new Rect.fromLTWH(
+ 0.0,
+ 0.0,
+ MediaQuery.of(context).size.width,
+ 300.0,
+ ),
+);
+```
+
+### Webview Events
+
+- `Stream` onDestroy
+- `Stream` onUrlChanged
+- `Stream` onStateChanged
+- `Stream` onScrollXChanged
+- `Stream` onScrollYChanged
+- `Stream` onError
+
+**_Don't forget to dispose webview_**
+`flutterWebviewPlugin.dispose()`
+
+### Webview Functions
```dart
-void launchWebView(String url) sync {
- var flutterWebviewPlugin = new FlutterWebviewPlugin();
-
- flutterWebviewPlugin.launch(url);
-
- // Wait in this async function until destroy of WebView.
- await flutterWebviewPlugin.onDestroy.first;
-}
+Future launch(String url, {
+ Map headers: null,
+ bool withJavascript: true,
+ bool clearCache: false,
+ bool clearCookies: false,
+ bool hidden: false,
+ bool enableAppScheme: true,
+ Rect rect: null,
+ String userAgent: null,
+ bool withZoom: false,
+ bool withLocalStorage: true,
+ bool withLocalUrl: true,
+ bool scrollBar: true,
+ bool supportMultipleWindows: false,
+ bool appCacheEnabled: false,
+ bool allowFileURLs: false,
+});
```
-### Close launched WebView
+```dart
+Future evalJavascript(String code);
+```
```dart
-void launchWebViewAndCloseAfterWhile(String url) {
- var flutterWebviewPlugin = new FlutterWebviewPlugin();
-
- flutterWebviewPlugin.launch(url);
-
- // After 10 seconds.
- new Timer(const Duration(seconds: 10), () {
- // Close WebView.
- // This will also emit the onDestroy event.
- flutterWebviewPlugin.close();
- });
-}
+Future