Hi all, I'm wondering if is there any method in st...
# stdlib
l
Hi all, I'm wondering if is there any method in stdlib that could help me with this
Copy code
val items: ArrayList<ListItem> = ArrayList()
        listIngredients.groupBy { it.type }.forEach {
            items.add(ListItem.HeaderItem(it.key))
            items.addAll(it.value.map { ListItem.IngredientItem(it) })
        }
or this is fine?