gpt4 book ai didi

flutter - 如何在 Flutter 中添加带有图标的按钮

转载 作者:行者123 更新时间:2023-12-04 00:02:23 28 4
gpt4 key购买 nike

我的应用程序中有一个按钮,例如

下面是相同的代码

Widget loginButtonChild = const Text(
"Log in",
style: TextStyle(
color: Colors.white,
fontFamily: "OpenSans-Regular",
),
);


FlatButton.icon(
shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(18.0),
side: BorderSide(color: Colors.red)),
color: Colors.red,
label: loginButtonChild,
icon: Icon(Icons.arrow_forward ),
onPressed: () {
//some function
},
)
我正在尝试创建一个类似的按钮

任何人都可以帮助解决这个问题或任何建议吗?

最佳答案

使用那个

RaisedButton(
onPressed: () {},
padding: const EdgeInsets.symmetric(horizontal: 24),
color: Colors.redAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(24),
),
child: Row(
children: <Widget>[
Text("Label", style: TextStyle(color: Colors.white)),
SizedBox(width: 6),
Icon(Icons.chevron_right, color: Colors.white),
],
),
),

关于flutter - 如何在 Flutter 中添加带有图标的按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58517331/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com