13

I am implementing List View in my app, but the list view highlight color does not suit my app so I need to hide it or remove it, but could not find a way to do it.

Here is an image of the app with the highlight color I want to remove. You might notice that there is a shadow effect which weirdly overlaps the highlight effect.

The red circular shape

Musa Usman
  • 691
  • 4
  • 10
  • 21
  • 2
    If your app is not following material design principle, don't use `MaterialApp` to begin with. You can use `WidgetApp` which doesn't introduce things like that. – Rémi Rousselet Jun 17 '18 at 19:50
  • @RémiRousselet I understand their concern that the overscroll glow sometimes introduces a really harsh cut into an otherwise clean design. Material Design is a guideline and thus removing some elements does not mean that you cannot take advantage of other elements. – creativecreatorormaybenot Jun 17 '18 at 19:58

1 Answers1

38

EDIT :

Prefer the solution from How to remove scroll glow? instead.

While the solution shown here works, it doesn't actually removes the glow. It cancels it. This is less optimized as resources to create glow effects are still there. And less customizable because it doesn't allow replacing Glow with a different effect (such as fade).


You can insert in your widget tree a NotificationListener<OverscrollIndicatorNotification>

and then call on notification overscrollIndicatorNotification.disallowGlow()

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

You can insert NotificationListener wherever you like. As long as it's a child of MaterialApp and above the desired ListView. It doesn't need to be a direct parent of that ListView.

Rémi Rousselet
  • 256,336
  • 79
  • 519
  • 432