is there any to reduce the width of the dropdownbutton menu widow width after clicking the dropdownbutton? only want to change the width of the window after clicking dropdownbutton and keeping the dropdown button s isExpanded = true. I tried wrapping it with the container and giving width but it also change the width of the dropdown button as well. I don t want to use any external package. You can see in the output image i want to remove the red square space from the dropdown. any suggestions or solution will be super helpful....thanks in advance
return Container(
// width: 300.0,
child: DropdownButton(
isExpanded = true,
value: selectedname,
items: listOfDropdownMenuItems.map(
(name) {
return DropdownMenuItem<String>(
value: name,
child: Text(
name,
),
);
}).toList(),),
onChanged:(newValue) {
setname(newValue!);
},
underline: Container(),
),
),
);
[output image:] (https://i.stack.imgur.com/FISMs.png)