I’m attempting to reduce the height of a Dropdown menu, I have tried in this way:
SizedBox(
height: 30,
child: Container(
decoration: BoxDecoration(color: Colors.white),
child: DropdownMenu<String>(
// inputDecorationTheme: InputDecorationTheme(alignLabelWithHint: ),
textStyle: TextStyle(fontSize: 10),
inputDecorationTheme: InputDecorationTheme(
isCollapsed: true
),
dropdownMenuEntries: [
DropdownMenuEntry(value: "Name - First", label: "Name - First",
style: ButtonStyle(textStyle: MaterialStateTextStyle.resolveWith((states) => TextStyle(fontSize: 10) ))),
],
),
),
),
To reduce its height but the result is the following. How can I easily make the dropdown menu smaller?
DropdownManu Height change attempt
I was expecting to make the Dropdown manu smaller
3
Answers
You can control the height of dropdown menu using the
constraints
property in the InputDecorationTheme.Make sure to adjust the content padding accordingly.
I See you are wrapping the container with sizedBox to reduce its size, that is not a good way, you can provide height or width directly to the container if you want to reduce its size.
Now talking about your question, if you just want to reduce you select menu height you can define menuHeight inside of the DropdownMenu and it will give you your desired results.
Here’s your code
wrap it in container instead of sizedbox