-
-
Save KaustubhPatange/a00f95cbaade83781898513decd01e46 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// somewhere at the top, create & remember instance of SaveableStateHolder | |
val saveableStateHolder = rememberSaveableStateHolder() | |
// called for every destination with a unique key in navigation structure | |
// (when created or active) | |
saveableStateHolder.SaveableStateProvider(key = ...) { | |
// composable content whose rememberSaveable values will be saved with | |
// the given key | |
} | |
// remove the saved state, happens during backward navigation i.e destination | |
// is removed from the backstack. | |
saveableStateHolder.removeState(key = ...) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment