PickVisualMedia

inline fun <ViewModel : BaseLifecycleViewModel> PickVisualMedia(type: ActivityResultContracts.PickVisualMedia.VisualMediaType = ActivityResultContracts.PickVisualMedia.ImageAndVideo, noinline onResult: ViewModel.(Uri?) -> Unit): ComposableNavSpec.Launcher<ViewModel, PickVisualMediaRequest, Uri?>

Creates a ComposableNavSpec.Launcher to open Photo app to pick an image or video

Parameters

ViewModel

the type of BaseLifecycleViewModel the result should be called on.

onResult

Callback method that returns an Uri of the image or video selected, or null if nothing was selected.