Flutter 下拉按钮文本溢出

Par*_*wan 1 drop-down-menu flutter

我怎样才能让文本扩展到它的内容?我试过这个

child: DropdownButtonHideUnderline(
                                  child: DropdownButton<String>(
                                items: _currentCitySelected.area
                                    .map((String dropDownStringItem) {
                                  return DropdownMenuItem<String>(
                                    value: dropDownStringItem,
                                    child: Container(
                                        child: Text(
                                      dropDownStringItem,
                                      maxLines: 2,
//                                      overflow: TextOverflow.clip,
                                    )),
                                  );
                                }).toList(),
                                onChanged: (String newValueSelected) {
                                  setState(() {
                                    this._currentAreaSelected =
                                        newValueSelected;
                                  });
                                },
                                value: _currentAreaSelected,
                              ))
Run Code Online (Sandbox Code Playgroud)

[在此处输入图片说明 文本扩展到下拉对话框内容中的内容,但它在主视图中的工作方式不同。 在此处输入图片说明

sha*_*eep 9

isExpanded属性设置DropdownButtontrue

isExpanded: true
Run Code Online (Sandbox Code Playgroud)

像那样:

DropdownButtonHideUnderline(
            child: DropdownButton<String>(
              isExpanded: true,
              items: [...]
Run Code Online (Sandbox Code Playgroud)