updateScrollbarPainter method

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

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

@override
void updateScrollbarPainter(bool vertical) {
  PublicScrollbarPainter scrollbarPainter =
      vertical ? verticalScrollbar : horizontalScrollbar;
  scrollbarPainter
    ..color = CupertinoDynamicColor.resolve(_kScrollbarColor, context)
    ..textDirection = Directionality.of(context)
    ..thickness = vertical ? _thicknessV : _thicknessH
    ..mainAxisMargin = _kScrollbarMainAxisMargin
    ..crossAxisMargin = _kScrollbarCrossAxisMargin
    ..radius = vertical ? _radiusV : _radiusH
    ..padding = MediaQuery.paddingOf(context)
    ..minLength = _kScrollbarMinLength
    ..minOverscrollLength = _kScrollbarMinOverscrollLength;
}