Camera and picker
Add this key to the iOS Info.plist before the preview can open:
@Composable
fun CustomCameraView() {
val state = rememberVisionCameraState(onCapture = { /* Handle captured images */ })
VisionCamera(
state = state,
modifier = Modifier.fillMaxSize(),
permissionDeniedContent = {
// Custom UI content for permission denied scenario
},
)
Button(onClick = state::capture) {
Text("Capture")
}
}
state is the VisionCameraState that controls the camera. permissionDeniedContent replaces the preview when camera access is denied.