HandleResultOfType

fun <T> NavHostController.HandleResultOfType(serializer: KSerializer<T>, retain: Boolean = false, onResult: T.() -> Unit)

Handles a Route.Result.Data matching a given type T. Requires that the Route.Result.Data.bundle is described by a SingleValueNavigationSpec matching NavigationBundleSpecType.SerializedType with serializer

Parameters

T

the type of serialized property stored in the result

serializer

The KSerializer to deserialize T from the result.

retain

If true the result will be retained in the NavBackStackEntry. It will be deleted otherwise.

onResult

Method for handling the received T

Throws