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)
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)
Currently getting the screen size requires a plugin, such as window_size.
With window_size, getScreenList() or getCurrentScreen() will give you screen information, including size.
You can use Media Query
MediaQuery.of(context).size.height
you can try screen_retriever plugin。
Display primaryDisplay = await screenRetriever.getPrimaryDisplay();
debugPrint("primaryDisplay.size: ${primaryDisplay.size}");
debugPrint("primaryDisplay.visibleSize: ${primaryDisplay.visibleSize}");