What is the Stack widget?
Why Interviewers Ask This
This is a classic screening question for Flutter roles. Hiring managers ask it early in interviews to gauge your baseline understanding and determine if you can communicate technical concepts clearly.
Answer
The Stack widget allows its children to overlap each other, positioned on top of one another like layers. It is used to create overlapping UI elements such as a badge on an icon, a floating label over an image, or a custom overlay. Use the Positioned widget inside a Stack to place children at specific coordinates relative to the stack's boundaries. The last child in the list is drawn on top.
Pro Tip
This topic has Flutter-specific nuances that differ from general programming. Highlighting those nuances in your answer shows expertise rather than generic knowledge.