Flutter中的DropdownButton根据它所拥有的项目中最大的DropdownMenuItem来设置其宽度。如果选择了一个较小的项目,则会在项目和箭头之间留下大量空白。我试过使用Expanded,一些Flexible的东西,但我仍然不能让它改变宽度。DropdownButton( hint: Text("Small te
使用DropdownButton时,我需要所选项目的颜色与点击按钮时出现的下拉菜单中的项目列表的颜色不同。根据the Flutter documentation的说法,我应该使用selectedItemBuilder。正如在the example within the documentation中可以看到的,使用selectedItemBuilder的结果是选中的文本被上移了,这看