-
public final class NavControllerExtKt
-
-
Field Summary
Fields Modifier and Type Field Description private final static TypedNavHostGraphSpec<?>navGraphprivate final static Flow<TypedDestinationSpec<?>>currentDestinationFlow
-
Method Summary
Modifier and Type Method Description final TypedNavHostGraphSpec<?>getNavGraph()final Flow<TypedDestinationSpec<?>>getCurrentDestinationFlow()final static DestinationsNavigatortoDestinationsNavigator(NavController $self)Creates a DestinationsNavigator for the NavController which has Compose Destinations friendly versions of some NavController APIs. final static DestinationsNavigatorrememberDestinationsNavigator(NavController $self)Returns a DestinationsNavigator for the NavController which has Compose Destinations friendly versions of some NavController APIs. final static TypedDestinationSpec<?>destination(NavBackStackEntry $self)Finds the DestinationSpec correspondent to this NavBackStackEntry. final static TypedRoute<?>route(NavBackStackEntry $self)Finds the Route (so either a DestinationSpec or a NavGraphSpec) correspondent to this NavBackStackEntry. final static TypedNavGraphSpec<?, ?>navGraph(NavBackStackEntry $self)Finds the NavGraphSpec that this NavBackStackEntry belongs to. final static State<TypedDestinationSpec<?>>currentDestinationAsState(NavController $self)Gets the current DestinationSpec as a State. final static BooleanisRouteOnBackStack(NavController $self, RouteOrDirection route)Checks if a given RouteOrDirection (which is either com.ramcosta.composedestinations.spec.NavGraphSpec or Direction or com.ramcosta.composedestinations.spec.DestinationSpec) is currently somewhere in the back stack. final static State<Boolean>isRouteOnBackStackAsState(NavController $self, RouteOrDirection route)Same as isRouteOnBackStack but provides a State which you can use to make sure your Composables get recomposed when this changes. -
-
Method Detail
-
getNavGraph
final TypedNavHostGraphSpec<?> getNavGraph()
-
getCurrentDestinationFlow
final Flow<TypedDestinationSpec<?>> getCurrentDestinationFlow()
-
toDestinationsNavigator
final static DestinationsNavigator toDestinationsNavigator(NavController $self)
Creates a DestinationsNavigator for the NavController which has Compose Destinations friendly versions of some NavController APIs.
-
rememberDestinationsNavigator
@Composable() final static DestinationsNavigator rememberDestinationsNavigator(NavController $self)
Returns a DestinationsNavigator for the NavController which has Compose Destinations friendly versions of some NavController APIs.
-
destination
final static TypedDestinationSpec<?> destination(NavBackStackEntry $self)
Finds the DestinationSpec correspondent to this NavBackStackEntry. Some NavBackStackEntry are not DestinationSpec, but are NavGraphSpec instead. If you want a method that works for both, use route extension function instead.
Use this ONLY if you're sure your NavBackStackEntry corresponds to a DestinationSpec, for example when converting from "current NavBackStackEntry", since a NavGraphSpec is never the "current destination" shown on screen.
-
route
final static TypedRoute<?> route(NavBackStackEntry $self)
Finds the Route (so either a DestinationSpec or a NavGraphSpec) correspondent to this NavBackStackEntry.
-
navGraph
final static TypedNavGraphSpec<?, ?> navGraph(NavBackStackEntry $self)
Finds the NavGraphSpec that this NavBackStackEntry belongs to. If NavBackStackEntry corresponds to the top level nav graph (i.e, there is no parent), then this returns the top level NavGraphSpec.
-
currentDestinationAsState
@Composable() final static State<TypedDestinationSpec<?>> currentDestinationAsState(NavController $self)
Gets the current DestinationSpec as a State.
-
isRouteOnBackStack
final static Boolean isRouteOnBackStack(NavController $self, RouteOrDirection route)
Checks if a given RouteOrDirection (which is either com.ramcosta.composedestinations.spec.NavGraphSpec or Direction or com.ramcosta.composedestinations.spec.DestinationSpec) is currently somewhere in the back stack.
-
isRouteOnBackStackAsState
@Composable() final static State<Boolean> isRouteOnBackStackAsState(NavController $self, RouteOrDirection route)
Same as isRouteOnBackStack but provides a State which you can use to make sure your Composables get recomposed when this changes.
-
-
-
-