在这里阅读GlowingOverscrollIndicator似乎可以更改ThemeData.accentColor
的值来更改上卷发光 colored颜色 .
您可以try 使用类似的命令,将Theme
的更改限制为仅ListView
//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);
}
}
你可以阅读更多关于如何设计你的
Theme
here