Skip to content

Demonstrate passing navigation parameters directly to the view model using HILT

License

Notifications You must be signed in to change notification settings

mkalitis/HiltNavigationInjection

Repository files navigation

Hilt Navigation Injection

An example of adding additional parameters to a view model that is injected using HILT. The project structure is as follows:

Package Description
common Constants used within other packages
di The dependency injection classses used with HILT
screen The screen UI (@Composable) functions
viewmodel The view models used by the screens.

The navigation tree for this sample is contained within the MainActivity.kt class/file.

How this all works

There is a Medium article for this so I will not repeat here.

Android Compose, Navigation, View Models and HILT

About

Demonstrate passing navigation parameters directly to the view model using HILT

Resources

License

Stars

Watchers

Forks

Languages