我想从透明的可点击容器中删除涟漪效果,但无论我做什么,效果都不会消失,请帮忙!
代码:
InkWell(
onTap: (){print('Tapped');},
child: Container(
height: 200, width: 200,),)
我想从透明的可点击容器中删除涟漪效果,但无论我做什么,效果都不会消失,请帮忙!
代码:
InkWell(
onTap: (){print('Tapped');},
child: Container(
height: 200, width: 200,),)
改用GestureDetector
:
GestureDetector(
onTap: () {print('Tapped');},
child: Container(
height: 200, width: 200,
),
)
在您的 Material App 小部件 ThemeData 中添加以下行
highlightColor: Colors.transparent,
hoverColor: Colors.transparent,
splashColor: Colors.transparent,
splashFactory: NoSplash.splashFactory,
喜欢
theme: ThemeData(
highlightColor: Colors.transparent,
hoverColor: Colors.transparent,
splashColor: Colors.transparent,
splashFactory: NoSplash.splashFactory,
)