I have a normal ListView
which is wrapped by the Scrollbar
class to produce a scrollbar when scrolling down. But I want to change the Scrollbar
color to white since I have a dark background.
After exploring the Scrollbar
class I can see that it uses the theme highlightColor
as shown inside scrollbar.dart
.
_themeColor = theme.highlightColor.withOpacity(1.0);
Tried wrapping the Scrollbar
in a Theme
but still no luck.
Below is my code -
Theme(
data: ThemeData(
highlightColor: Colors.white, //Does not work
),
child: Scrollbar(
child: ListView(
//Normal ListView code
),
),
)
Any help is appreciated. Thanks in advance.
copyWith
as ` Theme(data: Theme.of(context).copyWith(highlightColor: Colors.white), ...)` – Amandine