TextButton(
child: Padding(
padding: EdgeInsets.only(left: 20, right: 20),
child: Text.rich(
TextSpan(style: TextStyle(color: Colors.black54, fontSize: 13), children: [
WidgetSpan(
child: Icon(
Icons.arrow_back_ios,
//color: Colors.white,
),
alignment: PlaceholderAlignment.middle,
),
]),
),
),
style: ButtonStyle(
foregroundColor: MaterialStateProperty.resolveWith((states) {
return states.contains(MaterialState.pressed) ? Color(0xAAFFFFFF) : Colors.white;
}),
overlayColor: MaterialStateProperty.all(Colors.transparent),
visualDensity: VisualDensity.compact,
minimumSize: MaterialStateProperty.all(Size(50, 47)),
),
onPressed: () {
ToastUtil.toast('aaaaa');
},
),
Flutter按下变色的图标按钮
最新推荐文章于 2025-02-24 17:09:54 发布