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.
There is a Medium article for this so I will not repeat here.