How to create own CompositionLocal

PHOTO EMBED

Tue Jan 11 2022 15:17:01 GMT+0000 (UTC)

Saved by @GoodRequest. #kotlin

// Definition with default value
val LocalPaddings = compositionLocalOf { PaddingValues(0.dp) }

.
.
.

// Using CompositionLocal App-wide
CompositionLocalProvider(LocalPaddings provides PaddingValues(24.dp)) {
		/*
			your app composables...
		*/
}
content_copyCOPY