SafeArea
SafeArea() is a widget in Flutter that allows developers to avoid having their content cut off by device bezels, notches, or other forms of physical hardware. SafeArea ensures that your content remains within a designated "safe area" of the device screen.
For example:
SafeArea(
child: Container(
height: 200,
width: 200,
color: Colors.blue,
),
);Parameters
Some common parameters for SafeArea() include:
- child: The widget to be displayed within the safe area.
- left: A boolean value indicating whether the left edge of the widget should be protected.
- top: A boolean value indicating whether the top edge of the widget should be protected.
- right: A boolean value indicating whether the right edge of the widget should be protected.
- bottom: A boolean value indicating whether the bottom edge of the widget should be protected.
- minimum: An EdgeInsets object specifying the minimum distance between the widget and the edges of the safe area.