CupertinoScrollbar constructor Null safety
- {Key? key,
- required Widget child,
- ScrollController? controller,
- bool? thumbVisibility,
- double thickness = defaultThickness,
- double thicknessWhileDragging = defaultThicknessWhileDragging,
- Radius radius = defaultRadius,
- Radius radiusWhileDragging = defaultRadiusWhileDragging,
- ScrollNotificationPredicate? notificationPredicate,
- ScrollbarOrientation? scrollbarOrientation,
- @Deprecated('Use thumbVisibility instead. ' 'This feature was deprecated after v2.9.0-1.0.pre.') bool? isAlwaysShown}
Creates an iOS style scrollbar that wraps the given child.
The child should be a source of ScrollNotification notifications, typically a Scrollable widget.
Implementation
const CupertinoScrollbar({
super.key,
required super.child,
super.controller,
bool? thumbVisibility,
double super.thickness = defaultThickness,
this.thicknessWhileDragging = defaultThicknessWhileDragging,
Radius super.radius = defaultRadius,
this.radiusWhileDragging = defaultRadiusWhileDragging,
ScrollNotificationPredicate? notificationPredicate,
super.scrollbarOrientation,
@Deprecated(
'Use thumbVisibility instead. '
'This feature was deprecated after v2.9.0-1.0.pre.',
)
bool? isAlwaysShown,
}) : assert(thickness != null),
assert(thickness < double.infinity),
assert(thicknessWhileDragging != null),
assert(thicknessWhileDragging < double.infinity),
assert(radius != null),
assert(radiusWhileDragging != null),
assert(
isAlwaysShown == null || thumbVisibility == null,
'Scrollbar thumb appearance should only be controlled with thumbVisibility, '
'isAlwaysShown is deprecated.'
),
super(
thumbVisibility: isAlwaysShown ?? thumbVisibility ?? false,
fadeDuration: _kScrollbarFadeDuration,
timeToFade: _kScrollbarTimeToFade,
pressDuration: const Duration(milliseconds: 100),
notificationPredicate: notificationPredicate ?? defaultScrollNotificationPredicate,
);