Skip to content

Conversation

@gspencergoog
Copy link
Contributor

Description

This updates the documentation for MediaQuery and Overlay to include the following:

  • That MediaQueryData.size is set asynchronously, and doesn't necessarily reflect the size of the current frame.
  • That the specific MediaQuery.sizeOf and related methods are preferred over the more generic MediaQuery.of.
  • That the size of the Overlay isn't necessarily the size returned by MediaQueryData.size

As well as adding some symbol links, and fixing some error in documentation.

Tests

  • Documentation only

@github-actions github-actions bot added the framework flutter/packages/flutter repository. See also f: labels. label Sep 28, 2023
Comment on lines 1235 to 1242
Copy link
Member

Choose a reason for hiding this comment

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

I think we should remove the async note for now. This will become relevant in a multi window world again, but we haven't fully decided how to implement this yet. It is possible that we will fake the size to be correct.

For now, you can actually assume that size is the size the frame will be rendered at.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, done.

Comment on lines 257 to 262
Copy link
Member

Choose a reason for hiding this comment

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

Let's undo this change, see note below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Member

Choose a reason for hiding this comment

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

remove the "a recent frame on", see below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
/// the [FlutterView] containing your app), you can use [MediaQuery.sizeOf] :
/// the [FlutterView] containing your app), you can use [MediaQuery.sizeOf]:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, fixed.

@gspencergoog gspencergoog force-pushed the update_media_query_docs branch from 2ce2eb0 to 4f40d06 Compare October 7, 2023 00:04
@github-actions github-actions bot added f: material design flutter/packages/flutter/material repository. f: cupertino flutter/packages/flutter/cupertino repository labels Oct 7, 2023
Copy link
Contributor Author

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

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

I also looked for other instances of MediaQuery.of and fixed them up to point to the specific attribute values instead. PTAL

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment on lines 257 to 262
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, fixed.

Comment on lines 1235 to 1242
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, done.

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

@gspencergoog gspencergoog added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 9, 2023
@auto-submit auto-submit bot merged commit a5e3e78 into flutter:master Oct 9, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 10, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Oct 10, 2023
flutter/flutter@f52fe4f...83134ac

2023-10-10 [email protected] Roll Flutter Engine from 2b3f9886fbf0 to 60e861dfe6b1 (1 revision) (flutter/flutter#136264)
2023-10-10 [email protected] Roll Flutter Engine from e354a13cfeab to 2b3f9886fbf0 (4 revisions) (flutter/flutter#136259)
2023-10-10 [email protected] Roll Packages from 7de08ec to 4b483f2 (8 revisions) (flutter/flutter#136258)
2023-10-10 [email protected] RenderAnnotatedRegion should dispose created layers. (flutter/flutter#136086)
2023-10-10 [email protected] TestClipPaintingContext should dispose ContainerLayer (flutter/flutter#135949)
2023-10-10 [email protected] Roll Flutter Engine from 9aa7cb057d22 to e354a13cfeab (1 revision) (flutter/flutter#136248)
2023-10-10 [email protected] Migrate the "Non-speed related performance issues" issue template to Github forms (flutter/flutter#135130)
2023-10-10 [email protected] Roll Flutter Engine from 171b4b26e68b to 9aa7cb057d22 (4 revisions) (flutter/flutter#136240)
2023-10-10 [email protected] Roll Flutter Engine from d094401acb99 to 171b4b26e68b (1 revision) (flutter/flutter#136235)
2023-10-10 [email protected] Roll Flutter Engine from 92880e9847b3 to d094401acb99 (1 revision) (flutter/flutter#136233)
2023-10-10 [email protected] Roll Flutter Engine from 51193f8f53eb to 92880e9847b3 (1 revision) (flutter/flutter#136232)
2023-10-09 [email protected] Roll Flutter Engine from 8f2fa3ceb8a0 to 51193f8f53eb (4 revisions) (flutter/flutter#136228)
2023-10-09 [email protected] Roll Flutter Engine from 73da593bac54 to 8f2fa3ceb8a0 (2 revisions) (flutter/flutter#136220)
2023-10-09 [email protected] [conductor] Remove PublishChannel and use MPA command (flutter/flutter#135884)
2023-10-09 [email protected] Roll Flutter Engine from 0966f62d7101 to 73da593bac54 (1 revision) (flutter/flutter#136216)
2023-10-09 [email protected] [leak-tracking] Add leak tracking in test/painting #1 (flutter/flutter#136167)
2023-10-09 [email protected] [leak-tracking] Cover testwidgets with leak tracking in test/gestures (flutter/flutter#136166)
2023-10-09 [email protected] Roll Flutter Engine from 81e5bf29dee4 to 0966f62d7101 (1 revision) (flutter/flutter#136215)
2023-10-09 [email protected] Roll Flutter Engine from 22ce5c6a45e2 to 81e5bf29dee4 (3 revisions) (flutter/flutter#136211)
2023-10-09 [email protected] [web] Fix `page up` `page down` `home` `end` shortcut behavior on web (flutter/flutter#135454)
2023-10-09 [email protected] Update `MediaQuery` documentation to highlight asynchronous nature of size (flutter/flutter#135719)
2023-10-09 [email protected] Reland "Adds a parent scope TraversalEdgeBehavior and fixes modal rouâ�¦ (flutter/flutter#134554)
2023-10-09 [email protected] Roll Flutter Engine from 429a242b0db6 to 22ce5c6a45e2 (1 revision) (flutter/flutter#136205)
2023-10-09 [email protected] Roll Packages from e578a16 to 7de08ec (4 revisions) (flutter/flutter#136202)
2023-10-09 [email protected] Roll Flutter Engine from 664f5e833871 to 429a242b0db6 (2 revisions) (flutter/flutter#136201)

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
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Mairramer pushed a commit to Mairramer/flutter that referenced this pull request Oct 10, 2023
… size (flutter#135719)

## Description

This updates the documentation for `MediaQuery` and `Overlay` to include the following:

- That `MediaQueryData.size` is set asynchronously, and doesn't necessarily reflect the size of the current frame.
- That the specific `MediaQuery.sizeOf` and related methods are preferred over the more generic `MediaQuery.of`.
- That the size of the `Overlay` isn't necessarily the size returned by `MediaQueryData.size`

As well as adding some symbol links, and fixing some error in documentation.

## Tests
 - Documentation only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App f: cupertino flutter/packages/flutter/cupertino repository f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants