0
0
Fluttermobile~5 mins

Stack and Positioned in Flutter - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a Stack widget in Flutter?
A Stack widget lets you place widgets on top of each other like a stack of papers. It allows overlapping and layering of child widgets.
Click to reveal answer
beginner
How does the Positioned widget work inside a Stack?
The Positioned widget lets you place a child widget at a specific position inside a Stack using properties like top, left, right, and bottom.
Click to reveal answer
beginner
What happens if you use a Stack without any Positioned children?
Without Positioned, children are placed in order, aligned to the top-left by default, stacked on top of each other without specific positioning.
Click to reveal answer
intermediate
Can a Positioned widget be used outside a Stack?
No, Positioned only works inside a Stack. Using it outside causes an error because it needs the Stack context to position itself.
Click to reveal answer
beginner
What is the difference between Stack and Column widgets?
Stack layers widgets on top of each other, allowing overlap. Column arranges widgets vertically without overlap.
Click to reveal answer
Which widget allows you to place children on top of each other in Flutter?
AStack
BRow
CColumn
DContainer
What property would you use in a Positioned widget to place a child 10 pixels from the top?
Abottom: 10
Bleft: 10
Cright: 10
Dtop: 10
What happens if you use Positioned outside a Stack?
AIt works normally
BIt causes a runtime error
CIt ignores positioning
DIt converts to a <code>Container</code>
If you want widgets to not overlap but be stacked vertically, which widget should you use?
AStack
BPositioned
CColumn
DExpanded
Which of these is NOT a valid property for Positioned?
Amargin
Bleft
Cbottom
Dtop
Explain how the Stack and Positioned widgets work together to create layered layouts in Flutter.
Think about how you place sticky notes on a board.
You got /4 concepts.
    Describe a real-life scenario where using a Stack with Positioned widgets would be useful in a mobile app UI.
    Imagine putting a small label on top of a photo.
    You got /4 concepts.