ScrollbarPainter constructor

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

Creates a scrollbar with customizations given by construction arguments.

Implementation

ScrollbarPainter({
  required this._color,
  required this.fadeoutOpacityAnimation,
  this._trackColor = const Color(0x00000000),
  this._trackBorderColor = const Color(0x00000000),
  TextDirection? textDirection,
  this._thickness = _kScrollbarThickness,
  EdgeInsetsGeometry padding = EdgeInsets.zero,
  this._mainAxisMargin = 0.0,
  this._crossAxisMargin = 0.0,
  Radius? radius,
  this._trackRadius,
  OutlinedBorder? shape,
  double minLength = _kMinThumbExtent,
  double? minOverscrollLength,
  this._scrollbarOrientation,
  this._ignorePointer = false,
}) : assert(radius == null || shape == null),
     assert(minLength >= 0),
     assert(minOverscrollLength == null || minOverscrollLength <= minLength),
     assert(minOverscrollLength == null || minOverscrollLength >= 0),
     assert(padding.isNonNegative),
     assert(
       padding is! EdgeInsetsDirectional || textDirection != null,
       'A non-null textDirection must be provided when using EdgeInsetsDirectional for padding.',
     ),
     _textDirection = textDirection,
     _radius = radius,
     _shape = shape,
     _padding = padding,
     _resolvedPadding = padding.resolve(textDirection),
     _minLength = minLength,
     _minOverscrollLength = minOverscrollLength ?? minLength {
  fadeoutOpacityAnimation.addListener(notifyListeners);
}