RawScrollbar constructor

const RawScrollbar({
  1. Key? key,
  2. required Widget child,
  3. ScrollController? controller,
  4. bool? thumbVisibility,
  5. OutlinedBorder? shape,
  6. Radius? radius,
  7. double? thickness,
  8. Color? thumbColor,
  9. double minThumbLength = _kMinThumbExtent,
  10. double? minOverscrollLength,
  11. bool? trackVisibility,
  12. Radius? trackRadius,
  13. Color? trackColor,
  14. Color? trackBorderColor,
  15. Duration fadeDuration = _kScrollbarFadeDuration,
  16. Duration timeToFade = _kScrollbarTimeToFade,
  17. Duration pressDuration = Duration.zero,
  18. ScrollNotificationPredicate notificationPredicate = defaultScrollNotificationPredicate,
  19. bool? interactive,
  20. ScrollbarOrientation? scrollbarOrientation,
  21. double mainAxisMargin = 0.0,
  22. double crossAxisMargin = 0.0,
  23. EdgeInsets? padding,
})

Creates a basic raw scrollbar that wraps the given child.

The child, or a descendant of the child, should be a source of ScrollNotification notifications, typically a Scrollable widget.

Implementation

const RawScrollbar({
  super.key,
  required this.child,
  this.controller,
  this.thumbVisibility,
  this.shape,
  this.radius,
  this.thickness,
  this.thumbColor,
  this.minThumbLength = _kMinThumbExtent,
  this.minOverscrollLength,
  this.trackVisibility,
  this.trackRadius,
  this.trackColor,
  this.trackBorderColor,
  this.fadeDuration = _kScrollbarFadeDuration,
  this.timeToFade = _kScrollbarTimeToFade,
  this.pressDuration = Duration.zero,
  this.notificationPredicate = defaultScrollNotificationPredicate,
  this.interactive,
  this.scrollbarOrientation,
  this.mainAxisMargin = 0.0,
  this.crossAxisMargin = 0.0,
  this.padding,
}) : assert(
       !(thumbVisibility == false && (trackVisibility ?? false)),
       'A scrollbar track cannot be drawn without a scrollbar thumb.',
     ),
     assert(minThumbLength >= 0),
     assert(minOverscrollLength == null || minOverscrollLength <= minThumbLength),
     assert(minOverscrollLength == null || minOverscrollLength >= 0),
     assert(radius == null || shape == null);