如何在Flutter中删除ListView高亮颜色?

Mus*_*man 3 flutter

我正在我的应用程序中实现列表视图,但列表视图突出显示颜色不适合我的应用程序,所以我需要隐藏它或删除它,但无法找到方法来做到这一点.

这是应用程序的图像,其中包含我要删除的高亮颜色.您可能会注意到有一个阴影效果与高光效果奇怪地重叠.

红色圆形

Rém*_*let 11

编辑:

首选解决方案如何删除滚动发光?代替.

虽然这里显示的解决方案有效,但它实际上并没有消除发光.它取消了它.由于创建发光效果的资源仍然存在,因此优化程度较低.并且可定制性较低,因为它不允许使用不同的效果(例如淡入淡出)替换Glow.


您可以在窗口小部件树中插入a NotificationListener<OverscrollIndicatorNotification>

然后打电话通知 overscrollIndicatorNotification.disallowGlow()

 NotificationListener<OverscrollIndicatorNotification>(
    onNotification: (overscroll) {
      overscroll.disallowGlow();
    },
    child: new ListView.builder(
      itemBuilder: (context, index) {
        return new ListTile(
          title: new Text("data"),
        );
      },
    ),
  ),
Run Code Online (Sandbox Code Playgroud)

您可以随意插入NotificationListener.只要它是一个MaterialApp超出期望的孩子ListView.它不需要是直接的父母ListView.