This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[webview_flutter] Add new entrypoint that uses hybrid composition on Android #2883
[webview_flutter] Add new entrypoint that uses hybrid composition on Android #2883
Changes from 2 commits
e8f8ad8
6a5927d
8e90cc3
da2a0b9
bdd7f2e
1cef7c0
24533ed
29d2b88
7c30a7e
6185138
c82be0a
28faa1a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I don't think it has slower performance necessarily. It depends on what is being measured and how relevant that is.
For example, this mode makes the webview itself much faster. The Flutter UI might be slower, but only on devices below Android 10. Only while the webview is rendered, and Flutter is producing a ton of frames. e.g. animations. That's really it. For the most part, these are pretty good trade-off for webview.
I'd change this description to point out that it's an experimental feature that appends the webview to the Android view hierarchy for better performance and compatibility.
That's it for now. Let me know what you think.
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.
Also, re: unpredictable bug. This is true for any new features, and it's definitely true for the current webview, which is the motivation behind this feature anyways. I think I will rephrase it as "this mode fixes many issues while interacting with the Android webview. For more, see flutter/flutter#61133"
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.
What do you think about a separate
.dart
file that has this feature on by default? This way, we have aBUILD
target that automatically adds the metadata to the Android Manifest.@mehmetf do you have any preference about how to add this feature?
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.
I tried this out, but this file has a lot of private methods/constructors that needed to be copy pasted to the new file. I went with a different approach and decided just create to a new
WebViewPlatform
implementation that extendsAndroidWebView
. So, now all a user needs to do is:WebView.platform = SurfaceAndroidWebView()
. What are your thoughts on that approach?