[webview_flutter_android] Removes unused field `WebView.useHybridComposition` and suppress Java `ViewConstructor` lint (#3428)
[webview_flutter_android] Removes unused field `WebView.useHybridComposition` and suppress Java `ViewConstructor` lint
diff --git a/packages/webview_flutter/webview_flutter_android/CHANGELOG.md b/packages/webview_flutter/webview_flutter_android/CHANGELOG.md
index d7d8e3f..800e80a 100644
--- a/packages/webview_flutter/webview_flutter_android/CHANGELOG.md
+++ b/packages/webview_flutter/webview_flutter_android/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 3.4.5
+
+* Removes unused internal `WebView` field and Java class.
+
## 3.4.4
* Fixes a bug where the native `WebView` wouldn't be traversed for autofill automatically.
diff --git a/packages/webview_flutter/webview_flutter_android/android/build.gradle b/packages/webview_flutter/webview_flutter_android/android/build.gradle
index 990746e..1448516 100644
--- a/packages/webview_flutter/webview_flutter_android/android/build.gradle
+++ b/packages/webview_flutter/webview_flutter_android/android/build.gradle
@@ -30,6 +30,9 @@
}
lintOptions {
+ // See https://sites.google.com/a/android.com/tools/tips/lint-checks for all available
+ // android lint checks.
+ error 'ViewConstructor'
disable 'AndroidGradlePluginVersion', 'InvalidPackage', 'GradleDependency'
}
diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/GeneratedAndroidWebView.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/GeneratedAndroidWebView.java
index 88edf58..507c07a 100644
--- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/GeneratedAndroidWebView.java
+++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/GeneratedAndroidWebView.java
@@ -1,7 +1,7 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Autogenerated from Pigeon (v9.0.4), do not edit directly.
+// Autogenerated from Pigeon (v9.0.5), do not edit directly.
// See also: https://pub.dev/packages/pigeon
package io.flutter.plugins.webviewflutter;
@@ -679,7 +679,7 @@
/** Generated interface from Pigeon that represents a handler of messages from Flutter. */
public interface WebViewHostApi {
- void create(@NonNull Long instanceId, @NonNull Boolean useHybridComposition);
+ void create(@NonNull Long instanceId);
void loadData(
@NonNull Long instanceId,
@@ -772,13 +772,7 @@
if (instanceIdArg == null) {
throw new NullPointerException("instanceIdArg unexpectedly null.");
}
- Boolean useHybridCompositionArg = (Boolean) args.get(1);
- if (useHybridCompositionArg == null) {
- throw new NullPointerException("useHybridCompositionArg unexpectedly null.");
- }
- api.create(
- (instanceIdArg == null) ? null : instanceIdArg.longValue(),
- useHybridCompositionArg);
+ api.create((instanceIdArg == null) ? null : instanceIdArg.longValue());
wrapped.add(0, null);
} catch (Error | RuntimeException exception) {
ArrayList<Object> wrappedError = wrapError(exception);
@@ -1636,6 +1630,7 @@
this.binaryMessenger = argBinaryMessenger;
}
+ /** Public interface for sending reply. */
public interface Reply<T> {
void reply(T reply);
}
@@ -1650,9 +1645,7 @@
binaryMessenger, "dev.flutter.pigeon.WebViewFlutterApi.create", getCodec());
channel.send(
new ArrayList<Object>(Collections.singletonList(identifierArg)),
- channelReply -> {
- callback.reply(null);
- });
+ channelReply -> callback.reply(null));
}
}
/** Generated interface from Pigeon that represents a handler of messages from Flutter. */
diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/InputAwareWebView.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/InputAwareWebView.java
deleted file mode 100644
index 1276ac8..0000000
--- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/InputAwareWebView.java
+++ /dev/null
@@ -1,240 +0,0 @@
-// Copyright 2013 The Flutter Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package io.flutter.plugins.webviewflutter;
-
-import static android.content.Context.INPUT_METHOD_SERVICE;
-
-import android.content.Context;
-import android.graphics.Rect;
-import android.os.Build;
-import android.util.Log;
-import android.view.View;
-import android.view.inputmethod.InputMethodManager;
-import android.webkit.WebView;
-import android.widget.ListPopupWindow;
-
-/**
- * A WebView subclass that mirrors the same implementation hacks that the system WebView does in
- * order to correctly create an InputConnection.
- *
- * <p>These hacks are only needed in Android versions below N and exist to create an InputConnection
- * on the WebView's dedicated input, or IME, thread. The majority of this proxying logic is in
- * {@link #checkInputConnectionProxy}.
- *
- * <p>See also {@link ThreadedInputConnectionProxyAdapterView}.
- */
-class InputAwareWebView extends WebView {
- private static final String TAG = "InputAwareWebView";
- private View threadedInputConnectionProxyView;
- private ThreadedInputConnectionProxyAdapterView proxyAdapterView;
- private View containerView;
-
- InputAwareWebView(Context context, View containerView) {
- super(context);
- this.containerView = containerView;
- }
-
- void setContainerView(View containerView) {
- this.containerView = containerView;
-
- if (proxyAdapterView == null) {
- return;
- }
-
- Log.w(TAG, "The containerView has changed while the proxyAdapterView exists.");
- if (containerView != null) {
- setInputConnectionTarget(proxyAdapterView);
- }
- }
-
- /**
- * Set our proxy adapter view to use its cached input connection instead of creating new ones.
- *
- * <p>This is used to avoid losing our input connection when the virtual display is resized.
- */
- void lockInputConnection() {
- if (proxyAdapterView == null) {
- return;
- }
-
- proxyAdapterView.setLocked(true);
- }
-
- /** Sets the proxy adapter view back to its default behavior. */
- void unlockInputConnection() {
- if (proxyAdapterView == null) {
- return;
- }
-
- proxyAdapterView.setLocked(false);
- }
-
- /** Restore the original InputConnection, if needed. */
- void dispose() {
- resetInputConnection();
- }
-
- /**
- * Creates an InputConnection from the IME thread when needed.
- *
- * <p>We only need to create a {@link ThreadedInputConnectionProxyAdapterView} and create an
- * InputConnectionProxy on the IME thread when WebView is doing the same thing. So we rely on the
- * system calling this method for WebView's proxy view in order to know when we need to create our
- * own.
- *
- * <p>This method would normally be called for any View that used the InputMethodManager. We rely
- * on flutter/engine filtering the calls we receive down to the ones in our hierarchy and the
- * system WebView in order to know whether or not the system WebView expects an InputConnection on
- * the IME thread.
- */
- @Override
- public boolean checkInputConnectionProxy(final View view) {
- // Check to see if the view param is WebView's ThreadedInputConnectionProxyView.
- View previousProxy = threadedInputConnectionProxyView;
- threadedInputConnectionProxyView = view;
- if (previousProxy == view) {
- // This isn't a new ThreadedInputConnectionProxyView. Ignore it.
- return super.checkInputConnectionProxy(view);
- }
- if (containerView == null) {
- Log.e(
- TAG,
- "Can't create a proxy view because there's no container view. Text input may not work.");
- return super.checkInputConnectionProxy(view);
- }
-
- // We've never seen this before, so we make the assumption that this is WebView's
- // ThreadedInputConnectionProxyView. We are making the assumption that the only view that could
- // possibly be interacting with the IMM here is WebView's ThreadedInputConnectionProxyView.
- proxyAdapterView =
- new ThreadedInputConnectionProxyAdapterView(
- /*containerView=*/ containerView,
- /*targetView=*/ view,
- /*imeHandler=*/ view.getHandler());
- setInputConnectionTarget(/*targetView=*/ proxyAdapterView);
- return super.checkInputConnectionProxy(view);
- }
-
- /**
- * Ensure that input creation happens back on {@link #containerView}'s thread once this view no
- * longer has focus.
- *
- * <p>The logic in {@link #checkInputConnectionProxy} forces input creation to happen on Webview's
- * thread for all connections. We undo it here so users will be able to go back to typing in
- * Flutter UIs as expected.
- */
- @Override
- public void clearFocus() {
- super.clearFocus();
- resetInputConnection();
- }
-
- /**
- * Ensure that input creation happens back on {@link #containerView}.
- *
- * <p>The logic in {@link #checkInputConnectionProxy} forces input creation to happen on Webview's
- * thread for all connections. We undo it here so users will be able to go back to typing in
- * Flutter UIs as expected.
- */
- private void resetInputConnection() {
- if (proxyAdapterView == null) {
- // No need to reset the InputConnection to the default thread if we've never changed it.
- return;
- }
- if (containerView == null) {
- Log.e(TAG, "Can't reset the input connection to the container view because there is none.");
- return;
- }
- setInputConnectionTarget(/*targetView=*/ containerView);
- }
-
- /**
- * This is the crucial trick that gets the InputConnection creation to happen on the correct
- * thread pre Android N.
- * https://cs.chromium.org/chromium/src/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnectionFactory.java?l=169&rcl=f0698ee3e4483fad5b0c34159276f71cfaf81f3a
- *
- * <p>{@code targetView} should have a {@link View#getHandler} method with the thread that future
- * InputConnections should be created on.
- */
- void setInputConnectionTarget(final View targetView) {
- if (containerView == null) {
- Log.e(
- TAG,
- "Can't set the input connection target because there is no containerView to use as a handler.");
- return;
- }
-
- targetView.requestFocus();
- containerView.post(
- new Runnable() {
- @Override
- public void run() {
- if (containerView == null) {
- Log.e(
- TAG,
- "Can't set the input connection target because there is no containerView to use as a handler.");
- return;
- }
-
- InputMethodManager imm =
- (InputMethodManager) getContext().getSystemService(INPUT_METHOD_SERVICE);
- // This is a hack to make InputMethodManager believe that the target view now has focus.
- // As a result, InputMethodManager will think that targetView is focused, and will call
- // getHandler() of the view when creating input connection.
-
- // Step 1: Set targetView as InputMethodManager#mNextServedView. This does not affect
- // the real window focus.
- targetView.onWindowFocusChanged(true);
-
- // Step 2: Have InputMethodManager focus in on targetView. As a result, IMM will call
- // onCreateInputConnection() on targetView on the same thread as
- // targetView.getHandler(). It will also call subsequent InputConnection methods on this
- // thread. This is the IME thread in cases where targetView is our proxyAdapterView.
- imm.isActive(containerView);
- }
- });
- }
-
- @Override
- protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) {
- // This works around a crash when old (<67.0.3367.0) Chromium versions are used.
-
- // Prior to Chromium 67.0.3367 the following sequence happens when a select drop down is shown
- // on tablets:
- //
- // - WebView is calling ListPopupWindow#show
- // - buildDropDown is invoked, which sets mDropDownList to a DropDownListView.
- // - showAsDropDown is invoked - resulting in mDropDownList being added to the window and is
- // also synchronously performing the following sequence:
- // - WebView's focus change listener is loosing focus (as mDropDownList got it)
- // - WebView is hiding all popups (as it lost focus)
- // - WebView's SelectPopupDropDown#hide is invoked.
- // - DropDownPopupWindow#dismiss is invoked setting mDropDownList to null.
- // - mDropDownList#setSelection is invoked and is throwing a NullPointerException (as we just set mDropDownList to null).
- //
- // To workaround this, we drop the problematic focus lost call.
- // See more details on: https://github.com/flutter/flutter/issues/54164
- //
- // We don't do this after Android P as it shipped with a new enough WebView version, and it's
- // better to not do this on all future Android versions in case DropDownListView's code changes.
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P
- && isCalledFromListPopupWindowShow()
- && !focused) {
- return;
- }
- super.onFocusChanged(focused, direction, previouslyFocusedRect);
- }
-
- private boolean isCalledFromListPopupWindowShow() {
- StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
- for (StackTraceElement stackTraceElement : stackTraceElements) {
- if (stackTraceElement.getClassName().equals(ListPopupWindow.class.getCanonicalName())
- && stackTraceElement.getMethodName().equals("show")) {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/ThreadedInputConnectionProxyAdapterView.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/ThreadedInputConnectionProxyAdapterView.java
deleted file mode 100644
index 1c865c9..0000000
--- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/ThreadedInputConnectionProxyAdapterView.java
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright 2013 The Flutter Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package io.flutter.plugins.webviewflutter;
-
-import android.os.Handler;
-import android.os.IBinder;
-import android.view.View;
-import android.view.inputmethod.EditorInfo;
-import android.view.inputmethod.InputConnection;
-
-/**
- * A fake View only exposed to InputMethodManager.
- *
- * <p>This follows a similar flow to Chromium's WebView (see
- * https://cs.chromium.org/chromium/src/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnectionProxyView.java).
- * WebView itself bounces its InputConnection around several different threads. We follow its logic
- * here to get the same working connection.
- *
- * <p>This exists solely to forward input creation to WebView's ThreadedInputConnectionProxyView on
- * the IME thread. The way that this is created in {@link
- * InputAwareWebView#checkInputConnectionProxy} guarantees that we have a handle to
- * ThreadedInputConnectionProxyView and {@link #onCreateInputConnection} is always called on the IME
- * thread. We delegate to ThreadedInputConnectionProxyView there to get WebView's input connection.
- */
-final class ThreadedInputConnectionProxyAdapterView extends View {
- final Handler imeHandler;
- final IBinder windowToken;
- final View containerView;
- final View rootView;
- final View targetView;
-
- private boolean triggerDelayed = true;
- private boolean isLocked = false;
- private InputConnection cachedConnection;
-
- ThreadedInputConnectionProxyAdapterView(View containerView, View targetView, Handler imeHandler) {
- super(containerView.getContext());
- this.imeHandler = imeHandler;
- this.containerView = containerView;
- this.targetView = targetView;
- windowToken = containerView.getWindowToken();
- rootView = containerView.getRootView();
- setFocusable(true);
- setFocusableInTouchMode(true);
- setVisibility(VISIBLE);
- }
-
- /** Returns whether or not this is currently asynchronously acquiring an input connection. */
- boolean isTriggerDelayed() {
- return triggerDelayed;
- }
-
- /** Sets whether or not this should use its previously cached input connection. */
- void setLocked(boolean locked) {
- isLocked = locked;
- }
-
- /**
- * This is expected to be called on the IME thread. See the setup required for this in {@link
- * InputAwareWebView#checkInputConnectionProxy(View)}.
- *
- * <p>Delegates to ThreadedInputConnectionProxyView to get WebView's input connection.
- */
- @Override
- public InputConnection onCreateInputConnection(final EditorInfo outAttrs) {
- triggerDelayed = false;
- InputConnection inputConnection =
- (isLocked) ? cachedConnection : targetView.onCreateInputConnection(outAttrs);
- triggerDelayed = true;
- cachedConnection = inputConnection;
- return inputConnection;
- }
-
- @Override
- public boolean checkInputConnectionProxy(View view) {
- return true;
- }
-
- @Override
- public boolean hasWindowFocus() {
- // None of our views here correctly report they have window focus because of how we're embedding
- // the platform view inside of a virtual display.
- return true;
- }
-
- @Override
- public View getRootView() {
- return rootView;
- }
-
- @Override
- public boolean onCheckIsTextEditor() {
- return true;
- }
-
- @Override
- public boolean isFocused() {
- return true;
- }
-
- @Override
- public IBinder getWindowToken() {
- return windowToken;
- }
-
- @Override
- public Handler getHandler() {
- return imeHandler;
- }
-}
diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewFlutterPlugin.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewFlutterPlugin.java
index c30e956..8067f89 100644
--- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewFlutterPlugin.java
+++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewFlutterPlugin.java
@@ -6,7 +6,6 @@
import android.content.Context;
import android.os.Handler;
-import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import io.flutter.embedding.engine.plugins.FlutterPlugin;
@@ -68,7 +67,6 @@
registrar.messenger(),
registrar.platformViewRegistry(),
registrar.activity(),
- registrar.view(),
new FlutterAssetManager.RegistrarFlutterAssetManager(
registrar.context().getAssets(), registrar));
}
@@ -77,7 +75,6 @@
BinaryMessenger binaryMessenger,
PlatformViewRegistry viewRegistry,
Context context,
- View containerView,
FlutterAssetManager flutterAssetManager) {
instanceManager =
InstanceManager.open(
@@ -92,11 +89,7 @@
webViewHostApi =
new WebViewHostApiImpl(
- instanceManager,
- binaryMessenger,
- new WebViewHostApiImpl.WebViewProxy(),
- context,
- containerView);
+ instanceManager, binaryMessenger, new WebViewHostApiImpl.WebViewProxy(), context);
javaScriptChannelHostApi =
new JavaScriptChannelHostApiImpl(
instanceManager,
@@ -144,7 +137,6 @@
binding.getBinaryMessenger(),
binding.getPlatformViewRegistry(),
binding.getApplicationContext(),
- null,
new FlutterAssetManager.PluginBindingFlutterAssetManager(
binding.getApplicationContext().getAssets(), binding.getFlutterAssets()));
}
diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewHostApiImpl.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewHostApiImpl.java
index 9d0aa36..9f41a4d 100644
--- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewHostApiImpl.java
+++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewHostApiImpl.java
@@ -16,6 +16,7 @@
import android.webkit.WebViewClient;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import androidx.annotation.VisibleForTesting;
import io.flutter.embedding.android.FlutterView;
import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.platform.PlatformView;
@@ -31,8 +32,6 @@
public class WebViewHostApiImpl implements WebViewHostApi {
private final InstanceManager instanceManager;
private final WebViewProxy webViewProxy;
- // Only used with WebView using virtual displays.
- @Nullable private final View containerView;
private final BinaryMessenger binaryMessenger;
private Context context;
@@ -54,22 +53,6 @@
}
/**
- * Creates a {@link InputAwareWebViewPlatformView}.
- *
- * @param context an Activity Context to access application assets
- * @param containerView parent View of the WebView
- * @return the created {@link InputAwareWebViewPlatformView}
- */
- public InputAwareWebViewPlatformView createInputAwareWebView(
- Context context,
- BinaryMessenger binaryMessenger,
- InstanceManager instanceManager,
- @Nullable View containerView) {
- return new InputAwareWebViewPlatformView(
- context, binaryMessenger, instanceManager, containerView);
- }
-
- /**
* Forwards call to {@link WebView#setWebContentsDebuggingEnabled}.
*
* @param enabled whether debugging should be enabled
@@ -80,7 +63,12 @@
}
/** Implementation of {@link WebView} that can be used as a Flutter {@link PlatformView}s. */
+ @SuppressLint("ViewConstructor")
public static class WebViewPlatformView extends WebView implements PlatformView {
+ // To ease adding callback methods, this value is added prematurely.
+ @SuppressWarnings("unused")
+ private WebViewFlutterApiImpl api;
+
private WebViewClient currentWebViewClient;
private WebChromeClientHostApiImpl.SecureWebChromeClient currentWebChromeClient;
@@ -94,6 +82,7 @@
super(context);
currentWebViewClient = new WebViewClient();
currentWebChromeClient = new WebChromeClientHostApiImpl.SecureWebChromeClient();
+ api = new WebViewFlutterApiImpl(binaryMessenger, instanceManager);
setWebViewClient(currentWebViewClient);
setWebChromeClient(currentWebChromeClient);
@@ -161,82 +150,16 @@
public WebChromeClient getWebChromeClient() {
return currentWebChromeClient;
}
- }
-
- /**
- * Implementation of {@link InputAwareWebView} that can be used as a Flutter {@link
- * PlatformView}s.
- */
- @SuppressLint("ViewConstructor")
- public static class InputAwareWebViewPlatformView extends InputAwareWebView
- implements PlatformView {
- private WebViewClient currentWebViewClient;
- private WebChromeClientHostApiImpl.SecureWebChromeClient currentWebChromeClient;
/**
- * Creates a {@link InputAwareWebViewPlatformView}.
+ * Flutter API used to send messages back to Dart.
*
- * @param context an Activity Context to access application assets. This value cannot be null.
+ * <p>This is only visible for testing.
*/
- public InputAwareWebViewPlatformView(
- Context context,
- BinaryMessenger binaryMessenger,
- InstanceManager instanceManager,
- View containerView) {
- super(context, containerView);
- currentWebViewClient = new WebViewClient();
- currentWebChromeClient = new WebChromeClientHostApiImpl.SecureWebChromeClient();
-
- setWebViewClient(currentWebViewClient);
- setWebChromeClient(currentWebChromeClient);
- }
-
- @Override
- public View getView() {
- return this;
- }
-
- @Override
- public void onFlutterViewAttached(@NonNull View flutterView) {
- setContainerView(flutterView);
- }
-
- @Override
- public void onFlutterViewDetached() {
- setContainerView(null);
- }
-
- @Override
- public void dispose() {
- super.dispose();
- destroy();
- }
-
- @Override
- public void onInputConnectionLocked() {
- lockInputConnection();
- }
-
- @Override
- public void onInputConnectionUnlocked() {
- unlockInputConnection();
- }
-
- @Override
- public void setWebViewClient(WebViewClient webViewClient) {
- super.setWebViewClient(webViewClient);
- currentWebViewClient = webViewClient;
- currentWebChromeClient.setWebViewClient(webViewClient);
- }
-
- @Override
- public void setWebChromeClient(WebChromeClient client) {
- super.setWebChromeClient(client);
- if (!(client instanceof WebChromeClientHostApiImpl.SecureWebChromeClient)) {
- throw new AssertionError("Client must be a SecureWebChromeClient.");
- }
- currentWebChromeClient = (WebChromeClientHostApiImpl.SecureWebChromeClient) client;
- currentWebChromeClient.setWebViewClient(currentWebViewClient);
+ @SuppressWarnings("unused")
+ @VisibleForTesting
+ void setApi(WebViewFlutterApiImpl api) {
+ this.api = api;
}
}
@@ -247,19 +170,16 @@
* @param binaryMessenger used to communicate with Dart over asynchronous messages
* @param webViewProxy handles creating {@link WebView}s and calling its static methods
* @param context an Activity Context to access application assets. This value cannot be null.
- * @param containerView parent of the webView
*/
public WebViewHostApiImpl(
InstanceManager instanceManager,
BinaryMessenger binaryMessenger,
WebViewProxy webViewProxy,
- Context context,
- @Nullable View containerView) {
+ Context context) {
this.instanceManager = instanceManager;
this.binaryMessenger = binaryMessenger;
this.webViewProxy = webViewProxy;
this.context = context;
- this.containerView = containerView;
}
/**
@@ -272,17 +192,13 @@
}
@Override
- public void create(Long instanceId, Boolean useHybridComposition) {
+ public void create(@NonNull Long instanceId) {
DisplayListenerProxy displayListenerProxy = new DisplayListenerProxy();
DisplayManager displayManager =
(DisplayManager) context.getSystemService(Context.DISPLAY_SERVICE);
displayListenerProxy.onPreWebViewInitialization(displayManager);
- final WebView webView =
- useHybridComposition
- ? webViewProxy.createWebView(context, binaryMessenger, instanceManager)
- : webViewProxy.createInputAwareWebView(
- context, binaryMessenger, instanceManager, containerView);
+ final WebView webView = webViewProxy.createWebView(context, binaryMessenger, instanceManager);
displayListenerProxy.onPostWebViewInitialization(displayManager);
instanceManager.addDartCreatedInstance(webView, instanceId);
diff --git a/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/InputAwareWebViewTest.java b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/InputAwareWebViewTest.java
deleted file mode 100644
index 0eb078d..0000000
--- a/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/InputAwareWebViewTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2013 The Flutter Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package io.flutter.plugins.webviewflutter;
-
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.ArgumentMatchers.anyBoolean;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.verify;
-
-import android.content.Context;
-import android.view.View;
-import org.junit.Test;
-
-public class InputAwareWebViewTest {
- static class TestView extends View {
- Runnable postAction;
-
- public TestView(Context context) {
- super(context);
- }
-
- @Override
- public boolean post(Runnable action) {
- postAction = action;
- return true;
- }
- }
-
- @Test
- public void runnableChecksContainerViewIsNull() {
- final Context mockContext = mock(Context.class);
-
- final TestView containerView = new TestView(mockContext);
- final InputAwareWebView inputAwareWebView = new InputAwareWebView(mockContext, containerView);
-
- final View mockProxyAdapterView = mock(View.class);
-
- inputAwareWebView.setInputConnectionTarget(mockProxyAdapterView);
- inputAwareWebView.setContainerView(null);
-
- assertNotNull(containerView.postAction);
- containerView.postAction.run();
- verify(mockProxyAdapterView, never()).onWindowFocusChanged(anyBoolean());
- }
-}
diff --git a/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/WebViewTest.java b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/WebViewTest.java
index 9b0447b..b57cd78 100644
--- a/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/WebViewTest.java
+++ b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/WebViewTest.java
@@ -59,8 +59,8 @@
.thenReturn(mockWebView);
testHostApiImpl =
new WebViewHostApiImpl(
- testInstanceManager, mockBinaryMessenger, mockWebViewProxy, mockContext, null);
- testHostApiImpl.create(0L, true);
+ testInstanceManager, mockBinaryMessenger, mockWebViewProxy, mockContext);
+ testHostApiImpl.create(0L);
}
@After
diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/android_proxy.dart b/packages/webview_flutter/webview_flutter_android/lib/src/android_proxy.dart
index 2a480c4..a6505c2 100644
--- a/packages/webview_flutter/webview_flutter_android/lib/src/android_proxy.dart
+++ b/packages/webview_flutter/webview_flutter_android/lib/src/android_proxy.dart
@@ -25,13 +25,7 @@
});
/// Constructs a [android_webview.WebView].
- ///
- /// Due to changes in Flutter 3.0 the [useHybridComposition] doesn't have
- /// any effect and should not be exposed publicly. More info here:
- /// https://github.com/flutter/flutter/issues/108106
- final android_webview.WebView Function({
- required bool useHybridComposition,
- }) createAndroidWebView;
+ final android_webview.WebView Function() createAndroidWebView;
/// Constructs a [android_webview.WebChromeClient].
final android_webview.WebChromeClient Function({
diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview.dart b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview.dart
index ca9b718..5c55209 100644
--- a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview.dart
+++ b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview.dart
@@ -9,8 +9,8 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart' show BinaryMessenger;
-import 'package:flutter/widgets.dart'
- show AndroidViewSurface, WidgetsFlutterBinding;
+
+import 'package:flutter/widgets.dart' show WidgetsFlutterBinding;
import 'android_webview.g.dart';
import 'android_webview_api_impls.dart';
@@ -89,7 +89,6 @@
/// any effect and should not be exposed publicly. More info here:
/// https://github.com/flutter/flutter/issues/108106
WebView({
- this.useHybridComposition = false,
@visibleForTesting super.binaryMessenger,
@visibleForTesting super.instanceManager,
}) : super.detached() {
@@ -102,7 +101,6 @@
/// create copies.
@protected
WebView.detached({
- this.useHybridComposition = false,
super.binaryMessenger,
super.instanceManager,
}) : super.detached();
@@ -111,17 +109,6 @@
@visibleForTesting
static WebViewHostApiImpl api = WebViewHostApiImpl();
- /// Whether the [WebView] will be rendered with an [AndroidViewSurface].
- ///
- /// This implementation uses hybrid composition to render the WebView Widget.
- /// This comes at the cost of some performance on Android versions below 10.
- /// See
- /// https://flutter.dev/docs/development/platform-integration/platform-views#performance
- /// for more information.
- ///
- /// Defaults to false.
- final bool useHybridComposition;
-
/// The [WebSettings] object used to control the settings for this WebView.
late final WebSettings settings = WebSettings(this);
@@ -413,7 +400,6 @@
@override
WebView copy() {
return WebView.detached(
- useHybridComposition: useHybridComposition,
binaryMessenger: _api.binaryMessenger,
instanceManager: _api.instanceManager,
);
diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview.g.dart b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview.g.dart
index d7a965f..d2976a8 100644
--- a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview.g.dart
+++ b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview.g.dart
@@ -1,7 +1,7 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Autogenerated from Pigeon (v9.0.4), do not edit directly.
+// Autogenerated from Pigeon (v9.0.5), do not edit directly.
// See also: https://pub.dev/packages/pigeon
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import
@@ -350,13 +350,12 @@
static const MessageCodec<Object?> codec = _WebViewHostApiCodec();
- Future<void> create(int arg_instanceId, bool arg_useHybridComposition) async {
+ Future<void> create(int arg_instanceId) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.WebViewHostApi.create', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
- await channel.send(<Object?>[arg_instanceId, arg_useHybridComposition])
- as List<Object?>?;
+ await channel.send(<Object?>[arg_instanceId]) as List<Object?>?;
if (replyList == null) {
throw PlatformException(
code: 'channel-error',
diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_api_impls.dart b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_api_impls.dart
index 0af4057..3553e03 100644
--- a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_api_impls.dart
+++ b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_api_impls.dart
@@ -45,6 +45,7 @@
WebChromeClientFlutterApiImpl? webChromeClientFlutterApi,
JavaScriptChannelFlutterApiImpl? javaScriptChannelFlutterApi,
FileChooserParamsFlutterApiImpl? fileChooserParamsFlutterApi,
+ WebViewFlutterApiImpl? webViewFlutterApi,
}) {
this.javaObjectFlutterApi =
javaObjectFlutterApi ?? JavaObjectFlutterApiImpl();
@@ -58,6 +59,7 @@
javaScriptChannelFlutterApi ?? JavaScriptChannelFlutterApiImpl();
this.fileChooserParamsFlutterApi =
fileChooserParamsFlutterApi ?? FileChooserParamsFlutterApiImpl();
+ this.webViewFlutterApi = webViewFlutterApi ?? WebViewFlutterApiImpl();
}
static bool _haveBeenSetUp = false;
@@ -85,6 +87,9 @@
/// Flutter Api for [FileChooserParams].
late final FileChooserParamsFlutterApiImpl fileChooserParamsFlutterApi;
+ /// Flutter Api for [WebView].
+ late final WebViewFlutterApiImpl webViewFlutterApi;
+
/// Ensures all the Flutter APIs have been setup to receive calls from native code.
void ensureSetUp() {
if (!_haveBeenSetUp) {
@@ -94,6 +99,7 @@
WebChromeClientFlutterApi.setup(webChromeClientFlutterApi);
JavaScriptChannelFlutterApi.setup(javaScriptChannelFlutterApi);
FileChooserParamsFlutterApi.setup(fileChooserParamsFlutterApi);
+ WebViewFlutterApi.setup(webViewFlutterApi);
_haveBeenSetUp = true;
}
}
@@ -146,10 +152,7 @@
/// Helper method to convert instances ids to objects.
Future<void> createFromInstance(WebView instance) {
- return create(
- instanceManager.addDartCreatedInstance(instance),
- instance.useHybridComposition,
- );
+ return create(instanceManager.addDartCreatedInstance(instance));
}
/// Helper method to convert the instances ids to objects.
diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart
index 9c9093b..f1fe168 100644
--- a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart
+++ b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart
@@ -88,13 +88,7 @@
/// The native [android_webview.WebView] being controlled.
late final android_webview.WebView _webView =
- _androidWebViewParams.androidWebViewProxy.createAndroidWebView(
- // Due to changes in Flutter 3.0 the `useHybridComposition` doesn't have
- // any effect and is purposefully not exposed publicly by the
- // [AndroidWebViewController]. More info here:
- // https://github.com/flutter/flutter/issues/108106
- useHybridComposition: true,
- );
+ _androidWebViewParams.androidWebViewProxy.createAndroidWebView();
late final android_webview.WebChromeClient _webChromeClient =
_androidWebViewParams.androidWebViewProxy.createAndroidWebChromeClient(
diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/legacy/webview_android.dart b/packages/webview_flutter/webview_flutter_android/lib/src/legacy/webview_android.dart
index 382e40a..5ad2eef 100644
--- a/packages/webview_flutter/webview_flutter_android/lib/src/legacy/webview_android.dart
+++ b/packages/webview_flutter/webview_flutter_android/lib/src/legacy/webview_android.dart
@@ -40,7 +40,6 @@
Set<Factory<OneSequenceGestureRecognizer>>? gestureRecognizers,
}) {
return WebViewAndroidWidget(
- useHybridComposition: false,
creationParams: creationParams,
callbacksHandler: webViewPlatformCallbacksHandler,
javascriptChannelRegistry: javascriptChannelRegistry,
diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/legacy/webview_android_widget.dart b/packages/webview_flutter/webview_flutter_android/lib/src/legacy/webview_android_widget.dart
index 8504253..8ae5ab0 100644
--- a/packages/webview_flutter/webview_flutter_android/lib/src/legacy/webview_android_widget.dart
+++ b/packages/webview_flutter/webview_flutter_android/lib/src/legacy/webview_android_widget.dart
@@ -19,7 +19,6 @@
const WebViewAndroidWidget({
super.key,
required this.creationParams,
- required this.useHybridComposition,
required this.callbacksHandler,
required this.javascriptChannelRegistry,
required this.onBuildWidget,
@@ -34,17 +33,6 @@
/// Initial parameters used to setup the WebView.
final CreationParams creationParams;
- /// Whether the [android_webview.WebView] will be rendered with an [AndroidViewSurface].
- ///
- /// This implementation uses hybrid composition to render the
- /// [WebViewAndroidWidget]. This comes at the cost of some performance on
- /// Android versions below 10. See
- /// https://flutter.dev/docs/development/platform-integration/platform-views#performance
- /// for more information.
- ///
- /// Defaults to false.
- final bool useHybridComposition;
-
/// Handles callbacks that are made by [android_webview.WebViewClient], [android_webview.DownloadListener], and [android_webview.WebChromeClient].
final WebViewPlatformCallbacksHandler callbacksHandler;
@@ -79,7 +67,6 @@
void initState() {
super.initState();
controller = WebViewAndroidPlatformController(
- useHybridComposition: widget.useHybridComposition,
creationParams: widget.creationParams,
callbacksHandler: widget.callbacksHandler,
javascriptChannelRegistry: widget.javascriptChannelRegistry,
@@ -99,7 +86,6 @@
class WebViewAndroidPlatformController extends WebViewPlatformController {
/// Construct a [WebViewAndroidPlatformController].
WebViewAndroidPlatformController({
- required bool useHybridComposition,
required CreationParams creationParams,
required this.callbacksHandler,
required this.javascriptChannelRegistry,
@@ -112,9 +98,7 @@
}) : webStorage = webStorage ?? android_webview.WebStorage.instance,
assert(creationParams.webSettings?.hasNavigationDelegate != null),
super(callbacksHandler) {
- webView = webViewProxy.createWebView(
- useHybridComposition: useHybridComposition,
- );
+ webView = webViewProxy.createWebView();
webView.settings.setDomStorageEnabled(true);
webView.settings.setJavaScriptCanOpenWindowsAutomatically(true);
@@ -632,8 +616,8 @@
const WebViewProxy();
/// Constructs a [android_webview.WebView].
- android_webview.WebView createWebView({required bool useHybridComposition}) {
- return android_webview.WebView(useHybridComposition: useHybridComposition);
+ android_webview.WebView createWebView() {
+ return android_webview.WebView();
}
/// Constructs a [android_webview.WebViewClient].
diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/legacy/webview_surface_android.dart b/packages/webview_flutter/webview_flutter_android/lib/src/legacy/webview_surface_android.dart
index 81a9655..3743467 100644
--- a/packages/webview_flutter/webview_flutter_android/lib/src/legacy/webview_surface_android.dart
+++ b/packages/webview_flutter/webview_flutter_android/lib/src/legacy/webview_surface_android.dart
@@ -43,7 +43,6 @@
required WebViewPlatformCallbacksHandler webViewPlatformCallbacksHandler,
}) {
return WebViewAndroidWidget(
- useHybridComposition: true,
creationParams: creationParams,
callbacksHandler: webViewPlatformCallbacksHandler,
javascriptChannelRegistry: javascriptChannelRegistry,
diff --git a/packages/webview_flutter/webview_flutter_android/pigeons/android_webview.dart b/packages/webview_flutter/webview_flutter_android/pigeons/android_webview.dart
index 9205e83..9978ed4 100644
--- a/packages/webview_flutter/webview_flutter_android/pigeons/android_webview.dart
+++ b/packages/webview_flutter/webview_flutter_android/pigeons/android_webview.dart
@@ -123,7 +123,7 @@
@HostApi(dartHostTestHandler: 'TestWebViewHostApi')
abstract class WebViewHostApi {
- void create(int instanceId, bool useHybridComposition);
+ void create(int instanceId);
void loadData(
int instanceId,
diff --git a/packages/webview_flutter/webview_flutter_android/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/pubspec.yaml
index dabaf6d..37b3826 100644
--- a/packages/webview_flutter/webview_flutter_android/pubspec.yaml
+++ b/packages/webview_flutter/webview_flutter_android/pubspec.yaml
@@ -2,7 +2,7 @@
description: A Flutter plugin that provides a WebView widget on Android.
repository: https://github.com/flutter/packages/tree/main/packages/webview_flutter/webview_flutter_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22
-version: 3.4.4
+version: 3.4.5
environment:
sdk: ">=2.18.0 <4.0.0"
diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.dart
index 777d53b..1f11bec 100644
--- a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.dart
+++ b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.dart
@@ -81,8 +81,7 @@
)? onShowFileChooser,
}) =>
MockWebChromeClient(),
- createAndroidWebView: ({required bool useHybridComposition}) =>
- nonNullMockWebView,
+ createAndroidWebView: () => nonNullMockWebView,
createAndroidWebViewClient: ({
void Function(android_webview.WebView webView, String url)?
onPageFinished,
diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart
index 88b1f7d..595db88 100644
--- a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart
+++ b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart
@@ -694,20 +694,17 @@
class MockAndroidWebViewProxy extends _i1.Mock
implements _i10.AndroidWebViewProxy {
@override
- _i2.WebView Function({required bool useHybridComposition})
- get createAndroidWebView => (super.noSuchMethod(
- Invocation.getter(#createAndroidWebView),
- returnValue: ({required bool useHybridComposition}) =>
- _FakeWebView_7(
- this,
- Invocation.getter(#createAndroidWebView),
- ),
- returnValueForMissingStub: ({required bool useHybridComposition}) =>
- _FakeWebView_7(
- this,
- Invocation.getter(#createAndroidWebView),
- ),
- ) as _i2.WebView Function({required bool useHybridComposition}));
+ _i2.WebView Function() get createAndroidWebView => (super.noSuchMethod(
+ Invocation.getter(#createAndroidWebView),
+ returnValue: () => _FakeWebView_7(
+ this,
+ Invocation.getter(#createAndroidWebView),
+ ),
+ returnValueForMissingStub: () => _FakeWebView_7(
+ this,
+ Invocation.getter(#createAndroidWebView),
+ ),
+ ) as _i2.WebView Function());
@override
_i2.WebChromeClient Function({
void Function(
@@ -1758,12 +1755,6 @@
/// See the documentation for Mockito's code generation for more information.
class MockWebView extends _i1.Mock implements _i2.WebView {
@override
- bool get useHybridComposition => (super.noSuchMethod(
- Invocation.getter(#useHybridComposition),
- returnValue: false,
- returnValueForMissingStub: false,
- ) as bool);
- @override
_i2.WebSettings get settings => (super.noSuchMethod(
Invocation.getter(#settings),
returnValue: _FakeWebSettings_16(
diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_test.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_test.dart
index e1489f6c..f447926 100644
--- a/packages/webview_flutter/webview_flutter_android/test/android_webview_test.dart
+++ b/packages/webview_flutter/webview_flutter_android/test/android_webview_test.dart
@@ -110,7 +110,7 @@
});
test('create', () {
- verify(mockPlatformHostApi.create(webViewInstanceId, false));
+ verify(mockPlatformHostApi.create(webViewInstanceId));
});
test('setWebContentsDebuggingEnabled true', () {
diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_test.mocks.dart
index 43eda09..1130bc2 100644
--- a/packages/webview_flutter/webview_flutter_android/test/android_webview_test.mocks.dart
+++ b/packages/webview_flutter/webview_flutter_android/test/android_webview_test.mocks.dart
@@ -632,17 +632,10 @@
}
@override
- void create(
- int? instanceId,
- bool? useHybridComposition,
- ) =>
- super.noSuchMethod(
+ void create(int? instanceId) => super.noSuchMethod(
Invocation.method(
#create,
- [
- instanceId,
- useHybridComposition,
- ],
+ [instanceId],
),
returnValueForMissingStub: null,
);
@@ -1036,11 +1029,6 @@
}
@override
- bool get useHybridComposition => (super.noSuchMethod(
- Invocation.getter(#useHybridComposition),
- returnValue: false,
- ) as bool);
- @override
_i2.WebSettings get settings => (super.noSuchMethod(
Invocation.getter(#settings),
returnValue: _FakeWebSettings_4(
diff --git a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.dart b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.dart
index 44cc185..400cb3a 100644
--- a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.dart
+++ b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.dart
@@ -61,9 +61,7 @@
when(mockWebView.settings).thenReturn(mockWebSettings);
mockWebViewProxy = MockWebViewProxy();
- when(mockWebViewProxy.createWebView(
- useHybridComposition: anyNamed('useHybridComposition'),
- )).thenReturn(mockWebView);
+ when(mockWebViewProxy.createWebView()).thenReturn(mockWebView);
when(mockWebViewProxy.createWebViewClient(
onPageStarted: anyNamed('onPageStarted'),
onPageFinished: anyNamed('onPageFinished'),
@@ -86,7 +84,6 @@
bool useHybridComposition = false,
}) async {
await tester.pumpWidget(WebViewAndroidWidget(
- useHybridComposition: useHybridComposition,
creationParams: creationParams ??
CreationParams(
webSettings: WebSettings(
@@ -132,7 +129,7 @@
'Create Widget with Hybrid Composition',
(WidgetTester tester) async {
await buildWidget(tester, useHybridComposition: true);
- verify(mockWebViewProxy.createWebView(useHybridComposition: true));
+ verify(mockWebViewProxy.createWebView());
},
);
diff --git a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart
index 0588a0b..b82f8de 100644
--- a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart
+++ b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart
@@ -335,11 +335,6 @@
}
@override
- bool get useHybridComposition => (super.noSuchMethod(
- Invocation.getter(#useHybridComposition),
- returnValue: false,
- ) as bool);
- @override
_i2.WebSettings get settings => (super.noSuchMethod(
Invocation.getter(#settings),
returnValue: _FakeWebSettings_0(
@@ -941,19 +936,16 @@
}
@override
- _i2.WebView createWebView({required bool? useHybridComposition}) =>
- (super.noSuchMethod(
+ _i2.WebView createWebView() => (super.noSuchMethod(
Invocation.method(
#createWebView,
[],
- {#useHybridComposition: useHybridComposition},
),
returnValue: _FakeWebView_3(
this,
Invocation.method(
#createWebView,
[],
- {#useHybridComposition: useHybridComposition},
),
),
) as _i2.WebView);
diff --git a/packages/webview_flutter/webview_flutter_android/test/test_android_webview.g.dart b/packages/webview_flutter/webview_flutter_android/test/test_android_webview.g.dart
index 85acbcf..33ab0ec 100644
--- a/packages/webview_flutter/webview_flutter_android/test/test_android_webview.g.dart
+++ b/packages/webview_flutter/webview_flutter_android/test/test_android_webview.g.dart
@@ -1,7 +1,7 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Autogenerated from Pigeon (v9.0.4), do not edit directly.
+// Autogenerated from Pigeon (v9.0.5), do not edit directly.
// See also: https://pub.dev/packages/pigeon
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, unnecessary_import
// ignore_for_file: avoid_relative_lib_imports
@@ -101,7 +101,7 @@
abstract class TestWebViewHostApi {
static const MessageCodec<Object?> codec = _TestWebViewHostApiCodec();
- void create(int instanceId, bool useHybridComposition);
+ void create(int instanceId);
void loadData(
int instanceId, String data, String? mimeType, String? encoding);
@@ -171,10 +171,7 @@
final int? arg_instanceId = (args[0] as int?);
assert(arg_instanceId != null,
'Argument for dev.flutter.pigeon.WebViewHostApi.create was null, expected non-null int.');
- final bool? arg_useHybridComposition = (args[1] as bool?);
- assert(arg_useHybridComposition != null,
- 'Argument for dev.flutter.pigeon.WebViewHostApi.create was null, expected non-null bool.');
- api.create(arg_instanceId!, arg_useHybridComposition!);
+ api.create(arg_instanceId!);
return <Object?>[];
});
}