Scrollbar constructor Null safety
- {Key? key,
- required Widget child,
- ScrollController? controller,
- bool? thumbVisibility,
- bool? trackVisibility,
- double? thickness,
- Radius? radius,
- ScrollNotificationPredicate? notificationPredicate,
- bool? interactive,
- ScrollbarOrientation? scrollbarOrientation,
- @Deprecated('Use thumbVisibility instead. ' 'This feature was deprecated after v2.9.0-1.0.pre.') bool? isAlwaysShown,
- @Deprecated('Use ScrollbarThemeData.trackVisibility to resolve based on the current state instead. ' 'This feature was deprecated after v2.9.0-1.0.pre.') bool? showTrackOnHover,
- @Deprecated('Use ScrollbarThemeData.thickness to resolve based on the current state instead. ' 'This feature was deprecated after v2.9.0-1.0.pre.') double? hoverThickness}
Creates a Material Design scrollbar that by default will connect to the closest Scrollable descendant of child.
The child should be a source of ScrollNotification notifications, typically a Scrollable widget.
If the controller is null, the default behavior is to enable scrollbar dragging using the PrimaryScrollController.
When null, thickness defaults to 8.0 pixels on desktop and web, and 4.0 pixels when on mobile platforms. A null radius will result in a default of an 8.0 pixel circular radius about the corners of the scrollbar thumb, except for when executing on TargetPlatform.android, which will render the thumb without a radius.
Implementation
const Scrollbar({
super.key,
required this.child,
this.controller,
this.thumbVisibility,
this.trackVisibility,
this.thickness,
this.radius,
this.notificationPredicate,
this.interactive,
this.scrollbarOrientation,
@Deprecated(
'Use thumbVisibility instead. '
'This feature was deprecated after v2.9.0-1.0.pre.',
)
this.isAlwaysShown,
@Deprecated(
'Use ScrollbarThemeData.trackVisibility to resolve based on the current state instead. '
'This feature was deprecated after v2.9.0-1.0.pre.',
)
this.showTrackOnHover,
@Deprecated(
'Use ScrollbarThemeData.thickness to resolve based on the current state instead. '
'This feature was deprecated after v2.9.0-1.0.pre.',
)
this.hoverThickness,
}) : assert(
thumbVisibility == null || isAlwaysShown == null,
'Scrollbar thumb appearance should only be controlled with thumbVisibility, '
'isAlwaysShown is deprecated.'
);