skip to Main Content

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


  1. You can use View.of(context) to get physicalSize, devicePixelRatio and viewPadding

    Login or Signup to reply.
  2. WidgetsBinding.instance.platformDispatcher.views.first.physicalSize work for me.
    you can also try PlatformDispatcher.instance.views.first.physicalSize

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search