-
-
Save KatieBarnett/bbbd7594ecd9e2bff9a21155d4333325 to your computer and use it in GitHub Desktop.
TextColoredComponentPreview - data created inside composable
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
@Preview | |
@Composable | |
fun TextColoredComponentPreviewDataCreatedInside() { | |
val previewData = sequenceOf( | |
TextConfig(color = MaterialTheme.colorScheme.primary, text = "Primary text"), | |
TextConfig(color = MaterialTheme.colorScheme.secondary, text = "Secondary text") | |
) | |
MaterialTheme { | |
Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { | |
previewData.forEach {data -> | |
Text(data.text, color = data.color) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment