|
|
8 年 前 | |
|---|---|---|
| android | 8 年 前 | |
| example | 8 年 前 | |
| ios | 8 年 前 | |
| lib | 8 年 前 | |
| .gitignore | 8 年 前 | |
| CHANGELOG.md | 8 年 前 | |
| LICENSE | 8 年 前 | |
| README.md | 8 年 前 | |
| analysis_options.yaml | 8 年 前 | |
| flutter_webview_plugin.iml | 8 年 前 | |
| pubspec.yaml | 8 年 前 |
Plugin that allow Flutter to communicate with a native WebView.
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
For help getting started with Flutter, view our online documentation.
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;
}
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();
});
}
Add the Activity to you AndroidManifest.xml:
<activity android:name="com.flutter_webview_plugin.WebviewActivity" android:parentActivityName=".MainActivity"/>
No extra configuration is needed.