Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

[webview_flutter] Copies app-facing implementation of webview_flutter from v4_webview #6856

Merged
merged 28 commits into from
Dec 17, 2022

Conversation

bparrishMines
Copy link
Contributor

@bparrishMines bparrishMines commented Dec 16, 2022

Fixes flutter/flutter#94051

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki 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/plugins repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I listed 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 this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

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

@github-actions github-actions bot added the p: webview_flutter Edits files for a webview_flutter plugin label Dec 16, 2022
@bparrishMines bparrishMines changed the title Webview flutter release [webview_flutter] Copies app-facing implementation of webview_flutter from v4_webview Dec 16, 2022
* Updates code for `no_leading_underscores_for_local_identifiers` lint.
* Updates minimum Flutter version to 2.10.
* Updates minimum Flutter version to 3.0.0.
* Fixes avoid_redundant_argument_values lint warnings and minor typos.
* Ignores unnecessary import warnings in preparation for [upcoming Flutter changes](https://github.com/flutter/flutter/pull/104231).
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's collapse these two and the underscores one above to a catch-all "Updates code for new analysis options." so there's less minor stuff listed in with the big change.

@@ -1,41 +1,73 @@
# WebView for Flutter

<?code-excerpt path-base="excerpts/packages/webview_flutter_example"?>
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks! You can remove this package from script/configs/temp_exclude_excerpt.yaml in this PR as well.

@@ -45,54 +77,141 @@ android {
}
```

### Using Virtual displays
### Platform Specific Features
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Platform-Specific Features


1. Set the correct `minSdkVersion` in `android/app/build.gradle` (if it was previously lower than 20):
Many classes have a subclass or an underlying implementation that provides access to platform
specific features.
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here: platform-specific features


### Replacing WebView Functionality

The `WebView` class has been removed and it's functionality has been split into `WebViewController`
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: its

and `WebViewWidget`.

`WebViewController` handles all functionality that is associated with the underlying WebView
provided by each platform. (e.g. loading a url, setting the background color of the underlying
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: "e.g.,"

The `WebView` class has been removed and it's functionality has been split into `WebViewController`
and `WebViewWidget`.

`WebViewController` handles all functionality that is associated with the underlying WebView
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: "underlying web view" since it's referring to the concept rather than a class.

* `WebView.initialMediaPlaybackPolicy` -> `WebKitWebViewControllerCreationParams.mediaTypesRequiringUserAction`
* `WebView.allowsInlineMediaPlayback` -> `WebKitWebViewControllerCreationParams.allowsInlineMediaPlayback`

## Enable Material Components for Android
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this and the next section still be ### headings under ## Usage?

Copy link
Contributor

@stuartmorgan stuartmorgan 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 one last README nit, plus removing the platform-layer-only types from the this package's export list, per your comment. Since the export issue only applies to using the platform interface, we can remove them here and land this, and make the implementation re-export fixes in parallel, right (rather than having to wait to land those package updates before landing this)?

* `WebView.gestureNavigationEnabled` -> `WebKitWebViewController.setAllowsBackForwardNavigationGestures`
* `WebView.initialMediaPlaybackPolicy` -> `WebKitWebViewControllerCreationParams.mediaTypesRequiringUserAction`
* `WebView.allowsInlineMediaPlayback` -> `WebKitWebViewControllerCreationParams.allowsInlineMediaPlayback`

### Enable Material Components for Android
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, my last comment wasn't very clear. These should be ### as you've done, but they also need to be moved up to just before the new ## Migrating from 3.0 to 4.0 section so that they are nested under Usage rather than the migration section.

@bparrishMines
Copy link
Contributor Author

@stuartmorgan Thanks for your help for getting this though so late!

@bparrishMines bparrishMines added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 17, 2022
@auto-submit auto-submit bot merged commit 840a049 into flutter:main Dec 17, 2022
@bparrishMines bparrishMines deleted the webview_flutter_release branch December 17, 2022 02:02
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 19, 2022
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Dec 19, 2022
* 5f62d21eb [local_auth] Fix failed biometric authentication not throwing error (flutter/plugins#6821)

* ca974ab0c [webview_flutter_web] Copies web implementation of webview_flutter from v4_webview (flutter/plugins#6854)

* 4d11be416 [image_picker] Don't store null paths in lost cache (flutter/plugins#6678)

* fd2841fd0 [webview_flutter_android] Fix timeouts in the integration tests (flutter/plugins#6857)

* abc9f9a9b [flutter_plugin_tools] If `clang-format` does not run, fall back to other executables in PATH (flutter/plugins#6853)

* 7efb5e89d [video_player] Add compatibility with the current platform interface (flutter/plugins#6855)

* 32dcbf3e3 [image_picker] Improve image_picker for iOS to handle more image types (flutter/plugins#6812)

* 840a04954 [webview_flutter] Copies app-facing implementation of webview_flutter from v4_webview (flutter/plugins#6856)
gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jan 19, 2023
…#117314)

* 5f62d21eb [local_auth] Fix failed biometric authentication not throwing error (flutter/plugins#6821)

* ca974ab0c [webview_flutter_web] Copies web implementation of webview_flutter from v4_webview (flutter/plugins#6854)

* 4d11be416 [image_picker] Don't store null paths in lost cache (flutter/plugins#6678)

* fd2841fd0 [webview_flutter_android] Fix timeouts in the integration tests (flutter/plugins#6857)

* abc9f9a9b [flutter_plugin_tools] If `clang-format` does not run, fall back to other executables in PATH (flutter/plugins#6853)

* 7efb5e89d [video_player] Add compatibility with the current platform interface (flutter/plugins#6855)

* 32dcbf3e3 [image_picker] Improve image_picker for iOS to handle more image types (flutter/plugins#6812)

* 840a04954 [webview_flutter] Copies app-facing implementation of webview_flutter from v4_webview (flutter/plugins#6856)
mauricioluz pushed a commit to mauricioluz/plugins that referenced this pull request Jan 26, 2023
… from v4_webview (flutter#6856)

* copy code from v4_webview

* version bump and readme update

* work towards better readme

* improvements

* more readme progress

* improvements

* fix main and update more readme

* excerpt changes and more 3.0 diffs

* cookie manager update

* remove packages from exclude list

* lint

* better range

* isForMainFrame

* load page after waiting for widget

* fix integration tests

* improve readme a bit

* collapse changelong. update platform-specific wording. include in excerpt tests

* use platform implementation packages

* include missing exports

* PR comments

* correct spelling

* interface dev dependency

* move other usage above migration

* remove interface classes
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosubmit Merge PR when tree becomes green via auto submit App p: webview_flutter Edits files for a webview_flutter plugin
Projects
None yet
2 participants