-
@Stable() public interface DestinationsNavigatorContract for a navigator of DestinationSpec. It uses components of NavController so implementations will need one to do actual navigation.
It is meant as a dependency inversion wrapper to make Composables that depend on it be testable and "preview-able".
-
-
Method Summary
Modifier and Type Method Description abstract Unitnavigate(Direction direction, Function1<DestinationsNavOptionsBuilder, Unit> builder)Navigates to the given Direction. abstract Unitnavigate(Direction direction, NavOptions navOptions, Navigator.Extras navigatorExtras)Navigates to the given Direction. abstract BooleannavigateUp()abstract BooleanpopBackStack()abstract BooleanpopBackStack(RouteOrDirection route, Boolean inclusive, Boolean saveState)abstract BooleanclearBackStack(RouteOrDirection route)abstract NavBackStackEntrygetBackStackEntry(RouteOrDirection route)Like NavController.getBackStackEntry but returns null if RouteOrDirection is not in the back stack instead of throwing an exception. -
-
Method Detail
-
navigate
abstract Unit navigate(Direction direction, Function1<DestinationsNavOptionsBuilder, Unit> builder)
Navigates to the given Direction. NavGraphSpec are Direction. Generated
Destinationsare Direction if they don't have any navigation arguments or you can call theirinvokemethod passing the arguments to get a Direction instance.- Parameters:
builder- NavOptionsBuilder
-
navigate
abstract Unit navigate(Direction direction, NavOptions navOptions, Navigator.Extras navigatorExtras)
Navigates to the given Direction. NavGraphSpec are Direction. Generated
Destinationsare Direction if they don't have any navigation arguments or you can call theirinvokemethod passing the arguments to get a Direction instance.- Parameters:
navOptions- NavOptionsnavigatorExtras- Navigator.Extras
-
navigateUp
@MainThread() abstract Boolean navigateUp()
-
popBackStack
@MainThread() abstract Boolean popBackStack()
-
popBackStack
@MainThread() abstract Boolean popBackStack(RouteOrDirection route, Boolean inclusive, Boolean saveState)
-
clearBackStack
@MainThread() abstract Boolean clearBackStack(RouteOrDirection route)
-
getBackStackEntry
abstract NavBackStackEntry getBackStackEntry(RouteOrDirection route)
Like NavController.getBackStackEntry but returns null if RouteOrDirection is not in the back stack instead of throwing an exception.
-
-
-
-