Foldable support & TwoPane Widget#77156
Foldable support & TwoPane Widget#77156andreidiaconu wants to merge 19 commits intoflutter:masterfrom
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
Thanks for the PR. Unfortunately, this PR is in many aspects not following our style guide (see also https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo). Most of the issues are also pointed out by the analyzer ( |
|
@goderbauer Yes. Will ping you when this is higher quality and also has tests. |
|
OK, marking this as draft for now. |
|
This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
Some overall feedback from scanning through the code: It would be good to keep this a little more generic. The Dialogs and Pop-ups for example need to avoid all kinds of display obstructions and the API shouldn't assume that these obstructions divide the rendering space into two "screens" (not all obstructions will do). So, having a Also, the TwoPane seems pretty specific to certain phone hardware and its also pretty independent of the framework. That widget may be best distributed as part of an external package. |
|
I see your point on dialogs and will give the anchorPoint a try. I think it
is a good idea, but wonder if it complicates the api more than needed.
Renaming screen to safeArea would be less specific to dual screen form
factors.
TwoPane indeed helps with dual screen devices a lot, but is meant to easily
scale up the same layout to tablets, desktop and web. This is why I don’t
see it as a dual screen specific layout, but rather as a basic building
block that happens to work well on that form factor.
…On Wed, 17 Mar 2021 at 18:13, Michael Goderbauer ***@***.***> wrote:
Some overall feedback from scanning through the code: It would be good to
keep this a little more generic. The Dialogs and Pop-ups for example need
to avoid all kinds of display obstructions and the API shouldn't assume
that these obstructions divide the rendering space into two "screens" (not
all obstructions will do). So, having a screen argument doesn't seem
ideal. As an idea, maybe we could have an anchorPoint argument instead that
specifies if the dialog cannot be rendered at its natural point (e.g. due
to obstructions) it is pulled towards that point to stay clear of those
obstructions. The point the user touched on screen to trigger the dialog
could be used as a natural anchor point for most use cases, presumably. If
no anchor point is provided, we'd use a heuristic to avoid obstructions
(e.g. prefer higher over lower, prefer the leading edge over the trailing
edge, etc).
Also, the TwoPane seems pretty specific to certain phone hardware and its
also pretty independent of the framework. That widget may be best
distributed as part of an external package.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#77156 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKWJPU2FBV34NKSSSF72VTTEDIJLANCNFSM4YRSE4EA>
.
|
|
@goderbauer The code is now in line with the style guide and gives no messages during For now I just wanted to let you know that your concerns were addressed, in case you want to give this another look and provide any other feedback. |
…port # Conflicts: # packages/flutter/lib/src/material/bottom_sheet.dart # packages/flutter/lib/src/material/date_picker.dart # packages/flutter/lib/src/material/popup_menu.dart # packages/flutter/lib/src/widgets/routes.dart
3b8080a to
9587c46
Compare
…port # Conflicts: # packages/flutter/lib/src/widgets/media_query.dart # packages/flutter/test/widgets/media_query_test.dart
|
@goderbauer I would like to offer an update on this PR:
The current status for this PR is that we are waiting for the Engine PR to be merged, but the code is ready for review, in case we want to speed things along in the meantime. I will gladly address any feedback I get, as I already did up to this point. |
|
PTAL @goderbauer |
…port # Conflicts: # packages/flutter/test/material/bottom_sheet_test.dart
|
I believe this PR would be easier to review, land, and (if necessary) revert if it were split up into multiple PRs, one per feature listed in the bullet list in the PR's description. |
|
Ok, I will split this into multiple PRs. |
|
@andreidiaconu Any updates on this? |
Yes, the Engine changes are now able to make progress #89511 and once those are merged, focus moves to this. Also, I am breaking ths PR into smaller, more focused ones this week. |
…port # Conflicts: # packages/flutter/lib/src/material/time_picker.dart # packages/flutter/test/material/bottom_sheet_test.dart
|
Here are the PRs that were split from this:
Edit: And they can be reviewed in that order. The first one would be #92906 since all the other depend on it. Everything still depends on getting the Engine support merged:
@blasten @goderbauer I am closing this PR as it is now replaced by 4 other smaller PRs. |
This is based on the Engine support for Display Features: flutter/engine#24756
A display feature is an area of the display that is obstructed by a hardware feature. For now, this works only on Android. There are three types of display features:
Here is a preview of what this PR enables, on a dual-screen emulator:
Issues that will be closed by this PR:
Work in progress: