English 中文(简体)
DropdownButton Menu item width
原标题:

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)

问题回答

暂无回答




相关问题
Flutter App cannot be installed on Android TV

I m building a Flutter app that should support Android TV and Mobile devices. Despite Google Play shows that it is supported, I cannot install app on my MiBox device. While trying to install it, both ...

Moving the icon button to the right causes rendering issues

I am trying to align the icon button to the right of the Text field, I tried the row which made the icon button not centered vertically and now I am trying out the Stack widget. Here is my code - ...

热门标签