2

How can I change color of scroll bar indicator in SingleChildScrollView, the SingleChildScrollView doesn't have option color or something for style, if we can't change color of SingleChildScrollView do we have any alternative for that

Md. Yeasin Sheikh
  • 54,221
  • 7
  • 29
  • 56
e Res
  • 101
  • 1
  • 10

2 Answers2

5

Try this:

RawScrollbar(
    thumbColor: Colors.red,
    radius: Radius.circular(16),
    thickness: 7,
    child: SingleChildScrollView()
)
Sunderam Dubey
  • 1
  • 11
  • 20
  • 40
eamirho3ein
  • 16,619
  • 2
  • 12
  • 23
2

You can provide ScrollbarThemeData:thumbColor by wrapping the SingleChildScrollView

 Theme(
  data: Theme.of(context).copyWith(
      scrollbarTheme: ScrollbarThemeData(
    thumbColor: MaterialStateProperty.all(Colors.red),
  )),
  child: SingleChildScrollView(

enter image description here

Md. Yeasin Sheikh
  • 54,221
  • 7
  • 29
  • 56