CupertinoScrollbar constructor Null safety

const CupertinoScrollbar(
  1. {Key? key,
  2. required Widget child,
  3. ScrollController? controller,
  4. bool? thumbVisibility,
  5. double thickness = defaultThickness,
  6. double thicknessWhileDragging = defaultThicknessWhileDragging,
  7. Radius radius = defaultRadius,
  8. Radius radiusWhileDragging = defaultRadiusWhileDragging,
  9. ScrollNotificationPredicate? notificationPredicate,
  10. ScrollbarOrientation? scrollbarOrientation,
  11. @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,
     );