NavGraphBuilder

class NavGraphBuilder : NavDestinationBuilder<NavGraph>
kotlin.Any
   ↳ androidx.navigation.NavDestinationBuilder<androidx.navigation.NavGraph>
   ↳ androidx.navigation.NavGraphBuilder

DSL for constructing a new NavGraph

Summary

Public constructors
<init>(provider: NavigatorProvider, id: Int, startDestination: Int)

DSL for constructing a new NavGraph

Public methods
Unit
destination(navDestination: NavDestinationBuilder<D>)

Build and add a new destination to the NavGraphBuilder

operator Unit

Adds this destination to the NavGraphBuilder

Unit

Add the destination to the NavGraphBuilder

NavGraph

Build the NavDestination by calling Navigator.createDestination.

Inherited functions
Extension functions
From androidx.navigation
Unit

Construct a new ActivityNavigator.Destination

Unit
NavGraphBuilder.navigation(id: Int, startDestination: Int, block: NavGraphBuilder.() -> Unit)

Construct a nested NavGraph

From androidx.navigation.fragment
Unit

Construct a new FragmentNavigator.Destination

Unit

Construct a new FragmentNavigator.Destination

From androidx.navigation.testing
Unit

Construct a new TestNavigator.Destination

Unit

Construct a new TestNavigator.Destination

Properties
NavigatorProvider

Inherited properties

Public constructors

<init>

NavGraphBuilder(provider: NavigatorProvider, id: Int, startDestination: Int)

DSL for constructing a new NavGraph

Public methods

destination

fun <D : NavDestination> destination(navDestination: NavDestinationBuilder<D>): Unit

Build and add a new destination to the NavGraphBuilder

unaryPlus

operator fun NavDestination.unaryPlus(): Unit

Adds this destination to the NavGraphBuilder

addDestination

fun addDestination(destination: NavDestination): Unit

Add the destination to the NavGraphBuilder

build

fun build(): NavGraph

Build the NavDestination by calling Navigator.createDestination.

Properties

provider

val provider: NavigatorProvider