[webview_flutter] Extract Android implementation into a separate package (#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 <bodhimulders@bemacized.net>

* 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 <bodhimulders@bemacized.net>
57 files changed
tree: 4c53ba50d95826e619938e3d03a16d6763af5204
  1. .ci/
  2. .github/
  3. .opensource/
  4. packages/
  5. script/
  6. .ci.yaml
  7. .cirrus.yml
  8. .clang-format
  9. .gitattributes
  10. .gitignore
  11. analysis_options.yaml
  12. analysis_options_legacy.yaml
  13. AUTHORS
  14. CODEOWNERS
  15. CONTRIBUTING.md
  16. FlutterFire.md
  17. LICENSE
  18. README.md
README.md

Flutter plugins

Build Status Release Status

This repo is a companion repo to the main flutter repo. It contains the source code for Flutter first-party plugins (i.e., plugins developed by the core Flutter team). Check the packages directory for all plugins.

Flutter plugins enable access to platform-specific APIs. For more information about plugins, and how to use them, see https://flutter.dev/platform-plugins/.

These plugins are also available on pub.

Issues

Please file any issues, bugs, or feature requests in the main flutter repo.

Issues pertaining to this repository are labeled “plugin”.

Contributing

If you wish to contribute a new plugin to the Flutter ecosystem, please see the documentation for developing packages and platform channels. You can store your plugin source code in any GitHub repository (the present repo is only intended for plugins developed by the core Flutter team). Once your plugin is ready you can publish to the pub repository.

If you wish to contribute a change to any of the existing plugins in this repo, please review our contribution guide, and send a pull request.

Plugins

These are the available plugins in this repository.

PluginPubPointsPopularityLikes
camerapub packagepub pointspopularitylikes
espressopub packagepub pointspopularitylikes
flutter_plugin_android_lifecyclepub packagepub pointspopularitylikes
google_maps_flutterpub packagepub pointspopularitylikes
google_sign_inpub packagepub pointspopularitylikes
image_pickerpub packagepub pointspopularitylikes
in_app_purchasepub packagepub pointspopularitylikes
ios_platform_imagespub packagepub pointspopularitylikes
local_authpub packagepub pointspopularitylikes
path_providerpub packagepub pointspopularitylikes
plugin_platform_interfacepub packagepub pointspopularitylikes
quick_actionspub packagepub pointspopularitylikes
shared_preferencespub packagepub pointspopularitylikes
url_launcherpub packagepub pointspopularitylikes
video_playerpub packagepub pointspopularitylikes
webview_flutterpub packagepub pointspopularitylikes

Deprecated

The following plugins are also part of this repository, but are deprecated in favor of the Flutter Community Plus versions.

PluginPubReplacementPub
android_alarm_managerpub packageandroid_alarm_manager_pluspub package
android_intentpub packageandroid_intent_pluspub package
batterypub packagebattery_pluspub package
connectivitypub packageconnectivity_pluspub package
device_infopub packagedevice_info_pluspub package
package_infopub packagepackage_info_pluspub package
sensorspub packagesensors_pluspub package
sharepub packageshare_pluspub package
wifi_info_flutterpub packagenetwork_info_pluspub package