LiveData integration
To use the LiveScreenModel
you should first import cafe.adriel.voyager:voyager-livedata
(see Setup).
State-aware ScreenModel
If your ScreenModel
needs to provide a state, use the LiveScreenModel
. Set the initial state on the constructor and use mutableState
to change the current state.
In your screen use state.observeAsState()
and handle the current state.
Sample
Sample code here.
Last updated