updateScrollbarPainter method Null safety

  1. @protected
void updateScrollbarPainter()

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

Subclasses can override to configure the scrollbarPainter.

Implementation

@protected
void  updateScrollbarPainter() {
  scrollbarPainter
    ..color =  widget.thumbColor ?? const Color(0x66BCBCBC)
    ..textDirection = Directionality.of(context)
    ..thickness = widget.thickness ?? _kScrollbarThickness
    ..radius = widget.radius
    ..padding = MediaQuery.of(context).padding
    ..scrollbarOrientation = widget.scrollbarOrientation
    ..mainAxisMargin = widget.mainAxisMargin
    ..crossAxisMargin = widget.crossAxisMargin
    ..minLength = widget.minThumbLength
    ..minOverscrollLength = widget.minOverscrollLength ?? widget.minThumbLength;
}