Launcher

data class Launcher<ViewModel : BaseLifecycleViewModel, Input, Output>(val viewModelClass: KClass<ViewModel>, val activityResultContract: ActivityResultContract<Input, Output>, val getInput: @Composable () -> Input?, val onResult: ViewModel.(Output) -> Unit) : ComposableNavSpec.LaunchedNavigation

A LaunchedNavigation that navigates using an ActivityResultLauncher and a valid input.

Parameters

ViewModel

the type of BaseLifecycleViewModel that any onResult should be applied to.

Constructors

Link copied to clipboard
constructor(viewModelClass: KClass<ViewModel>, activityResultContract: ActivityResultContract<Input, Output>, getInput: @Composable () -> Input?, onResult: ViewModel.(Output) -> Unit)

Properties

Link copied to clipboard
val getInput: @Composable () -> Input?

The input to be provided to activityResultContract

Link copied to clipboard

Callback to handle the result of activityResultContract

Link copied to clipboard

The class of the ViewModel the result of this launcher is to be applied to.

Functions

Link copied to clipboard
fun Launch(viewModel: BaseLifecycleViewModel, onDispose: () -> Unit)

Launch this LaunchedNavigation for a given viewModel.