Created
January 25, 2025 16:57
-
-
Save igorescodro/8a90f8cf6b644f69569f69626bf0bdc7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// [...] Composable screen code | |
when (state) { | |
MainState.Loading -> { | |
ShimmerProvider { | |
ItemCard(item = fakeData) | |
} | |
} | |
is MainState.Success -> { | |
ItemCard(item = state.itemData) | |
} | |
} | |
@Composable | |
private fun ItemCard( | |
item: ItemData, | |
modifier: Modifier = Modifier | |
) { | |
Text( | |
text = item.description, | |
style = MaterialTheme.typography.bodyMedium, | |
modifier = Modifier.shimmerable() | |
) | |
// [...] Remaining Composable code | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment