Skip to content

Instantly share code, notes, and snippets.

@Skyyo
Last active Jun 19, 2022
Embed
What would you like to do?
@Composable
fun CardsScreen(viewModel: CardsViewModel) {
val cards by viewModel.cards.collectAsState()
val expandedCardIds by viewModel.expandedCardIdsList.collectAsState()
Scaffold {
LazyColumn {
itemsIndexed(cards) { _, card ->
ExpandableCard(
card = card,
onCardArrowClick = { viewModel.onCardArrowClicked(card.id) },
expanded = expandedCardIds.contains(card.id),
)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment