Recall & Review
beginner
What does the
Expanded widget do in Flutter?The
Expanded widget tells its child to fill the available space in the main axis of a Row, Column, or Flex. It expands the child to use all leftover space.Click to reveal answer
intermediate
How does the
Flexible widget differ from Expanded?Flexible lets its child be smaller than the available space if it wants, while Expanded forces the child to fill all the available space. Flexible gives more control over child's size.Click to reveal answer
beginner
What is the role of the
flex property in Expanded and Flexible?The
flex property is a number that tells how much space this widget should take relative to its siblings. For example, flex: 2 means twice as much space as flex: 1.Click to reveal answer
intermediate
Can
Flexible widget shrink its child smaller than its intrinsic size?Yes,
Flexible can shrink its child smaller than its intrinsic size if the child allows it. This helps when you want flexible but not forced expansion.Click to reveal answer
beginner
Why use
Expanded or Flexible inside a Row or Column?They help control how children share space. Without them, children take only the space they need. With them, you can make children grow or shrink to fill or share leftover space nicely.
Click to reveal answer
What happens if you wrap a widget with
Expanded inside a Row?✗ Incorrect
Expanded makes the child fill all leftover space along the main axis, which is horizontal in a Row.
Which widget allows its child to be smaller than the available space if it wants?
✗ Incorrect
Flexible lets the child be smaller or bigger, depending on child's size and constraints.
If two
Expanded widgets have flex values 1 and 3, how is space divided?✗ Incorrect
The space is divided in ratio 1:3, so first gets 1/4 and second gets 3/4 of leftover space.
Which widget forces its child to fill all available space?
✗ Incorrect
Expanded forces the child to fill all available space along the main axis.
What is the main axis in a
Column?✗ Incorrect
The main axis of a Column is vertical, so Expanded expands vertically.
Explain the difference between
Expanded and Flexible widgets in Flutter.Think about how much space the child widget takes inside a Row or Column.
You got /3 concepts.
Describe a real-life scenario where you would use
Expanded inside a Row.Imagine a toolbar with a search box that should grow to fill space.
You got /3 concepts.