android-state
Installation
SKILL.md
Android State Management
Priority: P0 (CRITICAL)
1. Structure ViewModel
- Expose ONE
StateFlow<UiState>via.asStateFlow(). - Use
viewModelScopefor all coroutines. - Trigger initial load in
initblock.
See templates for ViewModel and UiState examples.
2. Define UI State (LCE Pattern)
- Use sealed interface with Loading, Content, Error variants.
- Mark data classes
@Immutable.
See templates for sealed UiState pattern.