Skip to content

Instantly share code, notes, and snippets.

@skydoves
Last active January 23, 2025 02:28
Show Gist options
  • Save skydoves/95b319b0debe0030dd32d4d54946b25a to your computer and use it in GitHub Desktop.
Save skydoves/95b319b0debe0030dd32d4d54946b25a to your computer and use it in GitHub Desktop.
composition_local
/**
* 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