Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
/pluginsPublic archive

Implement Android WebView api with pigeon (Dart portion)#4435

Merged
bparrishMines merged 11 commits intoflutter:masterfrom
bparrishMines:webview_pigeon_dart
Oct 26, 2021
Merged

Implement Android WebView api with pigeon (Dart portion)#4435
bparrishMines merged 11 commits intoflutter:masterfrom
bparrishMines:webview_pigeon_dart

Conversation

@bparrishMines
Copy link
Contributor

@bparrishMinesbparrishMines commentedOct 18, 2021
edited
Loading

Implements theAndroid WebView library that is currently supported with pigeon.

Pre-launch Checklist

  • I read theContributor Guide and followed the process outlined there for submitting PRs.
  • I read theTree Hygiene wiki page, which explains my responsibilities.
  • I read and followed therelevant style guides and ranthe auto-formatter. (Note that unlike the flutter/flutter repo, the flutter/plugins repo does usedart format.)
  • I signed theCLA.
  • 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.
  • Iupdated pubspec.yaml with an appropriate new version according to thepub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I updated/added relevant documentation (doc comments with///).
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test exempt.
  • All existing and new tests are passing.

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

@github-actionsgithub-actionsbot added p: webview_flutterEdits files for a webview_flutter plugin platform-android labelsOct 18, 2021
@bparrishMinesbparrishMines changed the titleadd dart filesImplement Android WebView api with pigeon (Dart portion)Oct 18, 2021
@bparrishMines
Copy link
ContributorAuthor

@mvanbeusekom@cyanglaz This PR is mostly documentation and code generation. Could you just take a look at:
packages/webview_flutter/webview_flutter_android/lib/src/android_webview.dart
packages/webview_flutter/webview_flutter_android/lib/src/android_webview_api_impls.dart
packages/webview_flutter/webview_flutter_android/lib/src/instance_manager.dart
packages/webview_flutter/webview_flutter_android/test/android_webview_test.dart
packages/webview_flutter/webview_flutter_android/test/instance_manager_test.dart

@bparrishMines
Copy link
ContributorAuthor

@gaaclarke Could you take a look at the pigeon api?:
packages/webview_flutter/webview_flutter_android/pigeons/android_webview.dart and
packages/webview_flutter/webview_flutter_android/generatePigeons.sh

Copy link
Contributor

@mvanbeusekommvanbeusekom left a comment
edited
Loading

Choose a reason for hiding this comment

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

Looks good overall, however I have one remark/ question:

I notice that it is common to put multiple classes into the same file. Personally I always like to split out classes into their own files as much as possible. Keeping multiple classes in the same file makes it more difficult to oversee the whole solution and to find the code I need (maybe this is personal and I should just learn to live with it). Another reason is that it is much harder to enforce certain design principles. In Dart it is perfectly legal to access private class members when both classes are in the same file. This would allow people to call into classes directly where they are not supposed to, creating dependency violations (a good example in my opinion would be the circular dependency between theWebView class and theWebSettings class).

What is the policy within the Flutter team regarding this? I see this happening quite often, although not everywhere (google_maps_flutter_platform_interface is a good example which splits everything into separate files).

@gaaclarke
Copy link
Member

@gaaclarke Could you take a look at the pigeon api?:packages/webview_flutter/webview_flutter_android/pigeons/android_webview.dart andpackages/webview_flutter/webview_flutter_android/generatePigeons.sh

Beautiful, lgtm. Hey, I don't understand why you aren't also generating and using the java code? I don't imagine it's much useful to just have the Dart code.

@bparrishMines
Copy link
ContributorAuthor

@mvanbeusekom According toEffective Dart, it seems to be up to personal preference and whatever is the current style of a plugin. I don't think we have a repo wide policy, butwebview_flutter already goes along with this style inhttps://github.com/flutter/plugins/blob/master/packages/webview_flutter/webview_flutter/lib/src/webview.dart.

I prefer putting related classes in the same file due to

  1. Effective Dart rationale.
  2. All classes inandroid_webview.dart are a part of theAndroid WebView Java library.
  3. The lifecycle of each class depends on aWebView instance.WebView is responsible for callingprivate/@visibleForTesting methods that create and dispose instances. (e.g.WebView.setWebViewClient).

As a side note: I also had the problem of finding the code I needed when coding, but I started usingcommand+N to search by class when using Android Studio. Which made it alot easier for me.

mvanbeusekom reacted with thumbs up emoji

@bparrishMines
Copy link
ContributorAuthor

@gaaclarke My goal was to do the entire Java side in the next PR because it will probably be another 1000 lines of code to review. It would also be hard to add any running code now because I think putting the plugin in a state that uses method channels and pigeon would put the plugin in a weird state that could cause bugs.

Copy link
Contributor

@mvanbeusekommvanbeusekom left a comment

Choose a reason for hiding this comment

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

LGTM

@bparrishMinesbparrishMines added the waiting for tree to go green(Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land. labelOct 21, 2021
NickalasB added a commit to NickalasB/plugins that referenced this pull requestOct 27, 2021
* master:  Implement Android WebView api with pigeon (Java portion) (flutter#4441)  [in_app_purchase] Update to the latest pkg:json_serializable (flutter#4434)  Implement Android WebView api with pigeon (Dart portion)  (flutter#4435)  upgraded usage of BinaryMessenger (flutter#4451)  [flutter_plugin_tools] Fix pubspec-check on Windows (flutter#4428)  Use OpenJDK 11 in CI jobs  (flutter#4419)  [google_sign_in] remove the commented out code in tests (flutter#4442)
NickalasB added a commit to NickalasB/plugins that referenced this pull requestOct 27, 2021
* master:  Implement Android WebView api with pigeon (Java portion) (flutter#4441)  [in_app_purchase] Update to the latest pkg:json_serializable (flutter#4434)  Implement Android WebView api with pigeon (Dart portion)  (flutter#4435)  upgraded usage of BinaryMessenger (flutter#4451)  [flutter_plugin_tools] Fix pubspec-check on Windows (flutter#4428)  Use OpenJDK 11 in CI jobs  (flutter#4419)  [google_sign_in] remove the commented out code in tests (flutter#4442)
hofmannfelix pushed a commit to hofmannfelix/plugins that referenced this pull requestOct 30, 2021
…ideo_src_on_same_controller* commit '76e84c0679dbab7bfaaaa553b17bb0dbdb9a3c33': (537 commits)  [video_player] Initialize player when size and duration become available (flutter#4438)  [webview_flutter] Implement zoom enabled for ios and android (flutter#4417)  Partial revert of "upgraded usage of BinaryMessenger (flutter#4451)" (flutter#4453)  Implement Android WebView api with pigeon (Java portion) (flutter#4441)  [in_app_purchase] Update to the latest pkg:json_serializable (flutter#4434)  Implement Android WebView api with pigeon (Dart portion)  (flutter#4435)  upgraded usage of BinaryMessenger (flutter#4451)  [flutter_plugin_tools] Fix pubspec-check on Windows (flutter#4428)  Use OpenJDK 11 in CI jobs  (flutter#4419)  [google_sign_in] remove the commented out code in tests (flutter#4442)  [webview] Fix typos in the README (flutter#4249)  [google_sign_in] add serverAuthCode to GoogleSignInAccount (flutter#4180)  [ci] Update macOS Cirrus image to Xcode 13 (flutter#4429)  [shared_preferences] Switch to new analysis options (flutter#4384)  [flutter_plugin_android_lifecycle] remove placeholder dart file (flutter#4413)  [camera] Run iOS methods on UI thread by default (flutter#4140)  [ci] Always run all `format` steps (flutter#4427)  [flutter_plugin_tools] Fix license-check on Windows (flutter#4425)  [google_maps_flutter] Clean Java test, consolidate Marker example. (flutter#4400)  [image_picker][android] suppress unchecked warning (flutter#4408)  ...# Conflicts:#packages/video_player/video_player/pubspec.yaml#packages/video_player/video_player_web/lib/video_player_web.dart#packages/video_player/video_player_web/pubspec.yaml
amantoux pushed a commit to amantoux/plugins that referenced this pull requestDec 11, 2021
KyleFin pushed a commit to KyleFin/plugins that referenced this pull requestDec 21, 2021
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@cyanglazcyanglazAwaiting requested review from cyanglaz

@gaaclarkegaaclarkeAwaiting requested review from gaaclarke

1 more reviewer

@mvanbeusekommvanbeusekommvanbeusekom approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

cla: yesp: webview_flutterEdits files for a webview_flutter pluginplatform-androidwaiting for tree to go green(Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@bparrishMines@gaaclarke@mvanbeusekom

Comments


[8]ページ先頭

©2009-2026 Movatter.jp