NavHostResultOrNullHandler

Creates a NavHostResultHandler of T for this NavigationBundleSpecType Requires that Route.Result.Data.bundle is described by a SingleValueNavigationSpec matching the NavigationBundleSpecType either directly or wrapped in NavigationBundleSpecType.OptionalType

Return

the NavHostResultHandler

Parameters

ViewModel

the type of BaseLifecycleViewModel associated with the NavHostResultHandler

T

the type of result to expect

retain

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

onResult

Method for handling the received result


@JvmName(name = "NavHostNullableResultOrNullHandler")
inline fun <ViewModel : BaseLifecycleViewModel, T> NavigationBundleSpecType<T>.NavHostResultOrNullHandler(retain: Boolean = false, noinline onResult: ViewModel.(T?) -> Unit): NavHostResultHandler<ViewModel, T?>

Creates a NavHostResultHandler of T for this NavigationBundleSpecType Requires that Route.Result.Data.bundle is described by a SingleValueNavigationSpec matching the NavigationBundleSpecType

Return

the NavHostResultHandler

Parameters

ViewModel

the type of BaseLifecycleViewModel associated with the NavHostResultHandler

T

the type of result to expect

retain

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

onResult

Method for handling the received result


inline fun <ViewModel : BaseLifecycleViewModel, T : Any> KSerializer<T>.NavHostResultOrNullHandler(retain: Boolean = false, noinline onResult: ViewModel.(T?) -> Unit): NavHostResultHandler<ViewModel, T?>
@JvmName(name = "NavHostNullableResultOrNullHandler")
inline fun <ViewModel : BaseLifecycleViewModel, T> KSerializer<T>.NavHostResultOrNullHandler(retain: Boolean = false, noinline onResult: ViewModel.(T?) -> Unit): NavHostResultHandler<ViewModel, T?>

Creates a NavHostResultHandler of T for this KSerializer Requires that the Route.Result.Data.bundle is described by a SingleValueNavigationSpec matching NavigationBundleSpecType.SerializedType with this Serializer either directly or wrapped by NavigationBundleSpecType.OptionalType

Return

the NavHostResultHandler

Parameters

ViewModel

the type of BaseLifecycleViewModel associated with the NavHostResultHandler

T

the type of serialized property stored in 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 or null