StateFlow for Shared UI State
Expose observable state both apps can collect.
State Needs a Holder
UI state is not a one-off stream, it is a value that always exists right now. StateFlow is a Flow that holds a single current value for the screen.
Always Has a Value
Unlike a plain Flow, a StateFlow is hot and always carries a value. A new collector instantly receives the latest state, never an empty start.
All lessons in this course
- Flow Basics in Shared Code
- StateFlow for Shared UI State
- Operators: map, filter, combine
- Collect Flows on Android & iOS