NavGraphNavigator
@Navigator.Name(value = "navigation")
public class NavGraphNavigator extends Navigator
DynamicGraphNavigator |
Navigator for graphs in dynamic feature modules. |
A Navigator built specifically for NavGraph elements. Handles navigating to the correct destination when the NavGraph is the target of navigation actions.
Construct a Navigator capable of routing incoming navigation requests to the proper destination within a NavGraph.
Summary
Public constructors |
|---|
NavGraphNavigator(@NonNull NavigatorProvider navigatorProvider) |
Public methods |
|
|---|---|
@NonNull NavGraph |
Creates a new |
final @NonNull StateFlow<@NonNull List<@NonNull NavBackStackEntry>> |
Gets the backstack of |
void |
navigate( |
Inherited methods |
||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
NavGraphNavigator
public NavGraphNavigator(@NonNull NavigatorProvider navigatorProvider)
| Parameters | |
|---|---|
@NonNull NavigatorProvider navigatorProvider |
NavigatorProvider used to retrieve the correct |
Public methods
createDestination
public @NonNull NavGraph createDestination()
Creates a new NavGraph associated with this navigator.
getBackStack
public final @NonNull StateFlow<@NonNull List<@NonNull NavBackStackEntry>> getBackStack()
Gets the backstack of NavBackStackEntry associated with this Navigator
navigate
public void navigate(
@NonNull List<@NonNull NavBackStackEntry> entries,
NavOptions navOptions,
Navigator.Extras navigatorExtras
)
| Throws | |
|---|---|
kotlin.IllegalArgumentException |
if given destination is not a child of the current navgraph |