-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Update MediaQuery documentation to highlight asynchronous nature of size
#135719
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
Update MediaQuery documentation to highlight asynchronous nature of size
#135719
Conversation
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 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.
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.
Okay, done.
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.
Let's undo this change, see note below.
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.
Done
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.
remove the "a recent frame on", see below.
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.
Done
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.
nit:
| /// the [FlutterView] containing your app), you can use [MediaQuery.sizeOf] : | |
| /// the [FlutterView] containing your app), you can use [MediaQuery.sizeOf]: |
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.
Thanks, fixed.
2ce2eb0 to
4f40d06
Compare
gspencergoog
left a comment
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 also looked for other instances of MediaQuery.of and fixed them up to point to the specific attribute values instead. PTAL
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.
Done
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.
Done
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.
Thanks, fixed.
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.
Okay, done.
goderbauer
left a comment
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/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
… 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
Description
This updates the documentation for
MediaQueryandOverlayto include the following:MediaQueryData.sizeis set asynchronously, and doesn't necessarily reflect the size of the current frame.MediaQuery.sizeOfand related methods are preferred over the more genericMediaQuery.of.Overlayisn't necessarily the size returned byMediaQueryData.sizeAs well as adding some symbol links, and fixing some error in documentation.
Tests