Is there any differences between `MediaQuery.of(context).size` and `WidgetsBinding.instance.window.physicalSize`?

Viewed 43

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.

1 Answers

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.

Related