1

The following two:

  1. MediaQuery.of(context).size
  2. WidgetsBinding.instance.window.physicalSize / binding.window.devicePixelRatio

Do they have differences, or are they always equivalent?

I have checked the doc without useful information.

ch271828n
  • 15,854
  • 5
  • 53
  • 88

1 Answers1

1

How to Determine Screen Height and Width

According to ertgrull's answer on this post, it seems that the first option to your question returns logical pixels, while the second returns physical pixels.

You could read up more on the link that he posted together with his answer.

NewbieCody
  • 39
  • 6