Labs ICT
⭐ Pro Login

Container and Padding

Wrapping and spacing your widgets.

1 min read | Flutter Tutorial
⭐

Want the full learning experience?

Get structured courses, certificates, projects, and instructor support with LabsICT Pro.

Explore Pro Courses

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'),
)