flutter - 如何在 RaisedButton 右侧添加图标?
问题描述
如何将图标添加到右侧的 RaisedButton
Padding(
padding: const EdgeInsets.only(top: 15.0),
child: new SizedBox(
width: double.infinity,
child: new RaisedButton(
textColor: Colors.white,
color: coloraccent,
onPressed: () {},
child: const Text('UPADATE'),
)),
),
解决方案
您可以将您RaisedButton.icon
的Directionality
小部件包装起来:
Directionality(
textDirection: TextDirection.rtl,
child: RaisedButton.icon(
onPressed: () {},
color: Colors.deepPurple,
icon: Icon(
Icons.arrow_drop_down,
color: Colors.white,
),
label: Text(
"Category",
style: TextStyle(color: Colors.white),
),
),
)
推荐阅读
- python - python 通过按钮进行进程控制-Tkinter
- python - 检索 Jira 的完成日期
- css - .btn 无论我做什么,悬停都会改变背景颜色
- php - Silverstripe 4:配置 Fluent 以使 Widget 字段可翻译
- python - 错误消息:“TypeError:必须使用日志实例作为第一个参数调用未绑定的方法 w()(改为获取 str 实例)”
- sql - 如何理解这个查询?
- ios - 在发布模式下构建时显示空白屏幕的地图
- asp.net - 在 web.config 中隐藏 MVC 页面
- java - 如何使用 RSA512 算法创建签名的 JWT
- android - Android 嵌套首选项设置无法正常工作