Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Flutter SafeArea

I am new to flutter and I was wondering if there is any way to only get the padding values of the SafeArea Widget without using it.
I only want some of my widgets to be affected by the padding and a complete SafeArea widget seems to overcomplicate everything.

Thanks in advance.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

MediaQuery with viewPadding do the trick, by using

MediaQuery.of(context).viewPadding

you can get padding informations (like app bar size…),
you can also check this medium article.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading