You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add height and width aspects to MediaQuery. #167828
In many places in Flutter apps, we only need one screen dimension (height or width). To get it we have to call MediaQuery.sizeOf(context).height or MediaQuery.sizeOf(context).width. This causes the widget to rebuild whenever any property of the size changes, even if we only care about one dimension. That's not ideal.
After checking the Flutter repo, I noticed that 14 out of 28 calls to sizeOf use just one dimension. So this seems like a fairly common pattern.
Proposal
I'd like to propose adding four static functions to MediaQuery:
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
Add height and width aspects to MediaQuery. (#167829)
Add height and width aspects to MediaQuery. (flutter#167829)
github-actions commentedon May 20, 2025
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.