MaterialScrollBarPainter constructor

MaterialScrollBarPainter({
  1. required Color color,
  2. required Animation<double> fadeoutOpacityAnimation,
  3. double? userThumbSize,
  4. Color trackColor = const Color(0x00000000),
  5. Color trackBorderColor = const Color(0x00000000),
  6. TextDirection? textDirection,
  7. double thickness = _kScrollbarThickness,
  8. EdgeInsets padding = EdgeInsets.zero,
  9. double mainAxisMargin = 0.0,
  10. double crossAxisMargin = 0.0,
  11. Radius? radius,
  12. Radius? trackRadius,
  13. OutlinedBorder? shape,
  14. double minLength = _kMinThumbExtent,
  15. double? minOverscrollLength,
  16. ScrollbarOrientation? scrollbarOrientation,
  17. bool ignorePointer = false,
})

Creates a scrollbar with customizations given by construction arguments.

Implementation

MaterialScrollBarPainter({
  required Color color,
  required this.fadeoutOpacityAnimation,
  this.userThumbSize,
  Color trackColor = const Color(0x00000000),
  Color trackBorderColor = const Color(0x00000000),
  TextDirection? textDirection,
  double thickness = _kScrollbarThickness,
  EdgeInsets padding = EdgeInsets.zero,
  double mainAxisMargin = 0.0,
  double crossAxisMargin = 0.0,
  Radius? radius,
  Radius? trackRadius,
  OutlinedBorder? shape,
  double minLength = _kMinThumbExtent,
  double? minOverscrollLength,
  ScrollbarOrientation? scrollbarOrientation,
  bool ignorePointer = false,
})  : assert(color != null),
      assert(radius == null || shape == null),
      assert(thickness != null),
      assert(fadeoutOpacityAnimation != null),
      assert(mainAxisMargin != null),
      assert(crossAxisMargin != null),
      assert(minLength != null),
      assert(minLength >= 0),
      assert(minOverscrollLength == null || minOverscrollLength <= minLength),
      assert(minOverscrollLength == null || minOverscrollLength >= 0),
      assert(padding != null),
      assert(padding.isNonNegative),
      assert(trackColor != null),
      assert(trackBorderColor != null),
      assert(ignorePointer != null),
      _color = color,
      _textDirection = textDirection,
      _thickness = thickness,
      _radius = radius,
      _shape = shape,
      _padding = padding,
      _mainAxisMargin = mainAxisMargin,
      _crossAxisMargin = crossAxisMargin,
      _minLength = minLength,
      _trackColor = trackColor,
      _trackBorderColor = trackBorderColor,
      _trackRadius = trackRadius,
      _scrollbarOrientation = scrollbarOrientation,
      _minOverscrollLength = minOverscrollLength ?? minLength,
      _ignorePointer = ignorePointer {
  fadeoutOpacityAnimation.addListener(notifyListeners);
}