List and Detail
You'll build the most common app shape there is: a scrolling list of things, a tap through to a detail screen, and a way back that lands where you left.
About
Mail, podcasts, recipes, settings and most of the apps on your phone are a list and a detail. Get it right once and you have the skeleton for half of everything you'll ever build. Load at least 200 items from a JSON file bundled with the app, because at that size a plain column of views stutters and you're forced to learn the recycling list the platform gives you. The back button on Android and the swipe from the left edge on an iPhone both have to work, and both have to return you to the same spot in the list. A static list of three items doesn't count.
At a glance
- Per requirement
- 15 XP
- Completion bonus
- 75 XP
- Requirements
- 5
- Takes
- One evening
- Skill level
- Beginner (done it a few times)
- Cost
- Free
- Supplies
- Nothing special
- Where
- At home
- Other people
- With other people
Requirements
-
1
Bundle a JSON file with at least 200 items and load it at launch. Pick something you care about: birds, films, climbing routes, your record collection. Each item needs a title, a line of text and one more field you can filter on. A public dataset, a CSV you convert, or an evening of typing all count. Take a photo of the file in your editor with the item count visible. Photo
-
2
Show them in a list that recycles rows and scrolls smoothly. Use the platform's lazy list (LazyColumn, RecyclerView, SwiftUI's List, Flutter's ListView.builder) rather than a plain column of 200 views. Film a hard flick from the top to the bottom on the real phone. Stutter counts as a bug. Video
-
3
Tap a row to a detail screen and come back to the same scroll position. Push the detail onto the navigation stack rather than opening a dialog. Android's back gesture and the iPhone's edge swipe both need to work and both need to return you to the row you tapped. Film going into three rows and back out. Video
-
4
Add a search box that filters as you type. Filter on the title and your extra field, case-insensitive. The keyboard's return key should dismiss the keyboard, and one tap should clear the search. Film a search that matches exactly two items. Video
-
5
Give the empty result a sentence, then hand the phone to someone to find an item. When a search finds nothing, show a plain sentence rather than a blank screen. Then hand your phone to someone and ask them to find a specific item with no help from you. Film them doing it, and note anything they hesitated on. Video