updateScrollbarPainter method Null safety

  1. @protected
void updateScrollbarPainter()
protected">@protected

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)
    ..trackRadius = widget.trackRadius
    ..trackColor = _showTrack
        ? widget.trackColor ?? const Color(0x08000000)
        : const Color(0x00000000)
    ..trackBorderColor = _showTrack
        ? widget.trackBorderColor ?? const Color(0x1a000000)
        : const Color(0x00000000)
    ..textDirection = Directionality.of(context)
    ..thickness = widget.thickness ?? _kScrollbarThickness
    ..radius = widget.radius
    ..padding = widget.padding ?? MediaQuery.of(context).padding
    ..scrollbarOrientation = widget.scrollbarOrientation
    ..mainAxisMargin = widget.mainAxisMargin
    ..shape = widget.shape
    ..crossAxisMargin = widget.crossAxisMargin
    ..minLength = widget.minThumbLength
    ..minOverscrollLength = widget.minOverscrollLength ?? widget.minThumbLength
    ..ignorePointer = !enableGestures;
}