Class

CompositionLocal

Compose passes data through the composition tree explicitly through means of parameters to composable functions.

createCompositionLocal

@Sampled
fun createCompositionLocal() {
    val ActiveUser = compositionLocalOf<User> { error("No active user found!") }
}

compositionLocalProvider

@Sampled
fun compositionLocalProvider() {

someScreenSample

@Sampled
fun someScreenSample() {

consumeCompositionLocal

@Sampled
fun consumeCompositionLocal() {
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: