Hilt integration
To use the getViewModel
you should first import cafe.adriel.voyager:voyager-hilt
(see Setup).
@Inject
Add @HiltViewModel
and @Inject
annotations to your ViewModel
.
Call getViewModel()
to get a new instance.
@AssistedInject
Currently there's no Assisted Injection support for Hilt ViewModels (issue).
Sample
Sample code here.
Last updated