I am looking at the documentation and apparently I can use platformDispatcher
to get some data, however I can`t seem to get the following attributes :
ui.window.devicePixelRatio
ui.window.physicalSize
ui.window.viewPadding
Any idea where I can get without using a context ?
2
Answers
You can use
View.of(context)
to getphysicalSize
,devicePixelRatio
andviewPadding
WidgetsBinding.instance.platformDispatcher.views.first.physicalSize
work for me.you can also try
PlatformDispatcher.instance.views.first.physicalSize