Package 

Class DestinationsNavHostKt

    • Method Detail

      • DestinationsNavHost

        @Composable() final static Unit DestinationsNavHost(TypedNavHostGraphSpec<?> navGraph, Modifier modifier, Direction start, NavHostAnimatedDestinationStyle defaultTransitions, NavHostEngine engine, NavHostController navController, Function1<DependenciesContainerBuilder<?>, Unit> dependenciesContainerBuilder, Function1<ManualComposableCallsBuilder, Unit> manualComposableCallsBuilder)

        Like androidx.navigation.compose.NavHost but includes the destinations of navGraph. Composables annotated with @Destination will belong to a NavGraphSpec inside NavGraphs generated file. You can also disable the NavGraphs automatic generation in build.gradle:

        ksp {
            arg("compose-destinations.generateNavGraphs", "false")
        }

        This might be useful if you need more complex NavGraphs then what the usage of the annotation can provide. If you do this, it is advisable that you create your NavGraphs file with your navigation graphs in the form of NavGraphSpec implementations.

        Parameters:
        navGraph - NavGraphSpec to use the DestinationSpecs from and register the navigation graph.
        modifier - Modifier to apply to this Composable
        start - the start Direction of the NavHost.
        defaultTransitions - default enter/exit transition animations for all destinations.
        engine - NavHostEngine to use.
        navController - NavHostController that can be used to navigate between this NavHost's destinations.
        dependenciesContainerBuilder - offers a DependenciesContainerBuilder where you can add dependencies by their class via com.ramcosta.composedestinations.navigation.dependency.
        manualComposableCallsBuilder - this will offer a ManualComposableCallsBuilder scope where you can make manual calls to specific DestinationSpec Composables which belong to this navGraph.