Before you dive in, it may be helpful to get familiar with the companion document Architecture: Feature Screen, which explains how the individual classes fit together. With that context in mind, this guide walks you through creating a new feature screen in the project. You can choose one of two paths:
file_teamplates.zip
from the baselines-kmp root dir*UiEvent
sealed interface ProfileUiEvent : UiEvent
*UiState
@Immutable
data class ProfileUiState(
override val eventSink: (ProfileUiEvent) -> Unit,
) : UiState<ProfileUiEvent>
*ViewModel
@Inject
class ProfileViewModel : BaselineViewModel<ProfileUiEvent, ProfileUiState>() {
@Composable
override fun state() = ProfileUiState { /* handle events */ }
}
*Screen
@Composable
fun ProfileScreen(onLogoutClicked: () -> Unit) { /* UI */ }