-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[webview_flutter] Extract Android implementation into a separate package #4343
[webview_flutter] Extract Android implementation into a separate package #4343
Conversation
Creates a new `webview_flutter_android` directory and adds the following meta-data files: - `AUTHORS`: copied from the `webview_flutter` package and added my name; - `CHANGELOG.md`: new file adding description for release 0.0.1; - `LICENSE`: copied from the `webview_flutter` package; - `README.md`: new file adding the standard platform implementation description; - `pubspec.yaml`: new file adding package meta-data for the `webview_flutter_android` package.
A one to one copy of the `webview_flutter/android` folder to `webview_flutter_android/` using the following command: ``` cp -R ./webview_flutter/android ./webview_flutter_android/ ```
Copied the Android specific .dart files over from the `./webview_flutter` package. Note that the `SurfaceAndroidWebView` class in the `./webview_flutter_android/lib/webview_surface_android.dart` file is copied directly (without modifactions) from the `./webview_flutter/lib/webview_flutter.dart` file.
Make sure the `AndroidWebView` and `SurfaceAndroidWebView` widgets extend the `WebViewPlatform` class from the `webview_flutter_platform_interface` package correctly by accepting an instance of the `JavascriptChannelRegistry` class.
This commit makes a direct copy of the `webview_flutter/example` app to the `webview_flutter_android` package. After the copy the `example/ios` folder is removed as it doesn't serve a purpose in the Android specific package. Commands run where: ``` cp -R ./webview_flutter/example ./webview_flutter_android/ rm -rf ./webview_flutter_android/example/ios ```
This commit updates the example App so it directly implements an Android specific implementation of the webview_flutter_platform_interface.
Updated the existing integration tests (copied from webview_flutter package) so they work correctly with the implementation of the webview_flutter_android package.
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
d5c75af
to
e157c6e
Compare
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
e157c6e
to
7e4193b
Compare
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
@flutter/googlebot I consent. |
Updated the pubspec.yaml to depend on version 1.0.0 of the webview_flutter_platform_interface package instead of using a path reference (which is now possible since the platform interface package has now been published). Co-authored-by: BeMacized <[email protected]>
7e4193b
to
881e652
Compare
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@googlebot I consent. |
Make sure the `webview_flutter` and `webview_flutter_android` example apps use different application identifiers so that the CI doesn't run into problems.
72e2e05
to
52859e9
Compare
Make sure the webview_flutter_android and webview_flutter_wkwebview packages are excluded from the Build All plugins step as they will cause conflicts with the current implementation which is still part of the webview_flutter package.
description: A Flutter plugin that provides a WebView widget on Android. | ||
repository: https://github.com/flutter/plugins/tree/master/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: 0.0.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same version comment here as for iOS.
@@ -352,3 +364,599 @@ class NavigationControls extends StatelessWidget { | |||
); | |||
} | |||
} | |||
|
|||
/// A web view widget for showing html content. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment here as for iOS about moving to a separate file.
import 'package:webview_flutter_platform_interface/webview_flutter_platform_interface.dart'; | ||
|
||
void main() { | ||
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
const bool _skipDueIssue86757 = false; | ||
const bool _skipDueIssue86757 = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: _skipDueToIssue86757
Move the `WebView` and related `WebViewController` classes from the main.dart into a separate web_view.dart file.
a982131
to
d6f1705
Compare
…_architecture_part_3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM
This pull request is not suitable for automatic merging in its current state.
|
…age (flutter#4343) * Setup webview_flutter_android package. Creates a new `webview_flutter_android` directory and adds the following meta-data files: - `AUTHORS`: copied from the `webview_flutter` package and added my name; - `CHANGELOG.md`: new file adding description for release 0.0.1; - `LICENSE`: copied from the `webview_flutter` package; - `README.md`: new file adding the standard platform implementation description; - `pubspec.yaml`: new file adding package meta-data for the `webview_flutter_android` package. * Direct copy of "android" folder. A one to one copy of the `webview_flutter/android` folder to `webview_flutter_android/` using the following command: ``` cp -R ./webview_flutter/android ./webview_flutter_android/ ``` * Direct copy of Android specific .dart files. Copied the Android specific .dart files over from the `./webview_flutter` package. Note that the `SurfaceAndroidWebView` class in the `./webview_flutter_android/lib/webview_surface_android.dart` file is copied directly (without modifactions) from the `./webview_flutter/lib/webview_flutter.dart` file. * Modify .dart code to work with platform_interface. Make sure the `AndroidWebView` and `SurfaceAndroidWebView` widgets extend the `WebViewPlatform` class from the `webview_flutter_platform_interface` package correctly by accepting an instance of the `JavascriptChannelRegistry` class. * Direct copy of the `webview_flutter/example` app. This commit makes a direct copy of the `webview_flutter/example` app to the `webview_flutter_android` package. After the copy the `example/ios` folder is removed as it doesn't serve a purpose in the Android specific package. Commands run where: ``` cp -R ./webview_flutter/example ./webview_flutter_android/ rm -rf ./webview_flutter_android/example/ios ``` * Update example to Android specific implementation. This commit updates the example App so it directly implements an Android specific implementation of the webview_flutter_platform_interface. * Update integration tests. Updated the existing integration tests (copied from webview_flutter package) so they work correctly with the implementation of the webview_flutter_android package. * Update webview_flutter_platform_interface dependency Updated the pubspec.yaml to depend on version 1.0.0 of the webview_flutter_platform_interface package instead of using a path reference (which is now possible since the platform interface package has now been published). Co-authored-by: BeMacized <[email protected]> * Use different bundle ID for Android example app. Make sure the `webview_flutter` and `webview_flutter_android` example apps use different application identifiers so that the CI doesn't run into problems. * Skip flaky integration_tests (issue 86757). * Exlude platform implementations from build all step. Make sure the webview_flutter_android and webview_flutter_wkwebview packages are excluded from the Build All plugins step as they will cause conflicts with the current implementation which is still part of the webview_flutter package. * Split helper classes from main example widget. Move the `WebView` and related `WebViewController` classes from the main.dart into a separate web_view.dart file. Co-authored-by: BeMacized <[email protected]>
* master: (51 commits) [webview_flutter] Update version number app_facing package (flutter#4375) [webview_flutter] Adjust integration test domains (flutter#4383) Remove some trivial custom analysis options files (flutter#4379) [google_maps_flutter_platfomr_interface] Add Marker drag events (flutter#2653) [flutter_plugin_tools] Improve version check error handling (flutter#4376) [flutter_plugin_tools] Allow overriding breaking change check (flutter#4369) [url_launcher] Error handling when URL cannot be parsed with Uri.parse (flutter#4365) [webview_flutter] Migrate main package to fully federated architecture. (flutter#4366) [google_sign_in] Bump minimum Flutter version and iOS deployment target (flutter#4334) Add false secret lists, and enforce ordering (flutter#4372) [camera_web] Update usage documentation (flutter#4371) [video_player] VTT Support (flutter#2878) Require authors file (flutter#4367) [flutter_plugin_tools] Fix federated safety check (flutter#4368) [webview_flutter] Extract WKWebView implementation into a separate package (flutter#4345) [webview_flutter] Extract Android implementation into a separate package (flutter#4343) [in_app_purchase] Ensure the `introductoryPriceMicros` field is populated correctly. (flutter#4364) [flutter_plugin_tools] Add a federated PR safety check (flutter#4329) [camera] Add web support (flutter#4240) [webview_flutter] Bump minimum Flutter version and iOS deployment target (flutter#4361) ... # Conflicts: # packages/webview_flutter/webview_flutter/lib/platform_interface.dart # packages/webview_flutter/webview_flutter/lib/src/webview_method_channel.dart # packages/webview_flutter/webview_flutter/lib/webview_flutter.dart
…age (flutter#4343) * Setup webview_flutter_android package. Creates a new `webview_flutter_android` directory and adds the following meta-data files: - `AUTHORS`: copied from the `webview_flutter` package and added my name; - `CHANGELOG.md`: new file adding description for release 0.0.1; - `LICENSE`: copied from the `webview_flutter` package; - `README.md`: new file adding the standard platform implementation description; - `pubspec.yaml`: new file adding package meta-data for the `webview_flutter_android` package. * Direct copy of "android" folder. A one to one copy of the `webview_flutter/android` folder to `webview_flutter_android/` using the following command: ``` cp -R ./webview_flutter/android ./webview_flutter_android/ ``` * Direct copy of Android specific .dart files. Copied the Android specific .dart files over from the `./webview_flutter` package. Note that the `SurfaceAndroidWebView` class in the `./webview_flutter_android/lib/webview_surface_android.dart` file is copied directly (without modifactions) from the `./webview_flutter/lib/webview_flutter.dart` file. * Modify .dart code to work with platform_interface. Make sure the `AndroidWebView` and `SurfaceAndroidWebView` widgets extend the `WebViewPlatform` class from the `webview_flutter_platform_interface` package correctly by accepting an instance of the `JavascriptChannelRegistry` class. * Direct copy of the `webview_flutter/example` app. This commit makes a direct copy of the `webview_flutter/example` app to the `webview_flutter_android` package. After the copy the `example/ios` folder is removed as it doesn't serve a purpose in the Android specific package. Commands run where: ``` cp -R ./webview_flutter/example ./webview_flutter_android/ rm -rf ./webview_flutter_android/example/ios ``` * Update example to Android specific implementation. This commit updates the example App so it directly implements an Android specific implementation of the webview_flutter_platform_interface. * Update integration tests. Updated the existing integration tests (copied from webview_flutter package) so they work correctly with the implementation of the webview_flutter_android package. * Update webview_flutter_platform_interface dependency Updated the pubspec.yaml to depend on version 1.0.0 of the webview_flutter_platform_interface package instead of using a path reference (which is now possible since the platform interface package has now been published). Co-authored-by: BeMacized <[email protected]> * Use different bundle ID for Android example app. Make sure the `webview_flutter` and `webview_flutter_android` example apps use different application identifiers so that the CI doesn't run into problems. * Skip flaky integration_tests (issue 86757). * Exlude platform implementations from build all step. Make sure the webview_flutter_android and webview_flutter_wkwebview packages are excluded from the Build All plugins step as they will cause conflicts with the current implementation which is still part of the webview_flutter package. * Split helper classes from main example widget. Move the `WebView` and related `WebViewController` classes from the main.dart into a separate web_view.dart file. Co-authored-by: BeMacized <[email protected]>
This PR puts the native Android implementation of the platform interface (which was separated in #4302) into its own package, in preparation for moving the main plugin to a federated architecture.
Relevant issue:
Pre-launch Checklist
dart format
.)[shared_preferences]
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.