scrollbarThemeData method

ScrollbarThemeData scrollbarThemeData(
  1. Palette colors
)

Implementation

ScrollbarThemeData scrollbarThemeData(Palette colors) {
  const thickness = 8.0;
  return ScrollbarThemeData(
    thumbVisibility: const WidgetStatePropertyAll(false),
    thickness: const WidgetStatePropertyAll(thickness),
    trackVisibility: const WidgetStatePropertyAll(false),
    radius: const Radius.circular(thickness / 2.0),
    thumbColor: WidgetStatePropertyAll(colors.fill),
    // Protecting the thumb from the background color is a bit tricky.
    // ex. text fields become scrollable when their content exceeds maxLines
    // and if a background color is specified, it clips over something in the
    // text field (can't remember what) and looks odd.
    //
    // Instead, ScrollbarThemeData should be overriden in cases with a
    // unknown background color.
    trackColor: const WidgetStatePropertyAll(Colors.transparent),
    trackBorderColor: const WidgetStatePropertyAll(Colors.transparent),
    interactive: true,
  );
}