Просмотр исходного кода

Merge pull request #4 from pedia/schema

ready to 0.0.10
Ken 8 лет назад
Родитель
Сommit
d5fd84b0a3

+ 4 - 2
android/src/main/java/com/flutter_webview_plugin/FlutterWebviewPlugin.java

@@ -158,8 +158,10 @@ public class FlutterWebviewPlugin implements MethodCallHandler {
   }
 
   private void close(MethodCall call, MethodChannel.Result result) {
-    ViewGroup vg = (ViewGroup)(webView.getParent());
-    vg.removeView(webView);
+    if (View.VISIBLE == webView.getVisibility()) {
+      ViewGroup vg = (ViewGroup) (webView.getParent());
+      vg.removeView(webView);
+    }
     webView = null;
     result.success(null);
 

+ 0 - 11
example/lib/main.dart

@@ -43,8 +43,6 @@ class _MyHomePageState extends State<MyHomePage> {
   // On urlChanged stream
   StreamSubscription<String> _onUrlChanged;
 
-  StreamSubscription<String> _onStateChanged;
-
   TextEditingController _urlCtrl =
       new TextEditingController(text: "http://github.com");
 
@@ -59,15 +57,6 @@ class _MyHomePageState extends State<MyHomePage> {
   initState() {
     super.initState();
 
-    _onStateChanged =
-        flutterWebviewPlugin.onStateChanged.listen((dynamic state) {
-      if (mounted) {
-        setState(() {
-          _history.add("state: $state");
-        });
-      }
-    });
-
     // Add a listener to on destroy WebView, so you can make came actions.
     _onDestroy = flutterWebviewPlugin.onDestroy.listen((_) {
       if (mounted) {

+ 2 - 1
pubspec.yaml

@@ -3,8 +3,9 @@ description: Plugin that allow Flutter to communicate with a native Webview.
 authors:
 - Hadrien Lejard <hadrien.lejard@gmail.com>
 - Toufik Zitouni <toufiksapps@gmail.com>
+- Pedia <kpedia@163.com>
 homepage: https://github.com/dart-flitter/flutter_webview_plugin
-version: 0.0.9+1
+version: 0.0.10
 
 flutter:
   plugin: