Skip to content

Add Foldable support for modal routes#92909

Merged
fluttergithubbot merged 13 commits intoflutter:masterfrom
andreidiaconu:foldable_support_dialogs
Mar 8, 2022
Merged

Add Foldable support for modal routes#92909
fluttergithubbot merged 13 commits intoflutter:masterfrom
andreidiaconu:foldable_support_dialogs

Conversation

@andreidiaconu
Copy link
Contributor

@andreidiaconu andreidiaconu commented Nov 2, 2021

This PR makes modal routes and dialogs avoid overlapping display features. It also adds an anchorPoint parameter to methods used for showing dialogs, in order to make it easier to control where dialogs show up. In practical terms, it helps with displaying modals on only one of the screens on dual-screen foldables.

Here is an example of showing a dialog on one of the screens, instead of the middle of the screen (where the example device has a display feature):

hinge-aware-dialog-right

This is split from a larger PR for foldable support in order to make it easier to review (#77156).

Issues that will be fixed by this PR:

Depends on:

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

@flutter-dashboard flutter-dashboard bot added a: tests "flutter test", flutter_test, or one of our tests f: cupertino flutter/packages/flutter/cupertino repository f: material design flutter/packages/flutter/material repository. f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels. labels Nov 2, 2021
@google-cla google-cla bot added the cla: yes label Nov 2, 2021
@Piinks Piinks self-requested a review November 11, 2021 21:58
@Piinks Piinks added c: new feature Nothing broken; request for a new capability a: layout SystemChrome and Framework's Layout Issues labels Nov 11, 2021
@andreidiaconu andreidiaconu force-pushed the foldable_support_dialogs branch from 3fbdcff to 159c087 Compare February 3, 2022 13:02
@andreidiaconu andreidiaconu marked this pull request as ready for review February 3, 2022 18:37
@andreidiaconu
Copy link
Contributor Author

@Piinks Now that #92907 is merged, I rebased and gave it another look. This is now unblocked and I marked it as ready for review.

@Piinks
Copy link
Contributor

Piinks commented Feb 17, 2022

Awesome! Thank you, and apologies for the delay while I was OOO. Reviewing the last ones today.

Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

Looking good overall, I wonder though, is it necessary to always include the DisplayFeatureSubScreen widget if we are not using a foldable device? Can that widget only be added when it is relevant, rather than it always being in the tree?

@andreidiaconu
Copy link
Contributor Author

andreidiaconu commented Feb 18, 2022

Looking good overall, I wonder though, is it necessary to always include the DisplayFeatureSubScreen widget if we are not using a foldable device? Can that widget only be added when it is relevant, rather than it always being in the tree?

I could check if displayFeatures is empty and only wrap if it isn't. I could also add this check to DisplayFeatureSubScreen and make it return early. Are you asking for performance reasons?

MediaQueryData.displayFeatures can go from empty to having relevant data while dialogs are displayed on screen. This means that DisplayFeatureSubScreen needs to be part of the tree in order to react to those changes.

@skia-gold
Copy link

Gold has detected about 38 new digest(s) on patchset 28.
View them at https://flutter-gold.skia.org/cl/github/92909

Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

Flutter_LGTM

Thanks for splitting out the separate PR for pop up, moving on to that one now. :)

@Piinks
Copy link
Contributor

Piinks commented Mar 3, 2022

@goderbauer can you provide a secondary review?

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

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

LGTM after the comment about the doc is addressed.

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 10, 2022
ditman added a commit to ditman/flutter-packages that referenced this pull request Mar 10, 2022
Roll Flutter from 38dbbb1 to 0dfb656 (135 revisions)

flutter/flutter@38dbbb1...0dfb656

2022-03-10 [email protected] Roll Engine from bf2bf3a3fd2b to 6b1a24b1a108 (10 revisions) (flutter/flutter#99917)
2022-03-10 [email protected] Roll Plugins from eb6ad34 to 20e231b (8 revisions) (flutter/flutter#99913)
2022-03-10 [email protected] Roll Engine from 2c1816b39127 to bf2bf3a3fd2b (3 revisions) (flutter/flutter#99887)
2022-03-10 [email protected] Migrate NavigationRail to Material 3. (flutter/flutter#99171)
2022-03-10 [email protected] Remove expired ThemeData deprecations (flutter/flutter#98578)
2022-03-09 [email protected] Roll Engine from 09a11d137953 to 2c1816b39127 (3 revisions) (flutter/flutter#99878)
2022-03-09 [email protected] [ci.yaml] Remove unused benchmark property (flutter/flutter#99843)
2022-03-09 [email protected] [Material] Create an InkSparkle splash effect that matches the Material 3 ripple effect (flutter/flutter#99731)
2022-03-09 [email protected] Remove deprecated RenderEditable.onSelectionChanged (flutter/flutter#98582)
2022-03-09 [email protected] Marks Mac_ios post_backdrop_filter_perf_ios__timeline_summary to be flaky (flutter/flutter#99856)
2022-03-09 [email protected] Roll Engine from 6d7bcc9e577c to 09a11d137953 (3 revisions) (flutter/flutter#99870)
2022-03-09 [email protected] [tool] Add CADisableMinimumFrameDurationOnPhone to iOS templates (flutter/flutter#94509)
2022-03-09 [email protected] First pass at using platform abstraction for plugins (flutter/flutter#92672)
2022-03-09 [email protected] Fix `ColorScheme.shadow` to default to black even for dark themes. (flutter/flutter#99722)
2022-03-09 [email protected] Roll Engine from a0963f14b67d to 6d7bcc9e577c (3 revisions) (flutter/flutter#99847)
2022-03-09 [email protected] Updated tokens to v0.90. (flutter/flutter#99782)
2022-03-09 [email protected] Marks Mac_ios backdrop_filter_perf_ios__timeline_summary to be unflaky (flutter/flutter#99836)
2022-03-09 [email protected] updateEditingValueWithDeltas snippet docs fix (flutter/flutter#99570)
2022-03-09 [email protected] Roll Engine from 9362061fbb79 to a0963f14b67d (1 revision) (flutter/flutter#99838)
2022-03-09 [email protected] Roll Plugins from b906ea5 to eb6ad34 (9 revisions) (flutter/flutter#99828)
2022-03-09 [email protected] Update visibility of methods for internal use (flutter/flutter#98124)
2022-03-09 [email protected] Roll Engine from 621c88dc2d13 to 9362061fbb79 (6 revisions) (flutter/flutter#99809)
2022-03-09 [email protected] Roll Engine from 5c760759feca to 621c88dc2d13 (2 revisions) (flutter/flutter#99792)
2022-03-09 [email protected] Pass 'assume-initialize-from-dill-up-to-date' flag to the frontend server (flutter/flutter#99791)
2022-03-09 [email protected] remove unnecessary null check (flutter/flutter#99507)
2022-03-09 [email protected] Avoid calling `performLayout` when only the relayout boundary is different (flutter/flutter#99056)
2022-03-09 [email protected] Revert "Add the refresh rate fields to perf_test (#99710)" (flutter/flutter#99801)
2022-03-09 [email protected] Re-land removal of maxLengthEnforced deprecation (flutter/flutter#99787)
2022-03-09 [email protected] Add the refresh rate fields to perf_test (flutter/flutter#99710)
2022-03-09 [email protected] Remove tool crash git.io link shortener (flutter/flutter#99574)
2022-03-09 [email protected] 95533 min sdk error msgs enhancements (flutter/flutter#99550)
2022-03-08 [email protected] Remove deprecated OutlineButton (flutter/flutter#98546)
2022-03-08 [email protected] [flutter_tools] Fix Typo in tool error message (flutter/flutter#97793)
2022-03-08 [email protected] Handle hidden dot files in iOS framework bundles (flutter/flutter#99771)
2022-03-08 [email protected] Updated tokens to v0.88. (flutter/flutter#99568)
2022-03-08 [email protected] Revert "Remove deprecated CupertinoTextField, TextField, TextFormField maxLengthEnforced" (flutter/flutter#99768)
2022-03-08 [email protected] Add Foldable support for modal routes (flutter/flutter#92909)
2022-03-08 [email protected] Roll Plugins from 675f91b to b906ea5 (4 revisions) (flutter/flutter#99765)
2022-03-08 [email protected] Roll Engine from 0fed94d050b1 to 5c760759feca (1 revision) (flutter/flutter#99751)
2022-03-08 [email protected] Fix: Date picker interactive sample not loading  (flutter/flutter#99401)
2022-03-08 [email protected] Check string size before Win32 MultiByte <-> WideChar conversions (flutter/flutter#99729)
2022-03-08 [email protected] Roll Engine from 9c3f73864029 to 0fed94d050b1 (6 revisions) (flutter/flutter#99728)
2022-03-08 [email protected] Adds a Listview tile select example (flutter/flutter#99165)
2022-03-08 [email protected] Remove deprecated CupertinoTextField, TextField, TextFormField maxLengthEnforced (flutter/flutter#98539)
2022-03-08 [email protected] Roll Engine from 9e1594bd741f to 9c3f73864029 (2 revisions) (flutter/flutter#99721)
2022-03-08 49699333+dependabot[bot]@users.noreply.github.com Bump debian from bullseye-20220125-slim to bullseye-20220228-slim in /dev/ci/docker_linux (flutter/flutter#99708)
...
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 11, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: layout SystemChrome and Framework's Layout Issues a: tests "flutter test", flutter_test, or one of our tests c: new feature Nothing broken; request for a new capability f: cupertino flutter/packages/flutter/cupertino repository f: material design flutter/packages/flutter/material repository. f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants