[英]Add text underneath iconbutton in appbar actions?
I'm currently trying to add the text ('Filter'), underneath an icon inside of the actions field within an AppBar.我目前正在尝试在 AppBar 中的操作字段内的图标下方添加文本(“过滤器”)。
Without any text being added underneath it.没有在它下面添加任何文本。 the action aligned exactly with the text and hamburger menu icon
动作与文本和汉堡菜单图标完全一致
There are two issues I'm having:我有两个问题:
How can I fix this?我怎样才能解决这个问题?
Thanks!谢谢!
_appbarActions = [
Column(
children: [
IconButton(icon: const Icon(Icons.filter_alt_outlined), onPressed: () {}),
Text('Filter'),
],
)
];
Try the below snippet code:试试下面的代码片段:
IconButton
and Text
use Icon
only;IconButton
和Text
之间的空格,请仅使用Icon
;InkWell
widgetInkWell
小部件包装列Container(
margin: const EdgeInsets.only(right: 8.0),
child: InkWell(
onTap: () {},
child: Stack(
children: [
Center(
child: Icon(Icons.filter_alt_outlined),
),
Positioned(
child: Text(
'Filter',
style: TextStyle(fontSize: 10.0),
),
bottom: 5,
),
],
),
),
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.