正常情况下使用方式:
InkWell(
onTap: () { },
child: Container(
height: 50,
child: Text( "是速度",
maxLines: 1,
style: TextStyle(color: color),
overflow: TextOverflow.ellipsis,
),
),
)
如果在InkWell的上下都出现的颜色的设置,如上中的Container中如果加入了color:Colors.white,这时候InkWell的水波纹效果会无效
解决方案是:在InkWell的外层再套上Matetial 以及 Ink组件
Material(
child: Ink(
child:
InkWell(
onTap: () { },
child: Container(
height: 50.0,
color: Colors.white,
child: Text( "是速度",
maxLines: 1,
style: TextStyle(color: color),
overflow: TextOverflow.ellipsis,
),
),
),
),
)