collectAsStateWithLifecycle
Extension function to collect GrantUiState from GrantHandler in a Composable.
This is a convenience helper that simplifies the common pattern of observing the handler's state in Compose UI.
Usage:
@Composable
fun MyScreen(handler: GrantHandler) {
val state by handler.collectAsStateWithLifecycle()
// Now use state.showRationale, state.rationaleMessage, etc.
}Content copied to clipboard
Instead of manually calling:
val state by handler.state.collectAsStateWithLifecycle()Content copied to clipboard
Return
State holder containing the current GrantUiState
Extension function to collect GrantGroupUiState from GrantGroupHandler in a Composable.
Usage:
@Composable
fun MyScreen(handler: GrantGroupHandler) {
val state by handler.collectAsStateWithLifecycle()
// Now use state.isVisible, state.grantedGrants, etc.
}Content copied to clipboard
Return
State holder containing the current GrantGroupUiState
Extension function to collect state from GrantAndServiceHandler in a Composable.