-1

我想从透明的可点击容器中删除涟漪效果,但无论我做什么,效果都不会消失,请帮忙!

代码:

InkWell(
 onTap: (){print('Tapped');},
   child: Container(
     height: 200, width: 200,),)
4

2 回答 2

1

改用GestureDetector

GestureDetector(
 onTap: () {print('Tapped');},
   child: Container(
     height: 200, width: 200,
   ),
 )
于 2021-10-15T05:43:13.340 回答
0

在您的 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,
)
于 2021-10-15T05:57:17.993 回答