我正在使用FlatButton
并传递了属性
FlatButton(
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
child: ...,
)
The 文档称 FlatButton 将变得过时 https://api.flutter.dev/flutter/material/FlatButton-class.html,并使用TextButton
相反,但它不需要splashColor
or highlightColor
特性
TextButton(
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
child: ...,
)
不起作用。不允许
我也尝试过这样
TextButton(
style: ButtonStyle(
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
),
child: ...,
)
我怎样才能做到这一点?谢谢
Colors.transparent 将拒绝任何效果,只是它是透明的,所以它看起来就像什么都没有发生一样......在 ButtonStyle 中,它与颜色类似。
ButtonStyle(
overlayColor: MaterialStateColor.resolveWith((states) => Colors.red),
),
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)