androidx.navigation.testing


Classes

TestNavHostController

Subclass of NavHostController that offers additional APIs for testing Navigation.

TestNavigatorState

An implementation of NavigatorState that allows testing a androidx.navigation.Navigator in isolation (i.e., without requiring a androidx.navigation.NavController).

Extension functions summary

operator SavedStateHandle
SavedStateHandle.Companion.invoke(
    route: Any,
    typeMap: Map<KTypeNavType<*>>
)

SavedStateHandle constructor to create a SavedStateHandle with a serializable object.

Extension functions

operator fun SavedStateHandle.Companion.invoke(
    route: Any,
    typeMap: Map<KTypeNavType<*>> = emptyMap()
): SavedStateHandle

SavedStateHandle constructor to create a SavedStateHandle with a serializable object.

Returns a SavedStateHandle populated with arguments from route.

Parameters
route: Any

The route to extract argument values from

typeMap: Map<KTypeNavType<*>> = emptyMap()

A mapping of KType to custom NavType<*> in the route. May be empty if route does not use custom NavTypes.