Created
July 31, 2018 00:30
-
-
Save bdiegel/81d0f4b7c13212048d4bcb15cb202de6 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