TechnoUrmish / Sizer

A flutter plugin for Easily make Flutter apps responsive. Automatically adapt UI to different screen sizes. Responsiveness made simple.
MIT License
240 stars 73 forks source link

Wrong value for Height and Width on Flutter build desktop #27

Open fahmi277 opened 3 years ago

fahmi277 commented 3 years ago

Hello dev,

I try to check screen size with SizerUtil.height and SizerUtil.width, but the value is wrong. i use 15" device

image

please help to fix, thanks

Fahmi

rehman-00001 commented 2 years ago

This code here is the reason for the bug I think:

util.dart

    if (orientation == Orientation.portrait) {
      width = boxConstraints.maxWidth;
      height = boxConstraints.maxHeight;
    } else {
      width = boxConstraints.maxHeight;
      height = boxConstraints.maxWidth;
    }

Not sure what was the author's intention behind this.

hatch01 commented 1 year ago

I made a pull request to fix this : #58