NavigatorProvider

public class NavigatorProvider


A NavigationProvider stores a set of Navigators that are valid ways to navigate to a destination.

Summary

Public constructors

Public methods

final Navigator<@NonNull NavDestination>

Register a navigator using the name provided by the Navigator.Name annotation.

@CallSuper Navigator<@NonNull NavDestination>

Register a navigator by name.

final @NonNull T
<T extends Navigator<?>> getNavigator(Class<T> navigatorClass)

Retrieves a registered Navigator using the name provided by the Navigator.Name annotation.

@CallSuper @NonNull T
<T extends Navigator<?>> getNavigator(String name)

Retrieves a registered Navigator by name.

Extension functions

final @NonNull NavGraph
DynamicNavGraphBuilderKt.navigation(
    NavigatorProvider receiver,
    @IdRes int id,
    @IdRes int startDestination,
    @ExtensionFunctionType Function1<DynamicNavGraphBuilderUnit> builder
)

This method is deprecated. Use routes to create your DynamicNavGraph instead

final @NonNull NavGraph
DynamicNavGraphBuilderKt.navigation(
    NavigatorProvider receiver,
    String startDestination,
    String route,
    @ExtensionFunctionType Function1<DynamicNavGraphBuilderUnit> builder
)

Construct a new DynamicGraphNavigator.DynamicNavGraph

final @NonNull NavGraph
NavGraphBuilderKt.navigation(
    NavigatorProvider receiver,
    @IdRes int id,
    @IdRes int startDestination,
    @ExtensionFunctionType Function1<NavGraphBuilderUnit> builder
)

This method is deprecated. Use routes to build your NavGraph instead

final @NonNull NavGraph
NavGraphBuilderKt.navigation(
    NavigatorProvider receiver,
    String startDestination,
    String route,
    @ExtensionFunctionType Function1<NavGraphBuilderUnit> builder
)

Construct a new NavGraph

final @NonNull T
<T extends Navigator<NavDestination>> NavigatorProviderKt.get(
    NavigatorProvider receiver,
    String name
)

Retrieves a registered Navigator by name.

final @NonNull T
<T extends Navigator<NavDestination>> NavigatorProviderKt.get(
    NavigatorProvider receiver,
    KClass<T> clazz
)

Retrieves a registered Navigator using the name provided by the Navigator.Name annotation.

final void

Register a navigator using the name provided by the Navigator.Name annotation.

final Navigator<@NonNull NavDestination>
NavigatorProviderKt.set(
    NavigatorProvider receiver,
    String name,
    Navigator<NavDestination> navigator
)

Register a Navigator by name.

Public fields

public final @NonNull Map<@NonNull String, @NonNull Navigator<