Browse Source

fix onStateChanged

Lejard Hadrien 7 years ago
parent
commit
49c51c7c05
2 changed files with 7 additions and 3 deletions
  1. 1 0
      CHANGELOG.md
  2. 6 3
      lib/src/base.dart

+ 1 - 0
CHANGELOG.md

@@ -1,5 +1,6 @@
 # 0.1.6
 
+- fix onStateChanged
 - Taking safe areas into account for bottom bars
 - iOS
     + withLocalUrl option for iOS > 9.0

+ 6 - 3
lib/src/base.dart

@@ -38,7 +38,10 @@ class FlutterWebviewPlugin {
         _onUrlChanged.add(call.arguments["url"]);
         break;
       case "onState":
-        _onStateChanged.add(new WebViewStateChanged.fromMap(call.arguments));
+        _onStateChanged.add(
+          new WebViewStateChanged.fromMap(
+              new Map<String, dynamic>.from(call.arguments)),
+        );
         break;
       case "onError":
         _onError.add(call.arguments);
@@ -120,11 +123,11 @@ class FlutterWebviewPlugin {
   /// Reloads the WebView.
   /// This is only available on Android for now.
   Future reload() => _channel.invokeMethod("reload");
-  
+
   /// Navigates back on the Webview.
   /// This is only available on Android for now.
   Future goBack() => _channel.invokeMethod("back");
-  
+
   /// Navigates forward on the Webview.
   /// This is only available on Android for now.
   Future goForward() => _channel.invokeMethod("forward");