Container and Padding
Container wraps content with padding, margin, borders, and colors. It's like a box you can style. Padding adds space inside the container, while margin adds space outside. SizedBox creates empty space of a specific size.
Container(
padding: EdgeInsets.all(16),
margin: EdgeInsets.all(8),
decoration: BoxDecoration(
color: Colors.blue,
borderRadius: BorderRadius.circular(10),
),
child: Text('Hello, Container!'),
)
SizedBox(
width: 100,
height: 50,
child: Text('Fixed size'),
)
Try it Yourself ->