No Description

Lejard Hadrien c22327095c get cookies 8 years ago
android c22327095c get cookies 8 years ago
example c22327095c get cookies 8 years ago
ios 3ed35f0572 patch Android and update README 8 years ago
lib c22327095c get cookies 8 years ago
.gitignore 4e3488bc16 iOS web view plugin 8 years ago
CHANGELOG.md c22327095c get cookies 8 years ago
LICENSE feb642eaf0 first commit 8 years ago
README.md 3ed35f0572 patch Android and update README 8 years ago
analysis_options.yaml 39225b2919 use yaml extension 8 years ago
flutter_webview_plugin.iml feb642eaf0 first commit 8 years ago
pubspec.yaml 77bf752297 ready to release 8 years ago

README.md

flutter_webview_plugin

Plugin that allow Flutter to communicate with a native WebView.

Getting Started

For help getting started with Flutter, view our online documentation.

How it works

Launch WebView Fullscreen (default)

On Android, add the Activity to you AndroidManifest.xml:

<activity android:name="com.flutter_webview_plugin.WebviewActivity" android:parentActivityName=".MainActivity"/>

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

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

final flutterWebviewPlugin = new FlutterWebviewPlugin();  

flutterWebviewPlugin.launch(url);  

Close launched WebView

final flutterWebviewPlugin = new FlutterWebviewPlugin();  

flutterWebviewPlugin.launch(url);  

....

// Close WebView.
// This will also emit the onDestroy event.
flutterWebviewPlugin.close();

Hidden webView

final flutterWebviewPlugin = new FlutterWebviewPlugin();  

flutterWebviewPlugin.launch(url, hidden: true);

Webview inside custom Rectangle

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<Null> onDestroy
  • Stream<String> onUrlChanged
  • Stream<Null> onBackPressed
  • Stream<WebViewStateChanged> onStateChanged

Don't forget to dispose webview flutterWebviewPlugin.dispose()