Is there a generic-parameterized version of Dropdo...
# compose
c
Is there a generic-parameterized version of DropdownMenu like this? Kind of like
LazyListScope.items()
I have this function more or less, in my app. Would something like this ever land in the material package?
Copy code
@Composable
fun <T> DropdownMenu(
  items: List<T>,
  onItemClick: (T) -> Unit,
  itemContent: @Composable RowScope.(T) -> Unit,
) {
  DropdownMenu(...) {
    for (item in items) {
      DropdownMenuItem(
        onClick = {
          onItemClick(item)
        },
        content = { itemContent(item) },
      )
    }
  }
}
Hm it has occurred to me that this would be awkward, because you would want a way to pass parameters to DropdownMenuItem