diff --git a/.idea/libraries/Flutter_Plugins.xml b/.idea/libraries/Flutter_Plugins.xml
index 65bb3679c..317997300 100755
--- a/.idea/libraries/Flutter_Plugins.xml
+++ b/.idea/libraries/Flutter_Plugins.xml
@@ -1,8 +1,6 @@
-
-
-
+
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9fc0c4456..b060674a5 100755
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,9 @@
- Removed `final` keyword for all `HeadlessInAppWebView` events
- Fixed wrong usage of Android WebView scale property
- Fixed "java.lang.NullPointerException: com.pichillilorenzo.flutter_inappwebview.in_app_webview.InAppWebViewRenderProcessClient$1.success(InAppWebViewRenderProcessClient.java:37)" [#757](https://github.com/pichillilorenzo/flutter_inappwebview/issues/757)
+- Fixed "In a multi-activity app, the plugin doesn't reattach to the first activity" [#732](https://github.com/pichillilorenzo/flutter_inappwebview/issues/732)
+- Fixed "ChromeSafariBrowser isn't calling its events, and not keeping track of isOpen properly" [#759](https://github.com/pichillilorenzo/flutter_inappwebview/issues/759)
+- Fixed Android ChromeSafariBrowser menu item callback not called because of PendingIntents extra were cached
## 5.2.1+1
diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebViewFlutterPlugin.java b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebViewFlutterPlugin.java
index 574b803c0..c3864a149 100755
--- a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebViewFlutterPlugin.java
+++ b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebViewFlutterPlugin.java
@@ -24,64 +24,76 @@ public class InAppWebViewFlutterPlugin implements FlutterPlugin, ActivityAware {
protected static final String LOG_TAG = "InAppWebViewFlutterPL";
- public static PlatformUtil platformUtil;
- public static InAppBrowserManager inAppBrowserManager;
- public static HeadlessInAppWebViewManager headlessInAppWebViewManager;
- public static ChromeSafariBrowserManager chromeSafariBrowserManager;
- public static InAppWebViewStatic inAppWebViewStatic;
- public static MyCookieManager myCookieManager;
- public static CredentialDatabaseHandler credentialDatabaseHandler;
- public static MyWebStorage myWebStorage;
- public static ServiceWorkerManager serviceWorkerManager;
- public static WebViewFeatureManager webViewFeatureManager;
+ public PlatformUtil platformUtil;
+ public InAppBrowserManager inAppBrowserManager;
+ public HeadlessInAppWebViewManager headlessInAppWebViewManager;
+ public ChromeSafariBrowserManager chromeSafariBrowserManager;
+ public InAppWebViewStatic inAppWebViewStatic;
+ public MyCookieManager myCookieManager;
+ public CredentialDatabaseHandler credentialDatabaseHandler;
+ public MyWebStorage myWebStorage;
+ public ServiceWorkerManager serviceWorkerManager;
+ public WebViewFeatureManager webViewFeatureManager;
+ public FlutterWebViewFactory flutterWebViewFactory;
public static ValueCallback filePathCallbackLegacy;
public static ValueCallback filePathCallback;
+ public Context applicationContext;
+ public PluginRegistry.Registrar registrar;
+ public BinaryMessenger messenger;
+ public FlutterPlugin.FlutterAssets flutterAssets;
+ public ActivityPluginBinding activityPluginBinding;
+ public Activity activity;
+ @SuppressWarnings("deprecation")
+ public FlutterView flutterView;
+
public InAppWebViewFlutterPlugin() {}
+ @SuppressWarnings("deprecation")
public static void registerWith(PluginRegistry.Registrar registrar) {
final InAppWebViewFlutterPlugin instance = new InAppWebViewFlutterPlugin();
- Shared.registrar = registrar;
+ instance.registrar = registrar;
instance.onAttachedToEngine(
registrar.context(), registrar.messenger(), registrar.activity(), registrar.platformViewRegistry(), registrar.view());
}
@Override
public void onAttachedToEngine(FlutterPluginBinding binding) {
- Shared.flutterAssets = binding.getFlutterAssets();
+ this.flutterAssets = binding.getFlutterAssets();
// Shared.activity could be null or not.
// It depends on who is called first between onAttachedToEngine event and onAttachedToActivity event.
//
// See https://github.com/pichillilorenzo/flutter_inappwebview/issues/390#issuecomment-647039084
onAttachedToEngine(
- binding.getApplicationContext(), binding.getBinaryMessenger(), Shared.activity, binding.getPlatformViewRegistry(), null);
+ binding.getApplicationContext(), binding.getBinaryMessenger(), this.activity, binding.getPlatformViewRegistry(), null);
}
+ @SuppressWarnings("deprecation")
private void onAttachedToEngine(Context applicationContext, BinaryMessenger messenger, Activity activity, PlatformViewRegistry platformViewRegistry, FlutterView flutterView) {
-
- Shared.applicationContext = applicationContext;
- Shared.activity = activity;
- Shared.messenger = messenger;
-
- inAppBrowserManager = new InAppBrowserManager(messenger);
- headlessInAppWebViewManager = new HeadlessInAppWebViewManager(messenger);
- chromeSafariBrowserManager = new ChromeSafariBrowserManager(messenger);
-
+ this.applicationContext = applicationContext;
+ this.activity = activity;
+ this.messenger = messenger;
+ this.flutterView = flutterView;
+
+ inAppBrowserManager = new InAppBrowserManager(this);
+ headlessInAppWebViewManager = new HeadlessInAppWebViewManager(this);
+ chromeSafariBrowserManager = new ChromeSafariBrowserManager(this);
+ flutterWebViewFactory = new FlutterWebViewFactory(this);
platformViewRegistry.registerViewFactory(
- "com.pichillilorenzo/flutter_inappwebview", new FlutterWebViewFactory(messenger, flutterView));
+ "com.pichillilorenzo/flutter_inappwebview", flutterWebViewFactory);
- platformUtil = new PlatformUtil(messenger);
- inAppWebViewStatic = new InAppWebViewStatic(messenger);
- myCookieManager = new MyCookieManager(messenger);
- myWebStorage = new MyWebStorage(messenger);
+ platformUtil = new PlatformUtil(this);
+ inAppWebViewStatic = new InAppWebViewStatic(this);
+ myCookieManager = new MyCookieManager(this);
+ myWebStorage = new MyWebStorage(this);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
- serviceWorkerManager = new ServiceWorkerManager(messenger);
+ serviceWorkerManager = new ServiceWorkerManager(this);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
- credentialDatabaseHandler = new CredentialDatabaseHandler(messenger);
+ credentialDatabaseHandler = new CredentialDatabaseHandler(this);
}
- webViewFeatureManager = new WebViewFeatureManager(messenger);
+ webViewFeatureManager = new WebViewFeatureManager(this);
}
@Override
@@ -132,25 +144,25 @@ public void onDetachedFromEngine(FlutterPluginBinding binding) {
@Override
public void onAttachedToActivity(ActivityPluginBinding activityPluginBinding) {
- Shared.activityPluginBinding = activityPluginBinding;
- Shared.activity = activityPluginBinding.getActivity();
+ this.activityPluginBinding = activityPluginBinding;
+ this.activity = activityPluginBinding.getActivity();
}
@Override
public void onDetachedFromActivityForConfigChanges() {
- Shared.activityPluginBinding = null;
- Shared.activity = null;
+ this.activityPluginBinding = null;
+ this.activity = null;
}
@Override
public void onReattachedToActivityForConfigChanges(ActivityPluginBinding activityPluginBinding) {
- Shared.activityPluginBinding = activityPluginBinding;
- Shared.activity = activityPluginBinding.getActivity();
+ this.activityPluginBinding = activityPluginBinding;
+ this.activity = activityPluginBinding.getActivity();
}
@Override
public void onDetachedFromActivity() {
- Shared.activityPluginBinding = null;
- Shared.activity = null;
+ this.activityPluginBinding = null;
+ this.activity = null;
}
}
diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebViewMethodHandler.java b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebViewMethodHandler.java
index 3f4737e9b..ae0b4e03a 100644
--- a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebViewMethodHandler.java
+++ b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebViewMethodHandler.java
@@ -548,7 +548,7 @@ public void onReceiveValue(Boolean value) {
case "addWebMessageListener":
if (webView != null && WebViewFeature.isFeatureSupported(WebViewFeature.WEB_MESSAGE_LISTENER)) {
Map webMessageListenerMap = (Map) call.argument("webMessageListener");
- WebMessageListener webMessageListener = WebMessageListener.fromMap(webMessageListenerMap);
+ WebMessageListener webMessageListener = WebMessageListener.fromMap(webView.plugin.messenger, webMessageListenerMap);
try {
webView.addWebMessageListener(webMessageListener);
result.success(true);
diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebViewStatic.java b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebViewStatic.java
index 36ea93695..ffd4ba47a 100755
--- a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebViewStatic.java
+++ b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebViewStatic.java
@@ -1,12 +1,12 @@
package com.pichillilorenzo.flutter_inappwebview;
import android.content.pm.PackageInfo;
-import android.content.pm.PackageManager;
import android.os.Build;
import android.webkit.ValueCallback;
import android.webkit.WebSettings;
import android.webkit.WebView;
+import androidx.annotation.Nullable;
import androidx.webkit.WebViewCompat;
import androidx.webkit.WebViewFeature;
@@ -17,17 +17,19 @@
import java.util.Map;
import java.util.Set;
-import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
public class InAppWebViewStatic implements MethodChannel.MethodCallHandler {
- public MethodChannel channel;
-
+
protected static final String LOG_TAG = "InAppWebViewStatic";
+ public MethodChannel channel;
+ @Nullable
+ public InAppWebViewFlutterPlugin plugin;
- public InAppWebViewStatic(BinaryMessenger messenger) {
- channel = new MethodChannel(messenger, "com.pichillilorenzo/flutter_inappwebview_static");
+ public InAppWebViewStatic(final InAppWebViewFlutterPlugin plugin) {
+ this.plugin = plugin;
+ channel = new MethodChannel(plugin.messenger, "com.pichillilorenzo/flutter_inappwebview_static");
channel.setMethodCallHandler(this);
}
@@ -35,7 +37,7 @@ public InAppWebViewStatic(BinaryMessenger messenger) {
public void onMethodCall(MethodCall call, final MethodChannel.Result result) {
switch (call.method) {
case "getDefaultUserAgent":
- result.success(WebSettings.getDefaultUserAgent(Shared.applicationContext));
+ result.success(WebSettings.getDefaultUserAgent(plugin.applicationContext));
break;
case "clearClientCertPreferences":
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
@@ -78,7 +80,7 @@ public void onReceiveValue(Boolean value) {
break;
case "getCurrentWebViewPackage":
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
- result.success(convertWebViewPackageToMap(WebViewCompat.getCurrentWebViewPackage(Shared.activity)));
+ result.success(convertWebViewPackageToMap(WebViewCompat.getCurrentWebViewPackage(plugin.activity)));
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
//with Android Lollipop (API 21) they started to update the WebView
//as a separate APK with the PlayStore and they added the
@@ -122,5 +124,6 @@ public Map convertWebViewPackageToMap(PackageInfo webViewPackage
public void dispose() {
channel.setMethodCallHandler(null);
+ plugin = null;
}
}
diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/JavaScriptBridgeInterface.java b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/JavaScriptBridgeInterface.java
index 45e3a233e..547badbd5 100755
--- a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/JavaScriptBridgeInterface.java
+++ b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/JavaScriptBridgeInterface.java
@@ -23,8 +23,7 @@ public class JavaScriptBridgeInterface {
private static final String LOG_TAG = "JSBridgeInterface";
private InAppWebView inAppWebView;
private final MethodChannel channel;
-
-
+
public JavaScriptBridgeInterface(InAppWebView inAppWebView) {
this.inAppWebView = inAppWebView;
this.channel = this.inAppWebView.channel;
diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/MyCookieManager.java b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/MyCookieManager.java
index dc2968019..5ed98435b 100755
--- a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/MyCookieManager.java
+++ b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/MyCookieManager.java
@@ -16,7 +16,6 @@
import java.util.Map;
import java.util.TimeZone;
-import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
@@ -24,11 +23,14 @@ public class MyCookieManager implements MethodChannel.MethodCallHandler {
static final String LOG_TAG = "MyCookieManager";
- public static MethodChannel channel;
+ public MethodChannel channel;
public static CookieManager cookieManager;
+ @Nullable
+ public InAppWebViewFlutterPlugin plugin;
- public MyCookieManager(BinaryMessenger messenger) {
- channel = new MethodChannel(messenger, "com.pichillilorenzo/flutter_inappwebview_cookiemanager");
+ public MyCookieManager(final InAppWebViewFlutterPlugin plugin) {
+ this.plugin = plugin;
+ channel = new MethodChannel(plugin.messenger, "com.pichillilorenzo/flutter_inappwebview_cookiemanager");
channel.setMethodCallHandler(this);
cookieManager = getCookieManager();
}
@@ -49,7 +51,7 @@ public void onMethodCall(MethodCall call, MethodChannel.Result result) {
Boolean isSecure = (Boolean) call.argument("isSecure");
Boolean isHttpOnly = (Boolean) call.argument("isHttpOnly");
String sameSite = (String) call.argument("sameSite");
- MyCookieManager.setCookie(url,
+ setCookie(url,
name,
value,
domain,
@@ -63,7 +65,7 @@ public void onMethodCall(MethodCall call, MethodChannel.Result result) {
}
break;
case "getCookies":
- result.success(MyCookieManager.getCookies((String) call.argument("url")));
+ result.success(getCookies((String) call.argument("url")));
break;
case "deleteCookie":
{
@@ -71,7 +73,7 @@ public void onMethodCall(MethodCall call, MethodChannel.Result result) {
String name = (String) call.argument("name");
String domain = (String) call.argument("domain");
String path = (String) call.argument("path");
- MyCookieManager.deleteCookie(url, name, domain, path, result);
+ deleteCookie(url, name, domain, path, result);
}
break;
case "deleteCookies":
@@ -79,11 +81,11 @@ public void onMethodCall(MethodCall call, MethodChannel.Result result) {
String url = (String) call.argument("url");
String domain = (String) call.argument("domain");
String path = (String) call.argument("path");
- MyCookieManager.deleteCookies(url, domain, path, result);
+ deleteCookies(url, domain, path, result);
}
break;
case "deleteAllCookies":
- MyCookieManager.deleteAllCookies(result);
+ deleteAllCookies(result);
break;
default:
result.notImplemented();
@@ -124,7 +126,7 @@ public void onMethodCall(MethodCall call, MethodChannel.Result result) {
return cookieManager;
}
- public static void setCookie(String url,
+ public void setCookie(String url,
String name,
String value,
String domain,
@@ -167,7 +169,7 @@ public void onReceiveValue(Boolean aBoolean) {
cookieManager.flush();
}
else {
- CookieSyncManager cookieSyncMngr = CookieSyncManager.createInstance(Shared.applicationContext);
+ CookieSyncManager cookieSyncMngr = CookieSyncManager.createInstance(plugin.applicationContext);
cookieSyncMngr.startSync();
cookieManager.setCookie(url, cookieValue);
result.success(true);
@@ -176,7 +178,7 @@ public void onReceiveValue(Boolean aBoolean) {
}
}
- public static List
\ No newline at end of file
diff --git a/lib/src/in_app_webview/headless_in_app_webview.dart b/lib/src/in_app_webview/headless_in_app_webview.dart
index 33f8d208b..8b3fccf92 100644
--- a/lib/src/in_app_webview/headless_in_app_webview.dart
+++ b/lib/src/in_app_webview/headless_in_app_webview.dart
@@ -25,7 +25,8 @@ class HeadlessInAppWebView implements WebView {
bool _started = false;
bool _running = false;
- static const MethodChannel _sharedChannel = const MethodChannel('com.pichillilorenzo/flutter_headless_inappwebview');
+ static const MethodChannel _sharedChannel =
+ const MethodChannel('com.pichillilorenzo/flutter_headless_inappwebview');
late MethodChannel _channel;
///WebView Controller that can be used to access the [InAppWebViewController] API.
@@ -97,7 +98,7 @@ class HeadlessInAppWebView implements WebView {
this.androidOnRenderProcessUnresponsive,
this.androidOnFormResubmission,
@Deprecated('Use `onZoomScaleChanged` instead')
- this.androidOnScaleChanged,
+ this.androidOnScaleChanged,
this.androidOnReceivedIcon,
this.androidOnReceivedTouchIconUrl,
this.androidOnJsBeforeUnload,
@@ -108,8 +109,8 @@ class HeadlessInAppWebView implements WebView {
this.iosShouldAllowDeprecatedTLS}) {
id = IdGenerator.generate();
webViewController = new InAppWebViewController(id, this);
- this._channel = MethodChannel(
- 'com.pichillilorenzo/flutter_headless_inappwebview_$id');
+ this._channel =
+ MethodChannel('com.pichillilorenzo/flutter_headless_inappwebview_$id');
this._channel.setMethodCallHandler(handleMethod);
}
@@ -188,7 +189,8 @@ class HeadlessInAppWebView implements WebView {
///Gets the current size in pixels of the WebView.
Future getSize() async {
Map args = {};
- Map sizeMap = (await _channel.invokeMethod('getSize', args))?.cast();
+ Map sizeMap =
+ (await _channel.invokeMethod('getSize', args))?.cast();
return MapSize.fromMap(sizeMap);
}
@@ -223,16 +225,12 @@ class HeadlessInAppWebView implements WebView {
androidOnGeolocationPermissionsShowPrompt;
@override
- Future Function(
- InAppWebViewController controller,
- String origin,
- List resources)? androidOnPermissionRequest;
+ Future Function(InAppWebViewController controller,
+ String origin, List resources)? androidOnPermissionRequest;
@override
- Future Function(
- InAppWebViewController controller,
- Uri url,
- SafeBrowsingThreat? threatType)? androidOnSafeBrowsingHit;
+ Future Function(InAppWebViewController controller,
+ Uri url, SafeBrowsingThreat? threatType)? androidOnSafeBrowsingHit;
@override
void Function(InAppWebViewController controller, Uri? url)?
@@ -289,8 +287,7 @@ class HeadlessInAppWebView implements WebView {
void Function(InAppWebViewController controller)? onWindowBlur;
@override
- void Function(InAppWebViewController controller, Uri url)?
- onDownloadStart;
+ void Function(InAppWebViewController controller, Uri url)? onDownloadStart;
@override
void Function(InAppWebViewController controller, int activeMatchOrdinal,
@@ -316,12 +313,11 @@ class HeadlessInAppWebView implements WebView {
String message)? onLoadError;
@override
- void Function(InAppWebViewController controller, Uri? url,
- int statusCode, String description)? onLoadHttpError;
+ void Function(InAppWebViewController controller, Uri? url, int statusCode,
+ String description)? onLoadHttpError;
@override
- void Function(
- InAppWebViewController controller, LoadedResource resource)?
+ void Function(InAppWebViewController controller, LoadedResource resource)?
onLoadResource;
@override
@@ -354,8 +350,7 @@ class HeadlessInAppWebView implements WebView {
URLAuthenticationChallenge challenge)? onReceivedHttpAuthRequest;
@override
- Future Function(
- InAppWebViewController controller,
+ Future Function(InAppWebViewController controller,
URLAuthenticationChallenge challenge)? onReceivedServerTrustAuthRequest;
@override
@@ -392,13 +387,13 @@ class HeadlessInAppWebView implements WebView {
void Function(InAppWebViewController controller)? onExitFullscreen;
@override
- void Function(InAppWebViewController controller, int x, int y,
- bool clampedX, bool clampedY)? onOverScrolled;
+ void Function(InAppWebViewController controller, int x, int y, bool clampedX,
+ bool clampedY)? onOverScrolled;
@override
void Function(
- InAppWebViewController controller, double oldScale, double newScale)?
- onZoomScaleChanged;
+ InAppWebViewController controller, double oldScale, double newScale)?
+ onZoomScaleChanged;
@override
Future Function(
@@ -436,17 +431,14 @@ class HeadlessInAppWebView implements WebView {
androidOnReceivedIcon;
@override
- void Function(
- InAppWebViewController controller, Uri url, bool precomposed)?
+ void Function(InAppWebViewController controller, Uri url, bool precomposed)?
androidOnReceivedTouchIconUrl;
@override
- Future Function(
- InAppWebViewController controller,
+ Future Function(InAppWebViewController controller,
JsBeforeUnloadRequest jsBeforeUnloadRequest)? androidOnJsBeforeUnload;
@override
- void Function(
- InAppWebViewController controller, LoginRequest loginRequest)?
+ void Function(InAppWebViewController controller, LoginRequest loginRequest)?
androidOnReceivedLoginRequest;
}
diff --git a/lib/src/in_app_webview/in_app_webview.dart b/lib/src/in_app_webview/in_app_webview.dart
index 733cc0834..7ef7ee2f4 100755
--- a/lib/src/in_app_webview/in_app_webview.dart
+++ b/lib/src/in_app_webview/in_app_webview.dart
@@ -87,8 +87,7 @@ class InAppWebView extends StatefulWidget implements WebView {
this.androidOnRenderProcessResponsive,
this.androidOnRenderProcessUnresponsive,
this.androidOnFormResubmission,
- @Deprecated('Use `onZoomScaleChanged` instead')
- this.androidOnScaleChanged,
+ @Deprecated('Use `onZoomScaleChanged` instead') this.androidOnScaleChanged,
this.androidOnReceivedIcon,
this.androidOnReceivedTouchIconUrl,
this.androidOnJsBeforeUnload,
@@ -317,8 +316,8 @@ class InAppWebView extends StatefulWidget implements WebView {
@override
final void Function(
- InAppWebViewController controller, double oldScale, double newScale)?
- onZoomScaleChanged;
+ InAppWebViewController controller, double oldScale, double newScale)?
+ onZoomScaleChanged;
@override
final Future Function(
diff --git a/lib/src/in_app_webview/in_app_webview_controller.dart b/lib/src/in_app_webview/in_app_webview_controller.dart
index 91beb5eca..14ac93308 100644
--- a/lib/src/in_app_webview/in_app_webview_controller.dart
+++ b/lib/src/in_app_webview/in_app_webview_controller.dart
@@ -356,7 +356,9 @@ class InAppWebViewController {
}
break;
case "onZoomScaleChanged":
- if ((_webview != null && (_webview!.androidOnScaleChanged != null || _webview!.onZoomScaleChanged != null)) ||
+ if ((_webview != null &&
+ (_webview!.androidOnScaleChanged != null ||
+ _webview!.onZoomScaleChanged != null)) ||
_inAppBrowser != null) {
double oldScale = call.arguments["oldScale"];
double newScale = call.arguments["newScale"];
@@ -365,8 +367,7 @@ class InAppWebViewController {
_webview!.onZoomScaleChanged!(this, oldScale, newScale);
else
_webview!.androidOnScaleChanged!(this, oldScale, newScale);
- }
- else
+ } else
_inAppBrowser!.androidOnScaleChanged(oldScale, newScale);
}
break;
diff --git a/lib/src/in_app_webview/webview.dart b/lib/src/in_app_webview/webview.dart
index 3bc77ecf4..03e1be556 100644
--- a/lib/src/in_app_webview/webview.dart
+++ b/lib/src/in_app_webview/webview.dart
@@ -413,8 +413,8 @@ abstract class WebView {
///
///**Official iOS API**: https://developer.apple.com/documentation/uikit/uiscrollviewdelegate/1619409-scrollviewdidzoom
final void Function(
- InAppWebViewController controller, double oldScale, double newScale)?
- onZoomScaleChanged;
+ InAppWebViewController controller, double oldScale, double newScale)?
+ onZoomScaleChanged;
///Event fired when the webview notifies that a loading URL has been flagged by Safe Browsing.
///The default behavior is to show an interstitial to the user, with the reporting checkbox visible.
@@ -721,7 +721,7 @@ abstract class WebView {
this.androidOnRenderProcessUnresponsive,
this.androidOnFormResubmission,
@Deprecated('Use `onZoomScaleChanged` instead')
- this.androidOnScaleChanged,
+ this.androidOnScaleChanged,
this.androidOnReceivedIcon,
this.androidOnReceivedTouchIconUrl,
this.androidOnJsBeforeUnload,
diff --git a/lib/src/util.dart b/lib/src/util.dart
index fb3192d5f..2af57e03f 100644
--- a/lib/src/util.dart
+++ b/lib/src/util.dart
@@ -499,9 +499,6 @@ extension MapSize on Size {
}
Map toMap() {
- return {
- 'width': width,
- 'height': height
- };
+ return {'width': width, 'height': height};
}
-}
\ No newline at end of file
+}