tguerin / newton

An Easy To Use Particle Emitter
https://newton.7omtech.fr
MIT License
22 stars 7 forks source link

use MediaQuery.sizeOf #13

Closed Joshix-1 closed 9 months ago

Joshix-1 commented 9 months ago

the MediaQuery docs say https://api.flutter.dev/flutter/widgets/MediaQuery-class.html

For example, to learn the size of the current media (e.g., the window containing your app), you can use MediaQuery.sizeOf: MediaQuery.sizeOf(context).

Querying the current media using specific methods (for example, MediaQuery.sizeOf and MediaQuery.paddingOf) will cause your widget to rebuild automatically whenever the property you query changes.

On the other hand, querying using MediaQuery.of will cause your widget to rebuild automatically whenever any field of the MediaQueryData changes (e.g., if the user rotates their device). Therefore, if you are only concerned with one or a few fields of MediaQueryData, prefer using the specific methods (for example: MediaQuery.sizeOf and MediaQuery.paddingOf).

netlify[bot] commented 9 months ago

Deploy Preview for imaginative-palmier-d7ee2c canceled.

Name Link
Latest commit ff00bce30156d781a9b2ceac900e1c3f02b56140
Latest deploy log https://app.netlify.com/sites/imaginative-palmier-d7ee2c/deploys/651a71bc629d680008401cee