What is the GridView widget and how does it differ from ListView?
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
GridView arranges widgets in a 2D scrollable grid (rows and columns), while ListView arranges them in a single-column (or single-row) scrollable list. GridView is ideal for displaying image galleries, product catalogs, or any content that benefits from a tiled layout. Both support lazy building via their .builder() constructors. The key GridView-specific property is crossAxisCount (number of columns) or maxCrossAxisExtent (maximum tile width).
Pro Tip
If you're unsure about a detail, say so honestly and explain your reasoning. Interviewers respect candidates who can think through uncertainty rather than bluffing.