# FragmentNavigatorDestinationBuilderKt

Added in 2.4.0

*** ** * ** ***


```
public final class FragmentNavigatorDestinationBuilderKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final void` | `<F extends https://developer.android.com/reference/androidx/fragment/app/Fragment> [fragment](https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigatorDestinationBuilderKt#(androidx.navigation.NavGraphBuilder).fragment(kotlin.Int))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder receiver, @https://developer.android.com/reference/androidx/annotation/IdRes int id)` **This method is deprecated.** Use routes to create your FragmentDestination instead |
| `static final void` | `<F extends https://developer.android.com/reference/androidx/fragment/app/Fragment> https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigatorDestinationBuilderKt#(androidx.navigation.NavGraphBuilder).fragment(kotlin.String)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html route )` Construct a new `https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigator.Destination` |
| `static final void` | `<F extends https://developer.android.com/reference/androidx/fragment/app/Fragment, T extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigatorDestinationBuilderKt#(androidx.navigation.NavGraphBuilder).fragment(kotlin.collections.Map)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-type/index.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavType<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> typeMap )` Construct a new `https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigator.Destination` |
| `static final void` | `<F extends https://developer.android.com/reference/androidx/fragment/app/Fragment> [fragment](https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigatorDestinationBuilderKt#(androidx.navigation.NavGraphBuilder).fragment(kotlin.Int,kotlin.Function1))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder receiver, @https://developer.android.com/reference/androidx/annotation/IdRes int id, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigatorDestinationBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder )` **This method is deprecated.** Use routes to create your FragmentDestination instead |
| `static final void` | `<F extends https://developer.android.com/reference/androidx/fragment/app/Fragment> https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigatorDestinationBuilderKt#(androidx.navigation.NavGraphBuilder).fragment(kotlin.String,kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html route, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigatorDestinationBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder )` Construct a new `https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigator.Destination` |
| `static final void` | `<F extends https://developer.android.com/reference/androidx/fragment/app/Fragment, T extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigatorDestinationBuilderKt#(androidx.navigation.NavGraphBuilder).fragment(kotlin.collections.Map,kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-type/index.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavType<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> typeMap, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigatorDestinationBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder )` Construct a new `https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigator.Destination` |

## Public methods

### fragment

Artifact: [androidx.navigation:navigation-fragment](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/fragment/FragmentNavigatorDestinationBuilder.kt+function:fragment)

```
public static final void <F extends Fragment> [fragment](https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigatorDestinationBuilderKt#(androidx.navigation.NavGraphBuilder).fragment(kotlin.Int))(@NonNull NavGraphBuilder receiver, @IdRes int id)
```

> [!CAUTION]
> **This method is deprecated.**   
> Use routes to create your FragmentDestination instead, use this instead:
>
> ```
> fragment<F>(route = id.toString())
> ```

Construct a new `https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigator.Destination`

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IdRes int id` | the destination's unique id |

### fragment

Artifact: [androidx.navigation:navigation-fragment](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/fragment/FragmentNavigatorDestinationBuilder.kt+function:fragment)

```
public static final void <F extends Fragment> fragment(
    @NonNull NavGraphBuilder receiver,
    @NonNull String route
)
```

Construct a new `https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigator.Destination`

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html route` | the destination's unique route |

### fragment

Artifact: [androidx.navigation:navigation-fragment](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/fragment/FragmentNavigatorDestinationBuilder.kt+function:fragment)

```
public static final void <F extends Fragment, T extends Object> fragment(
    @NonNull NavGraphBuilder receiver,
    @NonNull Map<@NonNull KType, @NonNull NavType<@NonNull ?>> typeMap
)
```

Construct a new `https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigator.Destination`

| Parameters |
|---|---|
| `<T extends https://developer.android.com/reference/java/lang/Object.html>` | the destination's unique route from a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-type/index.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavType<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> typeMap` | map of destination arguments' kotlin type `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-type/index.html` to its respective custom `https://developer.android.com/reference/androidx/navigation/NavType`. May be empty if `https://developer.android.com/reference/androidx/navigation/fragment/package-summary#(androidx.navigation.NavGraphBuilder).fragment(kotlin.collections.Map)` does not use custom NavTypes. |

### fragment

Artifact: [androidx.navigation:navigation-fragment](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/fragment/FragmentNavigatorDestinationBuilder.kt+function:fragment)

```
public static final void <F extends Fragment> [fragment](https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigatorDestinationBuilderKt#(androidx.navigation.NavGraphBuilder).fragment(kotlin.Int,kotlin.Function1))(
    @NonNull NavGraphBuilder receiver,
    @IdRes int id,
    @NonNull Function1<@NonNull FragmentNavigatorDestinationBuilder, Unit> builder
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Use routes to create your FragmentDestination instead, use this instead:
>
> ```
> fragment<F>(route = id.toString()) { builder.invoke() }
> ```

Construct a new `https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigator.Destination`

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IdRes int id` | the destination's unique id |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigatorDestinationBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder` | the builder used to construct the fragment destination |

### fragment

Artifact: [androidx.navigation:navigation-fragment](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/fragment/FragmentNavigatorDestinationBuilder.kt+function:fragment)

```
public static final void <F extends Fragment> fragment(
    @NonNull NavGraphBuilder receiver,
    @NonNull String route,
    @NonNull Function1<@NonNull FragmentNavigatorDestinationBuilder, Unit> builder
)
```

Construct a new `https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigator.Destination`

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html route` | the destination's unique route |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigatorDestinationBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder` | the builder used to construct the fragment destination |

### fragment

Artifact: [androidx.navigation:navigation-fragment](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/fragment/FragmentNavigatorDestinationBuilder.kt+function:fragment)

```
public static final void <F extends Fragment, T extends Object> fragment(
    @NonNull NavGraphBuilder receiver,
    @NonNull Map<@NonNull KType, @NonNull NavType<@NonNull ?>> typeMap,
    @NonNull Function1<@NonNull FragmentNavigatorDestinationBuilder, Unit> builder
)
```

Construct a new `https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigator.Destination`

| Parameters |
|---|---|
| `<T extends https://developer.android.com/reference/java/lang/Object.html>` | the destination's unique route from a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-type/index.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavType<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> typeMap` | map of destination arguments' kotlin type `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-type/index.html` to its respective custom `https://developer.android.com/reference/androidx/navigation/NavType`. May be empty if `https://developer.android.com/reference/androidx/navigation/fragment/package-summary#(androidx.navigation.NavGraphBuilder).fragment(kotlin.collections.Map,kotlin.Function1)` does not use custom NavTypes. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigatorDestinationBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder` | the builder used to construct the fragment destination |