What is the Wrap widget?
Why Interviewers Ask This
Interviewers use this question to quickly assess whether a candidate has the foundational knowledge required for Flutter development. It reveals whether you understand the building blocks that more complex concepts rely on.
Answer
The Wrap widget is like a Row or Column but automatically wraps its children to the next line when there is no more space. This makes it perfect for displaying a dynamic set of items like filter chips, tags, or badge lists that need to flow naturally across multiple lines. You can control the spacing between items horizontally and runSpacing between rows, as well as the direction (horizontal or vertical) and alignment.
Pro Tip
Demonstrate both theoretical understanding and practical experience. Say what it is, then give an example of how you actually used it in a Flutter codebase.