dialog
public fun NavGraphBuilder.dialog(
route: String,
arguments: List<NamedNavArgument> = emptyList(),
deepLinks: List<NavDeepLink> = emptyList(),
dialogProperties: DialogProperties = DialogProperties(),
content: @Composable (NavBackStackEntry) -> Unit,
)
Add the Composable to the NavGraphBuilder that will be hosted within a androidx.compose.ui.window.Dialog. This is suitable only when this dialog represents a separate screen in your app that needs its own lifecycle and saved state, independent of any other destination in your navigation graph. For use cases such as AlertDialog, you should use those APIs directly in the composable destination that wants to show that dialog.
Parameters
| route | route for the destination |
| arguments | list of arguments to associate with destination |
| deepLinks | list of deep links to associate with the destinations |
| dialogProperties | properties that should be passed to androidx.compose.ui.window.Dialog. |
| content | composable content for the destination that will be hosted within the Dialog |
dialog
public inline fun <reified T : Any> NavGraphBuilder.dialog(
typeMap: Map<KType, @JvmSuppressWildcards NavType<*>> = emptyMap(),
deepLinks: List<NavDeepLink> = emptyList(),
dialogProperties: DialogProperties = DialogProperties(),
noinline content: @Composable (NavBackStackEntry) -> Unit,
)
Add the Composable to the NavGraphBuilder that will be hosted within a androidx.compose.ui.window.Dialog. This is suitable only when this dialog represents a separate screen in your app that needs its own lifecycle and saved state, independent of any other destination in your navigation graph. For use cases such as AlertDialog, you should use those APIs directly in the composable destination that wants to show that dialog.
Parameters
| T | route from a KClass for the destination |
| typeMap | map of destination arguments' kotlin type KType to its respective custom NavType. May be empty if T does not use custom NavTypes. |
| deepLinks | list of deep links to associate with the destinations |
| dialogProperties | properties that should be passed to androidx.compose.ui.window.Dialog. |
| content | composable content for the destination that will be hosted within the Dialog |
dialog
public fun <T : Any> NavGraphBuilder.dialog(
route: KClass<T>,
typeMap: Map<KType, @JvmSuppressWildcards NavType<*>> = emptyMap(),
deepLinks: List<NavDeepLink> = emptyList(),
dialogProperties: DialogProperties = DialogProperties(),
content: @Composable (NavBackStackEntry) -> Unit,
)
Add the Composable to the NavGraphBuilder that will be hosted within a androidx.compose.ui.window.Dialog. This is suitable only when this dialog represents a separate screen in your app that needs its own lifecycle and saved state, independent of any other destination in your navigation graph. For use cases such as AlertDialog, you should use those APIs directly in the composable destination that wants to show that dialog.
Parameters
| route | route from KClass of T for the destination |
| typeMap | map of destination arguments' kotlin type KType to its respective custom NavType. May be empty if route does not use custom NavTypes. |
| deepLinks | list of deep links to associate with the destinations |
| dialogProperties | properties that should be passed to androidx.compose.ui.window.Dialog. |
| content | composable content for the destination that will be hosted within the Dialog |