Container
Container is a widget in Flutter that allows you to create a rectangular visual element that can contain other widgets. It provides a way to customize the look and feel of its child widget(s) by setting properties such as padding, margin, color, shape and more.
Here's an example of how to use Container widget in Flutter:
Container(
width: 100,
height: 100,
color: Colors.blue,
child: Text("Hello World!"),
);In this example, we are creating a blue colored Container of width and height 100 pixels, with the child being a Text widget with the text "Hello World!".
Attributes
width: The width of the container.
height: The height of the container.
color: The background color of the container.
padding: The space between the container's border and its child widget(s).
margin: The space between the container's border and its parent widget.
decoration: ABoxDecorationobject that specifies the container's visual appearance, including its background color, border, and shadow.
alignment: The position of the container's child widget(s) within the container.
constraints: The minimum and maximum width and height that the container's child widget(s) can occupy.