Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the color of the overscroll glow effect of ListView in Flutter?

Tags:

flutter

How do I change the color of the glow effect of a ListView in Flutter?

Glow effect

like image 395
Daniel Oliveira Avatar asked Oct 08 '18 22:10

Daniel Oliveira


People also ask

How do I change the scrollbar color in flutter?

You can use RawScrollbar instead and set the thumbColor to whatever color you like. Show activity on this post. Scroll bar uses the highlight color.. so just add ur desired scrollbar color in the highlightColor inside Theme in MaterialApp and you are done.

How do I get rid of the scroll color in flutter?

How to Remove ScrollGlow in Flutter?? The glow effect comes from GlowingOverscrollIndicator added by ScrollBehavior. To remove this effect, you need to specify a custom ScrollBehavior. For that, simply wrap any given part of your application into a ScrollConfiguration with the desired ScrollBehavior.

How to programmatically set the background color of a list view item?

Programmatically set the background color of a list view item , You can use the BackColor property to change the color displayed behind the item text.

How to remove scrollglow in flutter?

How to Remove ScrollGlow in Flutter?? The glow effect comes from GlowingOverscrollIndicator added by ScrollBehavior. To remove this effect, you need to specify a custom ScrollBehavior. For that, simply wrap any given part of your application into a ScrollConfiguration with the desired ScrollBehavior.

Is it possible to replace glow with notificationlistener in listview?

And less customizable because it doesn't allow replacing Glow with a different effect (such as fade). You can insert NotificationListener wherever you like. As long as it's a child of MaterialApp and above the desired ListView.

Is there a way to change the over scroll glow color?

Reading here for GlowingOverscrollIndicator seems like you can change the value of ThemeData.accentColor to change the overscroll glow color. You could try with something similar to this to limit the Theme change to the ListView only


1 Answers

Reading here for GlowingOverscrollIndicator seems like you can change the value of ThemeData.accentColor to change the overscroll glow color.

You could try with something similar to this to limit the Theme change to the ListView only

//store the current Theme to restore it later final ThemeData defaultTheme = Theme.of(context);  Theme(   //Inherit the current Theme and override only the accentColor property   data: Theme.of(context).copyWith(     accentColor: Colors.yellow   ),   child: ListView.builder(       //suppose data it's an array of strings       itemBuilder: (BuildContext context, int index) =>           EntryItem(data[index], defaultTheme),       itemCount: data.length,   ), );  //this is your class to render rows class EntryItem extends StatelessWidget {   const EntryItem(this.entry, this.defaultTheme);    final String entry;   final ThemeData defaultTheme;    Widget _buildTiles(String entry) {     return Theme(       data: defaultTheme,       child: Text(entry)     );   }    @override   Widget build(BuildContext context) {     return _buildTiles(entry);   } } 

You can read more about how to style your Theme here

like image 200
MatPag Avatar answered Sep 21 '22 17:09

MatPag