美文网首页
去除 Flutter 中点击按钮、底部导航栏的水波纹效果

去除 Flutter 中点击按钮、底部导航栏的水波纹效果

作者: 代码小王子 | 来源:发表于2020-10-19 09:14 被阅读0次

一:全局去除设置

找到 MaterialApp 组件,设置其 theme 属性如下

@override
Widget build(BuildContext context) {
  return MaterialApp(
    theme: ThemeData(
      splashColor: Colors.transparent, // 点击时的高亮效果设置为透明
      highlightColor: Colors.transparent, // 长按时的扩散效果设置为透明
    ),
  );
}

二:局部去除设置

highlightColor: Colors.transparent, // 透明色
splashColor: Colors.transparent, // 透明色

相关文章

网友评论

      本文标题:去除 Flutter 中点击按钮、底部导航栏的水波纹效果

      本文链接:https://www.haomeiwen.com/subject/zomwpktx.html