Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access Argument in ViewModel for Navigator Compose #26

Open
shakil807g opened this issue Aug 31, 2022 · 1 comment
Open

Access Argument in ViewModel for Navigator Compose #26

shakil807g opened this issue Aug 31, 2022 · 1 comment

Comments

@shakil807g
Copy link

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")!!
@KaustubhPatange
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants