So I have a dropdown widget but when the list increases the dropdown increases. How can I avoid this? I for e.g I want to make it 400 height max and have a scroll inside. Also is it possible to add a placeholder instead of adding a value as first selected?
child: DropdownButtonHideUnderline(
child: DropdownButton(
dropdownColor: Colors.white,
isExpanded: true,
value: dropdownValue,
focusColor: Colors.white,
items: [
'Country',
'B',
'C',
'D',
'E',
'A',
'B',
'C',
'D',
'E'
].map((String value) {
return DropdownMenuItem(
value: value, child: Text(value));
}).toList(),
onChanged: (_) {}),
),
>Solution :
You can use menuMaxHeight:400 to set Custom height.
DropdownButtonHideUnderline(
child: DropdownButton(
menuMaxHeight: 400,
