Flutter去除组件点击水波纹

如何去除Flutter组件点击水波纹?
答:设置 Theme 属性:splashFactory 为NoSplash.splashFactory
例如:去除BottomNavigationBar点击的水波纹

Scaffold(
        ....省略无用代码
        ....此处是在BottomNavigationBar外部再包装一层Theme,
        ....然后复制父主题并修改splashFactory属性,实现去除水波纹的点击效果
        bottomNavigationBar: Theme(
            data: Theme.of(context)
                .copyWith(splashFactory: NoSplash.splashFactory),
            child: BottomNavigationBar(
            ....省略无用代码
  }

你可能感兴趣的:(编程问题)