I created a couple of Chip and Chips @Composable functions that I use like this:
Chips {
Chip(text = "Apple")
Chip(text = "Banana")
Chip(text = "Cherry")
}
I'd like the first and last chip to look a bit different. I could do it by using extra arguments to the Chip function:
Chips {
Chip(text = "Apple", isFirst = true)
Chip(text = "Banana")
Chip(text = "Cherry", isLast = true)
}
It is a bit cumbersome. How can I make an individual Chip aware of its siblings.
Similarly we might want to change the color of the Chips depending on whether there are Chips inside or not.
Chips(chipCount = if (addCherry) 3 else 2) {
Chip(text = "Apple")
Chip(text = "Banana")
if (addCherry) Chip(text = "Cherry")
}
How would I do that more elegantly.
