Flutter 消除按钮抖动的涟漪效应
自从Flatter不推荐FlatButton以来,当用户按下按钮时,我就不能再使用splashColor和highlightColor属性来设置按钮的颜色。现在我必须使用一个新按钮,比如下面的TextButton,但我还没有找到任何按钮样式具有背景色的功能,当用户按下按钮时,背景色不会产生涟漪效应Flutter 消除按钮抖动的涟漪效应,flutter,Flutter,自从Flatter不推荐FlatButton以来,当用户按下按钮时,我就不能再使用splashColor和highlightColor属性来设置按钮的颜色。现在我必须使用一个新按钮,比如下面的TextButton,但我还没有找到任何按钮样式具有背景色的功能,当用户按下按钮时,背景色不会产生涟漪效应 TextButton( style: ButtonStyle( overlayColor: MaterialStateProperty.all(Colors.grey[100]), ), ),
TextButton(
style: ButtonStyle(
overlayColor: MaterialStateProperty.all(Colors.grey[100]),
),
),
对于涟漪效果,将
TextButton
包装在InkWell
小部件中,如下所示:
InkWell(
TextButton(
style: ButtonStyle(
overlayColor: MaterialStateProperty.all(Colors.grey[100]),
),
),
)
我不想要连锁反应,我想要消除连锁反应