【发布时间】:2020-06-06 17:32:44
【问题描述】:
我想在 Flutter 中为特定图标实现下拉列表,并在 AppBar 中对其应用 GestureDetector。它的代码是,
AppBar(
actions: <Widget>[
Padding(
padding: const EdgeInsets.fromLTRB(4.0, 4.0, 0, 4.0),
child: Image.network(
"Some Image Url"),
),
GestureDetector(
onTap: () {
// I want to implement the Dropdown List here.
},
child: Padding(
padding: const EdgeInsets.all(0.0),
child: Icon(Icons.arrow_drop_down),
),
),
],
)
【问题讨论】:
-
在 Flutter 中不使用
DropdownButton的下拉列表是什么意思?你在找ExpansionTile吗? -
一个下拉列表,通过单击此图标进行选择。
-
我尝试使用下拉按钮,但它占用空间并且 UI 看起来不太好,所以我只想用这个图标来实现。
-
如果不使用
dropDownButton,我认为您无法做到这一点。 -
如果您自定义它,您可以做更多的事情。查看详情here。
标签: flutter dart drop-down-menu icons appbar