【发布时间】:2021-04-16 03:45:03
【问题描述】:
我需要在所选值下方显示下拉菜单。我们如何像在android中一样在flutter中设置Dropdown垂直偏移量。有没有创建自定义下拉菜单的简单方法?附上图片和
这是我的下拉代码:
Container(
width: percentWidth(77, context),
padding: EdgeInsets.fromLTRB(16, 0, 16, 0),
child: DropdownButton<String>(
isExpanded: true,
value: state.selectedSubject,
underline: Container(
height: 1.0,
decoration: const BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.transparent,
width: 0.0))),
),
icon: Icon(Icons.arrow_drop_down),
iconSize: 0,
elevation: 16,
style: TextStyle(color: Colors.black, fontSize: 15),
onChanged: (String data) {
_userFeedbackBloc
.add(UserFeedbackEvent.onDropDownChanged(data));
},
items: spinnerItems.map<DropdownMenuItem<String>>(
(String newValue) {
return DropdownMenuItem<String>(
value: newValue,
child: Text(newValue),
);
}).toList(),
),
),
【问题讨论】:
标签: flutter