Hilt integration
To use the getScreenModel
you should first import cafe.adriel.voyager:voyager-hilt
(see Setup).
@Inject
Add @Inject
annotation to your ScreenModel
.
Call getScreenModel()
to get a new instance.
@AssistedInject
Add @AssistedInject
annotation to your ScreenModel
and provide a ScreenModelFactory
annotated with @AssistedFactory
.
Call getScreenModel()
and use your factory to create a new instance.
Sample
Sample code here.
Navigator scoped ScreenModel
Last updated