Skip to content

[webview_flutter_android] Adds internal wrapper methods for native WebViewClient. #8964

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Apr 14, 2025

Conversation

bparrishMines
Copy link
Contributor

@bparrishMines bparrishMines commented Mar 31, 2025

This adds the SSL classes for #7893 and a few extra WebViewClient methods.

Pre-Review Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I linked to at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.
  • I updated/added any relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or I have commented below to indicate which test exemption this PR falls under1.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

@@ -52,6 +52,7 @@ android {
implementation 'androidx.annotation:annotation:1.9.1'
implementation 'androidx.webkit:webkit:1.12.1'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:5.16.1'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was required for me to run tests locally. I'm not sure if this is just me or not.

@@ -25,7 +25,7 @@ if (flutterVersionName == null) {
android {
namespace 'io.flutter.plugins.webviewflutterexample'
compileSdk = flutter.compileSdkVersion

ndkVersion = flutter.ndkVersion
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was also required for met to run tests locally.

@bparrishMines bparrishMines changed the title Webviewclient methods [webview_flutter_android] Adds internal wrapper methods for native WebViewClient. Apr 6, 2025
@bparrishMines bparrishMines marked this pull request as ready for review April 6, 2025 20:49
@stuartmorgan-g
Copy link
Contributor

Fixes flutter/flutter#164132 by passing a TestInstanceManager when needed.

Wrong issue link? That one is about camera.

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a few minor comments

@@ -513,7 +582,7 @@ abstract class WebChromeClient {
late List<String> Function(
WebView webView,
FileChooserParams params,
)? onShowFileChooser;
) onShowFileChooser;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the change to non-nullable on these callbacks?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was caused by #8567. They are already implemented in the AndroidWebViewController: https://github.com/flutter/packages/blob/main/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart#L187. The method just wasn't required on the Dart side.

@bparrishMines bparrishMines added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 14, 2025
@auto-submit auto-submit bot merged commit 4389067 into flutter:main Apr 14, 2025
82 checks passed
@bparrishMines bparrishMines deleted the webviewclient_methods branch April 14, 2025 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App p: webview_flutter platform-android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants