PermissionRequired

@Composable()
fun PermissionRequired(permissionState: PermissionState, permissionNotGrantedContent: @Composable() () -> Unit, permissionNotAvailableContent: @Composable() () -> Unit, content: @Composable() () -> Unit)

Composable that exercises the permissions flows as described in the documentation when a permission is required to be granted for content.

If the permission is not granted or a rationale should be shown, permissionNotGrantedContent will be added to Composition. If the user doesn't want to be asked for permissions again, permissionNotAvailableContent will be added instead.

Parameters

permissionState

required permission to be granted.

permissionNotGrantedContent

content to show when the user hasn't granted the permission. Requesting the permission to the user is allowed using PermissionState.launchPermissionRequest in a side-effect or non-Composable lambda.

permissionNotAvailableContent

content to show when the permission is not available. This could be because the user doesn't want to be asked again for this permission or the permission is blocked in the device. Attempting to request the permission to the user in this part of Composition has no effect.

content

content to show when the permission is granted.