Justin
05/03/2022, 3:04 PM@Composable
fun CustomTheme(
content: @Composable () -> Unit
) {
MaterialTheme(
colors = LightColorPalette,
shapes = Shapes,
) {
CompositionLocalProvider(
LocalRippleTheme provides CustomRippleTheme,
LocalCustomTypography provides CustomTypography(),
content = content
)
}
}
object CustomTheme {
val typography: CustomTypography
@Composable
get() = LocalCustomTypography.current
}
rather than the convention seen in the docs:
@Composable
fun CustomTheme(
content: @Composable () -> Unit
) {
CompositionLocalProvider(
LocalRippleTheme provides CustomRippleTheme,
LocalCustomTypography provides CustomTypography(),
) {
MaterialTheme(
colors = LightColorPalette,
shapes = Shapes,
content = content
)
}
}
// ...
Are there any problems with using this style over the one in the docs?