-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[webview_flutter_android] feat: Expose setUseWideViewPort on Android (#106999) #9151
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
[webview_flutter_android] feat: Expose setUseWideViewPort on Android (#106999) #9151
Conversation
This may break some people; see flutter/flutter#93125 for example. |
Thank you for the intels.
That's true, what exactly should be the next steps? I also tried to reproduce your linked issue, but couldn't as the linked site was reworked and doesn't show this problem any more.
|
I think these are good arguments for switching the default back. And clients will have the escape hatch of the new setting if they really need the other behavior. Thanks for the analysis! Since the initial change wasn't a major version change, and as you point out this is likely not going to affect most clients, we don't need to do a major version change to switch it back IMO. |
Thank you for the fast reply. Should I leave the viewport meta example in the example project? Or is it also desired to be adapted in the |
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.
@Gustl22 The example apps are mostly used for maintainers to test things manually. Since this flag is unique to Android, I think you should move the changes you made in webview_flutter
example to webview_flutter_android
example.
@bparrishMines Thank you for the review. I moved the example to the android project, although I think it is good to have it in the main project to be able to compare the behavior with ios (as there is no such setting). But it might doesn't matter much in the end. Also tweaked the changelog a bit. |
…se-wide-screen # Conflicts: # packages/webview_flutter/webview_flutter_android/CHANGELOG.md
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.
LGTM
@stuartmorgan-g for secondary review
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.
LGTM
flutter/packages@2dff621...58d4016 2025-05-16 [email protected] [webview_flutter_android] feat: Expose setUseWideViewPort on Android (#106999) (flutter/packages#9151) 2025-05-15 [email protected] Roll Flutter from 0b9f928 to 9a78af5 (26 revisions) (flutter/packages#9259) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…(#106999) (flutter#9151) The option to set whether the webview should use the wide viewport should be available. Also the default is changed to false, because this is the expected behavior on Android devices: https://developer.android.com/develop/ui/views/layout/webapps/targeting On iOS also the default behavior is to NOT use wide viewport, so this is aligned. > Note: When your page is rendered in a WebView, it doesn't use wide viewport mode by default. You can enable wide viewport mode with setUseWideViewPort(). This also partically solves flutter/flutter#106999, as then the correct height is returned from `document.documentElement.scrollHeight;` property. *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
…(#106999) (flutter#9151) The option to set whether the webview should use the wide viewport should be available. Also the default is changed to false, because this is the expected behavior on Android devices: https://developer.android.com/develop/ui/views/layout/webapps/targeting On iOS also the default behavior is to NOT use wide viewport, so this is aligned. > Note: When your page is rendered in a WebView, it doesn't use wide viewport mode by default. You can enable wide viewport mode with setUseWideViewPort(). This also partically solves flutter/flutter#106999, as then the correct height is returned from `document.documentElement.scrollHeight;` property. *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
The option to set whether the webview should use the wide viewport should be available.
Also the default is changed to false, because this is the expected behavior on Android devices:
https://developer.android.com/develop/ui/views/layout/webapps/targeting
On iOS also the default behavior is to NOT use wide viewport, so this is aligned.
This also partically solves flutter/flutter#106999, as then the correct height is returned from
document.documentElement.scrollHeight;
property.If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.