updateScrollbarPainter method

  1. @protected
void updateScrollbarPainter(
  1. bool vertical
)

This method is responsible for configuring one scrollbarPainter according to the widget's properties and any inherited widgets the painter depends on, like Directionality and MediaQuery.

This method is called by updateScrollbarPainters for each scrollbarPainter. Subclasses can override to configure the scrollbarPainter.

Implementation

@protected
void updateScrollbarPainter(bool vertical) {
  PublicScrollbarPainter scrollbarPainter =
      vertical ? verticalScrollbar : horizontalScrollbar;
  scrollbarPainter
    ..color = thumbColor ?? const Color(0x66BCBCBC)
    ..trackRadius = trackRadius
    ..trackColor = (vertical ? _showTrackV : _showTrackH)
        ? trackColor ?? const Color(0x08000000)
        : const Color(0x00000000)
    ..trackBorderColor = (vertical ? _showTrackV : _showTrackH)
        ? trackBorderColor ?? const Color(0x1a000000)
        : const Color(0x00000000)
    ..textDirection = Directionality.of(context)
    ..thickness = thickness ?? _kScrollbarThickness
    ..radius = radius
    ..padding = padding ?? MediaQuery.paddingOf(context)
    ..mainAxisMargin = mainAxisMargin
    ..shape = shape
    ..crossAxisMargin = crossAxisMargin
    ..minLength = minThumbLength
    ..minOverscrollLength = minOverscrollLength ?? minThumbLength
    ..ignorePointer = !enableGestures;
}