-2

How to get the screen's (or pixel's) physical width and height in flutter? is it possible?

I need to display exactly 1 cm on different screens programaticly

Thanks.

Nyuszi
  • 1
  • 2
  • Does this answer your question? [Get physical size of screen in flutter](https://stackoverflow.com/questions/59707923/get-physical-size-of-screen-in-flutter) – Md. Yeasin Sheikh Jun 17 '22 at 14:56

1 Answers1

0

You can use:

MediaQuery.of(context).size

 /// The size of the media in logical pixels (e.g, the size of the screen).
  ///
  /// Logical pixels are roughly the same visual size across devices. Physical
  /// pixels are the size of the actual hardware pixels on the device. The
  /// number of physical pixels per logical pixel is described by the
  /// [devicePixelRatio].
Captivity
  • 279
  • 5
  • 21
  • It is not a helpful answer. I asked for the physical dimensions not for pixel counts. I need to display exactly 1 cm on different screens programaticly. – Nyuszi Jun 17 '22 at 14:54
  • Do you try that lib https://pub.dev/packages/sized_context ? – Captivity Jun 17 '22 at 14:58