How to get the ScreenSize from a Flutter App for Windows Desktop?

Viewed 960

WidgetsBinding.instance.window.physicalSize.width / WidgetsBinding.instance.window.physicalSize.height; is 1024.0*1898.0,

and DesktopWindow.getWindowSize(); is Size(0.0, 0.0)

on a 4K monitor.

How can I get the real screen size? (should be 2160*3840)

2 Answers

You can use Media Query

MediaQuery.of(context).size.height
Related