OpenFlutter / flutter_screenutil

Flutter screen adaptation, font adaptation, get screen information
https://pub.dartlang.org/packages/flutter_screenutil
Apache License 2.0
3.88k stars 496 forks source link

Something is wrong with a scaling width and/or height factors #483

Closed nadrolinux closed 1 year ago

nadrolinux commented 1 year ago

Hi, I attached simple example (with a screenshot) where I see that something is wrong with a scaling. I run this example on Motorola Mote E from 2015 (resolution: 540x960). This is output from attached example executed on Moto E: I/flutter ( 8618): Device size: 360.0, 640.0 I/flutter ( 8618): bottomBarHeight: 0.0, statusBarHeight: 0.0 I/flutter ( 8618): Scale: 0.6666666666666666, 0.7291666666666666 I/flutter ( 8618): Values: 40.0, 43.75 As you can see a height scale is 0.7291666666666666, but should be 0.6666 and both "Values" should be 40.0, but height is 43.75. You can also check a screenshot eg. with a GIMP. White corners should have 60x60 pixels, but have 60x65 pixels.

It looks like a height scale is calculated from a much smaller value than 960 (~880). Maybe during calculation status/bottom bars "stolen" some pixels etc? I checked with and without Scaffold but results were the same.

For me it looks like a critical issue and I hope you will be able to fix it soon. Best regards,

sample.txt issue

nadrolinux commented 1 year ago

I found in the sources a following line: double get scaleHeight => (_splitScreenMode ? max(screenHeight, 700) : screenHeight) / _uiSize.height; I'm not sure why splitscreenmode mean max 700, because I didn't analyse sources too much. With splitscreenmode set to false scaling works fine. I think that it may be good to provide some documentation for this mode, because this option may be problematic as in my case and is set to 'true' in example from a README.md, thats why I set it to true before.