-
-
Save skydoves/95b319b0debe0030dd32d4d54946b25a to your computer and use it in GitHub Desktop.
composition_local
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Local providers for various properties we connect to our components, for styling. | |
*/ | |
private val LocalColors = compositionLocalOf<StreamColors> { | |
error("No colors provided! Make sure to wrap all usages of Stream components in a VideoTheme.") | |
} | |
public interface StreamTheme { | |
/** | |
* Retrieves the current [StreamColors] at the call site's position in the hierarchy. | |
*/ | |
public val colors: StreamColors | |
@Composable @ReadOnlyComposable | |
get() = LocalColors.current | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment