Lists & Navigation in Kotlin Desktop: Compose Multiplatform | Lesson 04
32views
1likes
07:16
T
Taught by Celeste AI - AI Coding Coach
View on YouTubeDescription
Learn how to build scrollable lists and navigate between screens in Compose Desktop! In this lesson we build a notes app with LazyColumn
for efficient list rendering, sealed classes for type-safe navigation, and a when expression for state-driven screen routing.
What You'll Learn:
- LazyColumn with items() DSL for efficient scrollable lists
- Card(onClick = ...) for clickable list items
- sealed class for type-safe navigation screens
- when expression for state-driven screen routing
- State hoisting for navigation: parent owns currentScreen
- verticalScroll(rememberScrollState()) for scrollable detail
- Reusable TopBar composable with optional back button
Source Code: https://github.com/GoCelesteAI/kotlin-desktop-lesson04
Timestamps:
0:00 - Introduction
0:15 - Preview: What We're Building
0:45 - Project Setup
1:30 - Data Model
2:20 - List Composables
3:10 - Detail & TopBar
4:00 - Main & Compile
4:45 - Live Demo
5:45 - Recap & Key Takeaways
6:45 - End Screen
Key Takeaways:
1. LazyColumn — Renders only visible items for efficient scrolling
2. Sealed Class — Type-safe navigation with Screen.List and Screen.Detail
3. When Expression — Pattern-match current screen to render the right composable
4. Navigation State — Parent owns currentScreen, children fire callbacks
5. Card onClick — Make entire cards clickable with one parameter
Next Lesson:
Lesson 05: Theming & Dark Mode (coming soon)