navigator
navigator copied to clipboard
Access Argument in ViewModel for Navigator Compose
Is it possible to get Navigation arguments from SavedStateHandle in ViewModels like we can do in Navigation Compose library
private val lectionName: String = savedStateHandle.get("lectionName")!!
private val packName: String = savedStateHandle.get("packName")!!
Yes it is possible, but I have to double check in what form the keys and values are stored.
Because savedstatehandle
should know about all the states that were saved for a particular component like activity or fragment here composable screen.