0
0
Fluttermobile~5 mins

Container widget in Flutter - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
Amargin
Bpadding
Ccolor
Dchild
What type of widget can a Container hold inside it?
AOnly Text widgets
BOnly Image widgets
CMultiple widgets directly
DAny single widget
How do you make a Container have a circular shape?
AUse padding equal to width
BSet color to circular
CSet width and height equal and use borderRadius with half the size
DSet margin to circle
Which property lets you add a border to a Container?
Adecoration with BoxDecoration and border
BborderRadius
Ccolor
Dpadding
If you want a Container to fill all available space, what should you do?
AUse padding
BSet width and height to double.infinity
CSet color to fill
DSet margin to zero
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.