The DropdownButton in Flutter sets its width based on the largest DropdownMenuItem from the items it has. That leaves a lot of white space between the item and the arrow if a small item is selected. How do I make the button scale to just fit the selected item's width?
I tried using Expanded, some Flexible stuff and I still can't make it change its width.
DropdownButton(
value: null,
hint: Text("Small text"),
items: ..., //Text widgets that have more text and are larger than the hint
)
I am trying to get rid of that space underlined between the hint and the arrow:
