-
-
Save peerwaya/38091f2a005f74cffe2771115cfe1fd5 to your computer and use it in GitHub Desktop.
flutter - device pixel ratio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
queryData = MediaQuery.of(context); | |
double devicePixelRatio = queryData.devicePixelRatio; | |
'size (pixels): w=${queryData.size.width * devicePixelRatio}, h=${queryData.size.height * devicePixelRatio}' | |
'devicePixelRatio: $devicePixelRatio' | |
'size: w=${queryData.size.width}, h=${queryData.size.height}' | |
'textScaleFactor: w=${queryData.textScaleFactor}' | |
From example: | |
https://stackoverflow.com/questions/44173641/how-can-flutter-handle-dpi-text-and-image-size-differences |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment