View ParcelableExample.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Parcelize | |
data class Example(val id: String, val name: String) : Parcelable |
View FirstScreenViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FirstScreenViewModel( | |
private val navigator: Navigator | |
) : ViewModel { | |
... | |
fun navigateExample() { | |
navigator.navigate(NavigationActions.FirstScreen.firstScreenToSecondScreen()) | |
} | |
View LifecycleAwareState.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import androidx.compose.runtime.Composable | |
import androidx.compose.runtime.State | |
import androidx.compose.runtime.collectAsState | |
import androidx.compose.runtime.remember | |
import androidx.lifecycle.Lifecycle | |
import androidx.lifecycle.LifecycleOwner | |
import androidx.lifecycle.flowWithLifecycle | |
import kotlinx.coroutines.flow.Flow | |
@Composable |
NewerOlder