RawScrollbar constructor Null safety
- {Key? key,
- required Widget child,
- ScrollController? controller,
- bool? thumbVisibility,
- OutlinedBorder? shape,
- Radius? radius,
- double? thickness,
- Color? thumbColor,
- double minThumbLength = _kMinThumbExtent,
- double? minOverscrollLength,
- bool? trackVisibility,
- Radius? trackRadius,
- Color? trackColor,
- Color? trackBorderColor,
- Duration fadeDuration = _kScrollbarFadeDuration,
- Duration timeToFade = _kScrollbarTimeToFade,
- Duration pressDuration = Duration.zero,
- ScrollNotificationPredicate notificationPredicate = defaultScrollNotificationPredicate,
- bool? interactive,
- ScrollbarOrientation? scrollbarOrientation,
- double mainAxisMargin = 0.0,
- double crossAxisMargin = 0.0,
- EdgeInsets? padding,
- @Deprecated('Use thumbVisibility instead. ' 'This feature was deprecated after v2.9.0-1.0.pre.') bool? isAlwaysShown}
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.
The child, fadeDuration, pressDuration, and timeToFade arguments must not be null.
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,
@Deprecated(
'Use thumbVisibility instead. '
'This feature was deprecated after v2.9.0-1.0.pre.',
)
this.isAlwaysShown,
}) : assert(child != null),
assert(
thumbVisibility == null || isAlwaysShown == null,
'Scrollbar thumb appearance should only be controlled with thumbVisibility, '
'isAlwaysShown is deprecated.'
),
assert(
!((thumbVisibility == false || isAlwaysShown == false) && (trackVisibility ?? false)),
'A scrollbar track cannot be drawn without a scrollbar thumb.'
),
assert(minThumbLength != null),
assert(minThumbLength >= 0),
assert(minOverscrollLength == null || minOverscrollLength <= minThumbLength),
assert(minOverscrollLength == null || minOverscrollLength >= 0),
assert(fadeDuration != null),
assert(radius == null || shape == null),
assert(timeToFade != null),
assert(pressDuration != null),
assert(mainAxisMargin != null),
assert(crossAxisMargin != null);