Skip to content

Instantly share code, notes, and snippets.

@widiarifki
Created August 31, 2021 02:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save widiarifki/daede2eaed2ebf5e0d6cd5bd3301f672 to your computer and use it in GitHub Desktop.
Save widiarifki/daede2eaed2ebf5e0d6cd5bd3301f672 to your computer and use it in GitHub Desktop.
@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