Created
August 31, 2021 02:11
-
-
Save widiarifki/daede2eaed2ebf5e0d6cd5bd3301f672 to your computer and use it in GitHub Desktop.
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
@Composable | |
fun ShoppingList( | |
shoppingItems: List<ShoppingItem>, | |
onToggleTickItem: (ShoppingItem) -> Unit, | |
onDeleteItem: (ShoppingItem) -> Unit, | |
modifier: Modifier = Modifier | |
) { | |
LazyColumn(modifier.padding(8.dp)) { | |
items( | |
items = shoppingItems, | |
key = { item -> item.id } | |
) { item -> | |
// Item card | |
ShoppingItemCard(item, onToggleTickItem, onDeleteItem) | |
// Space between card | |
Spacer(modifier = Modifier.height(8.dp)) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment