After this lesson you will
- Design an immutable UiState with data class, val and ImmutableList
- Model screen modes with a sealed UiState instead of loose flags
- Change a Compose UI state contract directly and validate it with unit tests
Duration10 min
DifficultyBeginner
Design An Immutable UI Model
Model a screen with clear, immutable state, then change the state contract yourself.
- 01Lesson Goal
- 02Part 1: A Screen Is A Set Of States
- 03Part 2: A Data Contract Is Not A UI Model
- 04Part 3: Immutability Is The Key To Composables
- 05Part 4: Close Off The Screen Modes With Sealed State
- 06Part 5: Why Loose Flags Are A Red Flag
- 07Part 6: Drill 1, Change The Number Of Skeleton Rows
- 08Part 7: Drill 2, Add A Sealed Variant
- 09Part 8: What Belongs In Persistent UI State?
- 10Code Reading Path
- 11Checkpoint
- 12Bad Smells
Topics: mobile-action-pro, compose-state
12 sections left in this lessonUnlock all of Mobile Action ProLesson Goal, Part 1: A Screen Is A Set Of States, … — plus 114 lessons in this course, source code and checklists.
Unlock Mobile Action ProOne-time payment — lifetime access — 7-day money-back. Already purchased? Sign in