Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I always use a SafeArea at the top level of my flutter screens?

Tags:

flutter

I am curious if I should always use a SafeArea widget at the top level of my screen. I mean....when would I want my content blocked by things like a notch? For me it seems like the answer is never.

So should I not just use SafeArea on every page? If so, should it be above or below the Scaffold widget?

like image 327
Scorb Avatar asked Jan 26 '26 00:01

Scorb


1 Answers

You don't have to use SafeArea on every screen. It actually depends if an AppBar is used or not, because the AppBar automatically calculates the values and adds the required padding.

If you use it above a Scaffold the area where the padding is applied would be black. On the other hand, if you use it below the Scaffold the color of the area would depend on the app theme, probably the Scaffold background color.

like image 191
Toni Avatar answered Jan 28 '26 16:01

Toni