rememberPermissionState
Creates a PermissionState for a permission that is remembered across compositions.
Example:
@Composable
fun PermissionDemo() {
val state by rememberPermissionState(Manifest.permission.CAMERA)
if (state.isGranted) {
// Render something
} else {
if (state.isRationaleRequired) {
// Show rationale
}
// Render something else
}
}
Content copied to clipboard
Parameters
permission
The permission to observe.
Throws
If PermissionFlow is not initialized