Recall & Review
beginner
What is the purpose of the
SizedBox widget in Flutter?The
SizedBox widget is used to create a box with a fixed width and height. It can add empty space or force a widget to have a specific size.Click to reveal answer
beginner
How does the
Padding widget affect its child widget?The
Padding widget adds empty space around its child inside the parent widget, pushing the child inward by the specified padding values.Click to reveal answer
beginner
Which property of
SizedBox controls its width and height?The
width and height properties control the size of the SizedBox. You can set either or both to fix the size.Click to reveal answer
beginner
Can
Padding be used without a child widget?No,
Padding requires a child widget to apply padding around. Without a child, it has no visible effect.Click to reveal answer
intermediate
What is the difference between
SizedBox and Padding?SizedBox sets a fixed size or empty space, while Padding adds space inside around a child widget. SizedBox controls size, Padding controls space inside.Click to reveal answer
What happens if you use
SizedBox(width: 50, height: 50) without a child widget?✗ Incorrect
SizedBox with width and height but no child creates an empty box of that size.
Which widget would you use to add space inside a button around its label?
✗ Incorrect
Padding adds space inside around the child widget, perfect for spacing inside buttons.
If you want to add 10 pixels of space between two widgets vertically, which widget can you use?
✗ Incorrect
SizedBox with height 10 creates vertical space between widgets.
What does
Padding(padding: EdgeInsets.symmetric(horizontal: 20)) do?✗ Incorrect
EdgeInsets.symmetric(horizontal: 20) adds padding only on left and right sides.
Which widget can force a child widget to have a fixed size?
✗ Incorrect
SizedBox can force its child to have a fixed width and height.
Explain how you would use SizedBox and Padding together to create space around a button.
Think about space outside the button and space inside the button label.
You got /3 concepts.
Describe the visual difference between using SizedBox and Padding in a Flutter layout.
Consider how each affects the child's size and position.
You got /3 concepts.