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 ?
WidgetsBinding.instance.platformDispatcher.views.first.physicalSize work for me.
you can also try PlatformDispatcher.instance.views.first.physicalSize
You can use View.of(context) to get physicalSize, devicePixelRatio and viewPadding
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With