PlutoScrollbar constructor

const PlutoScrollbar({
  1. Key? key,
  2. ScrollController? horizontalController,
  3. ScrollController? verticalController,
  4. bool isAlwaysShown = false,
  5. bool onlyDraggingThumb = true,
  6. bool enableHover = true,
  7. bool enableScrollAfterDragEnd = true,
  8. double thickness = defaultThickness,
  9. double thicknessWhileDragging = defaultThicknessWhileDragging,
  10. double hoverWidth = defaultScrollbarHoverWidth,
  11. double? mainAxisMargin,
  12. double? crossAxisMargin,
  13. Color? scrollBarColor,
  14. Color? scrollBarTrackColor,
  15. Duration? longPressDuration,
  16. Radius radius = defaultRadius,
  17. Radius radiusWhileDragging = defaultRadiusWhileDragging,
  18. required Widget child,
})

Implementation

const PlutoScrollbar({
  super.key,
  this.horizontalController,
  this.verticalController,
  this.isAlwaysShown = false,
  this.onlyDraggingThumb = true,
  this.enableHover = true,
  this.enableScrollAfterDragEnd = true,
  this.thickness = defaultThickness,
  this.thicknessWhileDragging = defaultThicknessWhileDragging,
  this.hoverWidth = defaultScrollbarHoverWidth,
  double? mainAxisMargin,
  double? crossAxisMargin,
  Color? scrollBarColor,
  Color? scrollBarTrackColor,
  Duration? longPressDuration,
  this.radius = defaultRadius,
  this.radiusWhileDragging = defaultRadiusWhileDragging,
  required this.child,
})  : assert(thickness < double.infinity),
      assert(thicknessWhileDragging < double.infinity),
      assert(!isAlwaysShown ||
          (horizontalController != null || verticalController != null)),
      mainAxisMargin = mainAxisMargin ?? _kScrollbarMainAxisMargin,
      crossAxisMargin = crossAxisMargin ?? _kScrollbarCrossAxisMargin,
      scrollBarColor = scrollBarColor ?? _kScrollbarColor,
      scrollBarTrackColor = scrollBarTrackColor ?? _kTrackColor,
      longPressDuration = longPressDuration ?? _kScrollbarLongPressDuration;