Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
c68fd6a3
Unverified
Commit
c68fd6a3
authored
May 29, 2022
by
Bruno Leroux
Committed by
GitHub
May 29, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add troubleshooting doc for MediaQueryData.size (#104828)
parent
64b08f3c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
media_query.dart
packages/flutter/lib/src/widgets/media_query.dart
+17
-0
No files found.
packages/flutter/lib/src/widgets/media_query.dart
View file @
c68fd6a3
...
...
@@ -159,6 +159,23 @@ class MediaQueryData {
/// pixels are the size of the actual hardware pixels on the device. The
/// number of physical pixels per logical pixel is described by the
/// [devicePixelRatio].
///
/// ## Troubleshooting
///
/// It is considered bad practice to cache and later use the size returned
/// by `MediaQuery.of(context).size`. It will make the application non responsive
/// and might lead to unexpected behaviors.
/// For instance, during startup, especially in release mode, the first returned
/// size might be (0,0). The size will be updated when the native platform
/// reports the actual resolution.
///
/// See the article on [Creating responsive and adaptive
/// apps](https://docs.flutter.dev/development/ui/layout/adaptive-responsive)
/// for an introduction.
///
/// See also:
///
/// * [FlutterView.physicalSize], which returns the size in physical pixels.
final
Size
size
;
/// The number of device pixels for each logical pixel. This number might not
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment