#1 SafeArea (Flutter Widget of the Week)

Tram Ho

Designed on mobile devices (both Android and iOS) to have extra borders (this part can be understood as the status bar) – also known as system intrusions. The main reason for this design is that manufacturers are always trying to find ways to create new designs by changing the elements placed here. So this part it occupies a part of the area in your application. By default when you build the interface, it will overlap this status bar, Flutter provides a widget that you can solve this, which is SafeArea Widget.

1. What?

You simply wrap your main layout by the SafeArea widget, the entire layout you write in it will be below or in other words starting right below the status bar.

bottomAvoid system intrusions at the bottom of the screen
leftAvoid system intrusions on the left of the screen
topAvoid system intrusions at the top of the screen (status bar)
rightAvoid system intrusions on the right of the screen
childContains widget widgets, usually the main layout
minimumMinimum padding is applied
maintainBottomViewPaddingSpecifies whether SafeArea should maintain viewpadding instead of padding when used by MediaQuery’s viewInsets, the default value is false.

2. Wondering how it workds?

Here is an example

And this is the result

Example 2: Previous:


3. Explanation

In short, SafeArea is simply to serve the same purpose as above, no other purpose, it’s too simple to understand and implement.

Some more examples:


Share the news now

Source : Viblo