Home > Blockchain >  How can I implement scrollbar-track color in flutter?
How can I implement scrollbar-track color in flutter?

Time:10-31

I try to add track color for my flutter project but is not work for me also when i try to give thumbcolor it is work !!!

enter image description here

CodePudding user response:

Try to add this to your material App:

 theme: ThemeData.light().copyWith(
    scrollbarTheme: ScrollbarThemeData().copyWith(
      thumbColor: MaterialStateProperty.all(Colors.grey[500]),
    )

OR Scroll bar uses the highlight color, so just add your desired scrollbar color in the highlightColor inside Theme in MaterialApp:

highlightColor: Colors.red

CodePudding user response:

Use:

Theme(
  scrollbarTheme: ScrollbarThemeData(
    thumbColor: ...
    trackColor: ...
  ),
)
  • Related