How to get status bar height in Flutter?

0

Issue

How do I get the status bar height?

enter image description here

Solution

var height = MediaQuery.of(context).viewPadding.top;

Note: This will only work on mobile devices because other platforms don’t have a dedicated status bar and it will returns 0.0 for them.

Answered By – iDecode

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More