Dropdown Options
fun DropdownOptions(@StringRes label: Int, preSelectedOption: Int, options: List<String>, onNewOption: (Int) -> Unit, optionLabels: Map<String, String> = emptyMap(), horizontalPadding: Dp = HorizontalPadding)
Parameters
on New Option
a callback that contains the index of in the range of options the option that's selected
pre Selected Option
the index of an option from options
option Labels
a map where the keys are an options and the value is a custom label (could be a description) of the option instead of using the options
I did this because:
The interactive mode preview of the composable isn't working (at least occasionally)
I wanted the click of the widget to have a rounded look on it, so I made the OutlinedTextField have a button inside it and it looks great.
This gives more customization options
https://stackoverflow.com/questions/67111020/exposed-drop-down-menu-for-jetpack-compose