LazyColumn: Rows from a List

The scrolling workhorse

Almost every content screen in PawWalk is a list on display: walkers, bookings, pets. Compose's tool for that is LazyColumn β€” a vertically scrolling list that only composes the rows currently visible on screen, plus a small buffer. Scroll a thousand-walker list and it stays fast, because it never builds all thousand rows at once.

Contrast that with plain Column, which you met in Module 04: a Column lays out everything you hand it immediately, whether it's on screen or not. Fine for a handful of fixed items β€” a real problem for a list that could hold hundreds. LazyColumn is Column's lazy cousin, built for exactly that case.

Inside a LazyColumn, you don't put children directly β€” you call items(...) inside a trailing lambda that acts as a small DSL (LazyListScope). items(walkers) { walker -> WalkerCard(walker) } says: for each element of walkers, run this closure and place the result as one row.