Recall & Review
beginner
What is a Container widget in Flutter?
A Container widget is a box that can hold a child widget. It lets you add padding, margins, borders, background color, and size to that child.
Click to reveal answer
beginner
How do you add space inside a Container around its child?
Use the
padding property to add space inside the Container around its child widget.Click to reveal answer
beginner
Which property of Container controls its background color?
The
color property sets the background color of the Container.Click to reveal answer
intermediate
What happens if you set both
width and height in a Container?The Container will have the fixed size you set with
width and height, regardless of its child's size.Click to reveal answer
intermediate
How can you add rounded corners to a Container?
Use the
decoration property with BoxDecoration and set borderRadius to add rounded corners.Click to reveal answer
Which property of Container adds space outside the Container?
✗ Incorrect
Margin adds space outside the Container, separating it from other widgets.
What type of widget can a Container hold inside it?
✗ Incorrect
Container can hold any single widget as its child. To hold multiple widgets, use a layout widget like Column.
How do you make a Container have a circular shape?
✗ Incorrect
To make a Container circular, set equal width and height and use borderRadius with half that size.
Which property lets you add a border to a Container?
✗ Incorrect
Borders are added inside the decoration property using BoxDecoration's border property.
If you want a Container to fill all available space, what should you do?
✗ Incorrect
Setting width and height to double.infinity makes the Container expand to fill available space.
Explain how you would use a Container widget to add padding, background color, and rounded corners around a Text widget.
Think about how Container wraps a child and how decoration customizes appearance.
You got /4 concepts.
Describe the difference between padding and margin in the context of a Container widget.
Imagine putting a box inside another box and spacing around or inside it.
You got /3 concepts.