Last active
January 8, 2022 22:52
-
-
Save raamcosta/ddefc9bad530893044f0b8d0e49e8b76 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
// Just as an example of something you might want to send to some destinations | |
val scaffoldState = rememberScaffoldState() | |
DestinationsNavHost( | |
navGraph = NavGraphs.root | |
) { | |
composable(SomeScreenDestination) { //this: DestinationScope<SomeScreenDestination.NavArgs> | |
SomeScreen( | |
arg1 = navArgs.arg1, // navArgs is a lazily evaluated `SomeScreenDestination.NavArgs` instance, field of `DestinationScope` | |
navigator = destinationsNavigator, // destinationsNavigator is a `DestinationsNavigator` (also lazily evaluated) | |
backStackEntry = navBackStackEntry, // navBackStackEntry is a `DestinationScope` field | |
scaffoldState = scaffoldState, | |
) | |
} | |
//All screens that don't need the scaffoldState don't need to be specified here | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment