Sparround

Core widgets and lists

Most day-to-day work revolves around a handful of widgets:

  • Scaffold — the skeleton of a Material screen: appBar, body, floatingActionButton, bottomNavigationBar, drawer
  • Text and Image — content; Image.network, Image.asset, an error state via errorBuilder
  • ListView and GridView — scrolling lists
  • Stack and Positioned — overlapping layout
  • Padding, SizedBox, Align, Center — spacing and alignment

Of these, lists matter most for interviews, because that is where the performance question starts.

ListView has two forms, and not knowing the difference is a classic mistake:

  • ListView(children: [...]) builds every child immediately. Fine for 10 items, disastrous for 10,000
  • ListView.builder(itemCount:, itemBuilder:) is lazy: it builds only the items on screen (plus a small buffer)

Other variants: ListView.separated (dividers between items), GridView.builder, and CustomScrollView with slivers for long or mixed pages.

For long or unbounded lists, always `.builder` — that is the expected interview answer.

Interview tip. "You have 10,000 items — how do you render them?" appears in nearly every Flutter interview. Give a three-part answer: (1) ListView.builder for lazy building; (2) make item widgets const where possible and keep heavy work out of itemBuilder; (3) the data side — pagination and image caching. Point one alone is a junior answer.

📚 Sources and documentation