-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[webview_flutter_android] Updates plugin to use ProxyApiss
#7794
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
Changes from 1 commit
3a06ba1
022f335
eba1170
139b71b
817900f
b2df316
da9e40f
8b7f3a6
6710e7d
d95064a
bca2a8f
44069c5
7d08599
5af1f19
8be75df
840a9c0
0bb7d0c
38887e4
9437524
d64584f
15fd208
04e8b65
3313810
73333f4
1a66dda
73af051
3247075
3244f36
7439716
417c9d4
edc96ed
4ecf2cb
6b6f5af
b566a80
875a3db
1ecebcf
bf34fe7
adcd9aa
79f39e8
b84aa1b
a8bc402
29f24ab
436f627
604da48
b864491
63add96
362de78
7a74ee3
7979424
14f2b9f
d004bdc
db583c5
27060b6
d4a017a
61e5be0
0d2a6de
504f4e7
97db13f
c43e103
91924ab
bd240fe
2406ecb
97794ec
11acdbd
d51c389
1e0c79e
4b05e38
b7891e3
66d47d3
577d75a
7a324c2
6402f15
80f2510
8e3beed
d16ad98
d2e4f7e
74c1566
c893bd4
0c22e1e
f3824f1
464c2a8
320b8ac
78ca1bd
4ab4648
c313cc8
050c8e4
0d5ad0f
9c92615
72f26ae
7c35e9b
7d63b78
dd57f9f
dfeff6d
4567360
bdf82ea
2ecb73b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| # Contributing to `webview_flutter_android` | ||
|
|
||
| Please start by taking a look at the general guide to contributing to the `flutter/packages` repo: | ||
| https://github.com/flutter/packages/blob/main/CONTRIBUTING.md | ||
|
|
||
| ## Package Structure | ||
|
|
||
| This plugin serves as a platform implementation plugin as outlined in [federated plugin](https://docs.flutter.dev/packages-and-plugins/developing-packages#federated-plugins). | ||
| The sections below will provide an overview of how this plugin implements this portion with Android. | ||
|
|
||
| For making changes to this package, please take a look at [changing federated plugin](https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins). | ||
|
||
|
|
||
| ### Quick Overview | ||
|
|
||
| This plugin implements the platform interface provided in `webview_flutter_platform_interface` using | ||
| the native WebKit APIs for Android. | ||
|
|
||
| #### SDK Wrappers | ||
|
|
||
| To access native APIS, this plugins uses Dart wrappers of the native library. The native library is | ||
| wrapped using using the `ProxyApi` feature from the `pigeon` package. | ||
|
|
||
| The wrappers for the native library can be updated and modified by changing `pigeons/android_webview.dart`. | ||
|
|
||
| The generated files are located: | ||
| * `lib/src/android_webkit.g.dart` | ||
| * `android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt` | ||
|
|
||
| To update a wrapper for a platform, follow the steps: | ||
|
||
|
|
||
| ##### 1. Ensure the project has been built at least once | ||
|
|
||
| Run `flutter build apk --debug` in `example/`. | ||
|
|
||
| ##### 2. Make changes to the respective pigeon file that matches the native SDK | ||
|
|
||
| * Android Dependency: https://developer.android.com/reference/android/webkit/package-summary | ||
| * Pigeon file to update: `pigeons/android_webview.dart` | ||
|
|
||
| ##### 3. Run the code generator from the terminal | ||
|
|
||
| Run: `dart run pigeon --input pigeons/interactive_media_ads_android.dart` | ||
|
||
|
|
||
| ##### 4. Update the generated APIs in native code | ||
|
|
||
| Running the `flutter build` command from step 1 again should provide build errors and indicate what | ||
| needs to be done. Alternatively, it can be easier to update native code with the platform's specific | ||
| IDE: | ||
|
|
||
| Open `example/android/` in a separate Android Studio project. | ||
|
|
||
| ##### 5. Write API tests | ||
|
|
||
| Assuming a non-static method or constructor was added to the native wrapper, a native test will need | ||
| to be added. | ||
|
|
||
| Tests location: `android/src/test/java/io/flutter/plugins/webviewflutter/` | ||
|
|
||
| #### Dart Unit Testing | ||
|
|
||
| Tests for the platform implementations use [mockito] to generate mock objects of the native Dart | ||
| wrappers. To generate the mock objects in `test/`, run | ||
| `dart run build_runner build --delete-conflicting-outputs`. | ||
|
|
||
| #### | ||
|
|
||
| ## Recommended Process for Adding a New Feature | ||
|
||
|
|
||
| ### 1. Create a new feature request issue in the `flutter/flutter` repo. | ||
|
|
||
| See https://github.com/flutter/flutter/issues/new?assignees=&labels=&projects=&template=3_feature_request.yml | ||
|
|
||
| ### 2. In that issue add the specific native classes/methods that this feature requires for each platform: | ||
|
|
||
| Add a note if this feature only exist for a single platform. | ||
|
|
||
| ### 3. Add a design where the feature can be added to the platform interface and app-facing interface. | ||
|
|
||
| If this is only supported on a single platform, add where it can be added in the platform | ||
| implementation. | ||
|
|
||
| ### 4. Work can be started on the feature request or you can wait for feedback from a Flutter contributor. | ||
|
|
||
| [IMA SDKs]: https://developers.google.com/interactive-media-ads | ||
|
||
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.
Typo: plugins