Unverified Commit a3ddead1 authored by Kate Lovett's avatar Kate Lovett Committed by GitHub

Remove scrollbar deprecations isAlwaysShown and hoverThickness (#127351)

The deprecated `[RawScrollbar/Scrollbar/CupertinoScrollbar/ScrollbarThemeData].isAlwaysShown` has expired and is removed in thi PR.
Also, `Scrollbar.hoverThickness` is also removed after having expired.

The replacement for `isAlwaysShown` is `thumbVisibility`. This deprecation was introduced in #96957. The name change came from new behaviors like a track that is conditionally visible. Since the original API only referred to the thumb, the name was changed to reflect this intention. This change is supported by dart fix. ✅ 

The replacement for `hoverThickness` is `ScrollbarThemeData.thickness`, which is a MaterialStateProperty that allows for the thickness to respond to multiple states including hover. This deprecation was introduced in #97173. This change is not supported by dart fix. 😞  

Part of https://github.com/flutter/flutter/issues/127042
parent 9a263466
...@@ -53,8 +53,7 @@ const double _kScrollbarCrossAxisMargin = 3.0; ...@@ -53,8 +53,7 @@ const double _kScrollbarCrossAxisMargin = 3.0;
/// {@tool dartpad} /// {@tool dartpad}
/// When [thumbVisibility] is true, the scrollbar thumb will remain visible without the /// When [thumbVisibility] is true, the scrollbar thumb will remain visible without the
/// fade animation. This requires that a [ScrollController] is provided to controller, /// fade animation. This requires that a [ScrollController] is provided to controller,
/// or that the [PrimaryScrollController] is available. [isAlwaysShown] is /// or that the [PrimaryScrollController] is available.
/// deprecated in favor of `thumbVisibility`.
/// ///
/// ** See code in examples/api/lib/cupertino/scrollbar/cupertino_scrollbar.1.dart ** /// ** See code in examples/api/lib/cupertino/scrollbar/cupertino_scrollbar.1.dart **
/// {@end-tool} /// {@end-tool}
...@@ -82,20 +81,10 @@ class CupertinoScrollbar extends RawScrollbar { ...@@ -82,20 +81,10 @@ class CupertinoScrollbar extends RawScrollbar {
this.radiusWhileDragging = defaultRadiusWhileDragging, this.radiusWhileDragging = defaultRadiusWhileDragging,
ScrollNotificationPredicate? notificationPredicate, ScrollNotificationPredicate? notificationPredicate,
super.scrollbarOrientation, super.scrollbarOrientation,
@Deprecated(
'Use thumbVisibility instead. '
'This feature was deprecated after v2.9.0-1.0.pre.',
)
bool? isAlwaysShown,
}) : assert(thickness < double.infinity), }) : assert(thickness < double.infinity),
assert(thicknessWhileDragging < double.infinity), assert(thicknessWhileDragging < double.infinity),
assert(
isAlwaysShown == null || thumbVisibility == null,
'Scrollbar thumb appearance should only be controlled with thumbVisibility, '
'isAlwaysShown is deprecated.'
),
super( super(
thumbVisibility: isAlwaysShown ?? thumbVisibility ?? false, thumbVisibility: thumbVisibility ?? false,
fadeDuration: _kScrollbarFadeDuration, fadeDuration: _kScrollbarFadeDuration,
timeToFade: _kScrollbarTimeToFade, timeToFade: _kScrollbarTimeToFade,
pressDuration: const Duration(milliseconds: 100), pressDuration: const Duration(milliseconds: 100),
......
...@@ -95,26 +95,12 @@ class Scrollbar extends StatelessWidget { ...@@ -95,26 +95,12 @@ class Scrollbar extends StatelessWidget {
this.notificationPredicate, this.notificationPredicate,
this.interactive, this.interactive,
this.scrollbarOrientation, this.scrollbarOrientation,
@Deprecated(
'Use thumbVisibility instead. '
'This feature was deprecated after v2.9.0-1.0.pre.',
)
this.isAlwaysShown,
@Deprecated( @Deprecated(
'Use ScrollbarThemeData.trackVisibility to resolve based on the current state instead. ' 'Use ScrollbarThemeData.trackVisibility to resolve based on the current state instead. '
'This feature was deprecated after v3.4.0-19.0.pre.', 'This feature was deprecated after v3.4.0-19.0.pre.',
) )
this.showTrackOnHover, 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.'
);
/// {@macro flutter.widgets.Scrollbar.child} /// {@macro flutter.widgets.Scrollbar.child}
final Widget child; final Widget child;
...@@ -131,20 +117,8 @@ class Scrollbar extends StatelessWidget { ...@@ -131,20 +117,8 @@ class Scrollbar extends StatelessWidget {
/// If the thumb visibility is related to the scrollbar's material state, /// If the thumb visibility is related to the scrollbar's material state,
/// use the global [ScrollbarThemeData.thumbVisibility] or override the /// use the global [ScrollbarThemeData.thumbVisibility] or override the
/// sub-tree's theme data. /// sub-tree's theme data.
///
/// Replaces deprecated [isAlwaysShown].
final bool? thumbVisibility; final bool? thumbVisibility;
/// {@macro flutter.widgets.Scrollbar.isAlwaysShown}
///
/// To show the scrollbar thumb based on a [MaterialState], use
/// [ScrollbarThemeData.thumbVisibility].
@Deprecated(
'Use thumbVisibility instead. '
'This feature was deprecated after v2.9.0-1.0.pre.',
)
final bool? isAlwaysShown;
/// {@macro flutter.widgets.Scrollbar.trackVisibility} /// {@macro flutter.widgets.Scrollbar.trackVisibility}
/// ///
/// If this property is null, then [ScrollbarThemeData.trackVisibility] of /// If this property is null, then [ScrollbarThemeData.trackVisibility] of
...@@ -172,21 +146,6 @@ class Scrollbar extends StatelessWidget { ...@@ -172,21 +146,6 @@ class Scrollbar extends StatelessWidget {
) )
final bool? showTrackOnHover; final bool? showTrackOnHover;
/// The thickness of the scrollbar when a hover state is active and
/// [showTrackOnHover] is true.
///
/// If this property is null, then [ScrollbarThemeData.thickness] of
/// [ThemeData.scrollbarTheme] is used to resolve a thickness. If that is also
/// null, the default value is 12.0 pixels.
///
/// This is deprecated, use [ScrollbarThemeData.thickness] to resolve based on
/// the current state instead.
@Deprecated(
'Use ScrollbarThemeData.thickness to resolve based on the current state instead. '
'This feature was deprecated after v2.9.0-1.0.pre.',
)
final double? hoverThickness;
/// The thickness of the scrollbar in the cross axis of the scrollable. /// The thickness of the scrollbar in the cross axis of the scrollable.
/// ///
/// If null, the default value is platform dependent. On [TargetPlatform.android], /// If null, the default value is platform dependent. On [TargetPlatform.android],
...@@ -216,7 +175,7 @@ class Scrollbar extends StatelessWidget { ...@@ -216,7 +175,7 @@ class Scrollbar extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (Theme.of(context).platform == TargetPlatform.iOS) { if (Theme.of(context).platform == TargetPlatform.iOS) {
return CupertinoScrollbar( return CupertinoScrollbar(
thumbVisibility: isAlwaysShown ?? thumbVisibility ?? false, thumbVisibility: thumbVisibility ?? false,
thickness: thickness ?? CupertinoScrollbar.defaultThickness, thickness: thickness ?? CupertinoScrollbar.defaultThickness,
thicknessWhileDragging: thickness ?? CupertinoScrollbar.defaultThicknessWhileDragging, thicknessWhileDragging: thickness ?? CupertinoScrollbar.defaultThicknessWhileDragging,
radius: radius ?? CupertinoScrollbar.defaultRadius, radius: radius ?? CupertinoScrollbar.defaultRadius,
...@@ -229,10 +188,9 @@ class Scrollbar extends StatelessWidget { ...@@ -229,10 +188,9 @@ class Scrollbar extends StatelessWidget {
} }
return _MaterialScrollbar( return _MaterialScrollbar(
controller: controller, controller: controller,
thumbVisibility: isAlwaysShown ?? thumbVisibility, thumbVisibility: thumbVisibility,
trackVisibility: trackVisibility, trackVisibility: trackVisibility,
showTrackOnHover: showTrackOnHover, showTrackOnHover: showTrackOnHover,
hoverThickness: hoverThickness,
thickness: thickness, thickness: thickness,
radius: radius, radius: radius,
notificationPredicate: notificationPredicate, notificationPredicate: notificationPredicate,
...@@ -250,7 +208,6 @@ class _MaterialScrollbar extends RawScrollbar { ...@@ -250,7 +208,6 @@ class _MaterialScrollbar extends RawScrollbar {
super.thumbVisibility, super.thumbVisibility,
super.trackVisibility, super.trackVisibility,
this.showTrackOnHover, this.showTrackOnHover,
this.hoverThickness,
super.thickness, super.thickness,
super.radius, super.radius,
ScrollNotificationPredicate? notificationPredicate, ScrollNotificationPredicate? notificationPredicate,
...@@ -264,7 +221,6 @@ class _MaterialScrollbar extends RawScrollbar { ...@@ -264,7 +221,6 @@ class _MaterialScrollbar extends RawScrollbar {
); );
final bool? showTrackOnHover; final bool? showTrackOnHover;
final double? hoverThickness;
@override @override
_MaterialScrollbarState createState() => _MaterialScrollbarState(); _MaterialScrollbarState createState() => _MaterialScrollbarState();
...@@ -280,7 +236,7 @@ class _MaterialScrollbarState extends RawScrollbarState<_MaterialScrollbar> { ...@@ -280,7 +236,7 @@ class _MaterialScrollbarState extends RawScrollbarState<_MaterialScrollbar> {
late bool _useAndroidScrollbar; late bool _useAndroidScrollbar;
@override @override
bool get showScrollbar => widget.thumbVisibility ?? _scrollbarTheme.thumbVisibility?.resolve(_states) ?? _scrollbarTheme.isAlwaysShown ?? false; bool get showScrollbar => widget.thumbVisibility ?? _scrollbarTheme.thumbVisibility?.resolve(_states) ?? false;
@override @override
bool get enableGestures => widget.interactive ?? _scrollbarTheme.interactive ?? !_useAndroidScrollbar; bool get enableGestures => widget.interactive ?? _scrollbarTheme.interactive ?? !_useAndroidScrollbar;
...@@ -370,8 +326,7 @@ class _MaterialScrollbarState extends RawScrollbarState<_MaterialScrollbar> { ...@@ -370,8 +326,7 @@ class _MaterialScrollbarState extends RawScrollbarState<_MaterialScrollbar> {
MaterialStateProperty<double> get _thickness { MaterialStateProperty<double> get _thickness {
return MaterialStateProperty.resolveWith((Set<MaterialState> states) { return MaterialStateProperty.resolveWith((Set<MaterialState> states) {
if (states.contains(MaterialState.hovered) && _trackVisibility.resolve(states)) { if (states.contains(MaterialState.hovered) && _trackVisibility.resolve(states)) {
return widget.hoverThickness return _scrollbarTheme.thickness?.resolve(states)
?? _scrollbarTheme.thickness?.resolve(states)
?? _kScrollbarThicknessWithTrack; ?? _kScrollbarThicknessWithTrack;
} }
// The default scrollbar thickness is smaller on mobile. // The default scrollbar thickness is smaller on mobile.
......
...@@ -45,26 +45,15 @@ class ScrollbarThemeData with Diagnosticable { ...@@ -45,26 +45,15 @@ class ScrollbarThemeData with Diagnosticable {
this.mainAxisMargin, this.mainAxisMargin,
this.minThumbLength, this.minThumbLength,
this.interactive, this.interactive,
@Deprecated(
'Use thumbVisibility instead. '
'This feature was deprecated after v2.9.0-1.0.pre.',
)
this.isAlwaysShown,
@Deprecated( @Deprecated(
'Use ScrollbarThemeData.trackVisibility to resolve based on the current state instead. ' 'Use ScrollbarThemeData.trackVisibility to resolve based on the current state instead. '
'This feature was deprecated after v3.4.0-19.0.pre.', 'This feature was deprecated after v3.4.0-19.0.pre.',
) )
this.showTrackOnHover, this.showTrackOnHover,
}) : assert( });
isAlwaysShown == null || thumbVisibility == null,
'Scrollbar thumb appearance should only be controlled with thumbVisibility, '
'isAlwaysShown is deprecated.'
);
/// Overrides the default value of [Scrollbar.thumbVisibility] in all /// Overrides the default value of [Scrollbar.thumbVisibility] in all
/// descendant [Scrollbar] widgets. /// descendant [Scrollbar] widgets.
///
/// Replaces deprecated [isAlwaysShown].
final MaterialStateProperty<bool?>? thumbVisibility; final MaterialStateProperty<bool?>? thumbVisibility;
/// Overrides the default value of [Scrollbar.thickness] in all /// Overrides the default value of [Scrollbar.thickness] in all
...@@ -86,16 +75,6 @@ class ScrollbarThemeData with Diagnosticable { ...@@ -86,16 +75,6 @@ class ScrollbarThemeData with Diagnosticable {
) )
final bool? showTrackOnHover; final bool? showTrackOnHover;
/// Overrides the default value of [Scrollbar.isAlwaysShown] in all
/// descendant [Scrollbar] widgets.
///
/// Deprecated in favor of [thumbVisibility].
@Deprecated(
'Use thumbVisibility instead. '
'This feature was deprecated after v2.9.0-1.0.pre.',
)
final bool? isAlwaysShown;
/// Overrides the default value of [Scrollbar.interactive] in all /// Overrides the default value of [Scrollbar.interactive] in all
/// descendant [Scrollbar] widgets. /// descendant [Scrollbar] widgets.
final bool? interactive; final bool? interactive;
...@@ -169,12 +148,6 @@ class ScrollbarThemeData with Diagnosticable { ...@@ -169,12 +148,6 @@ class ScrollbarThemeData with Diagnosticable {
double? crossAxisMargin, double? crossAxisMargin,
double? mainAxisMargin, double? mainAxisMargin,
double? minThumbLength, double? minThumbLength,
@Deprecated(
'Use thumbVisibility instead. '
'This feature was deprecated after v2.9.0-1.0.pre.',
)
bool? isAlwaysShown,
@Deprecated( @Deprecated(
'Use ScrollbarThemeData.trackVisibility to resolve based on the current state instead. ' 'Use ScrollbarThemeData.trackVisibility to resolve based on the current state instead. '
'This feature was deprecated after v3.4.0-19.0.pre.', 'This feature was deprecated after v3.4.0-19.0.pre.',
...@@ -186,7 +159,6 @@ class ScrollbarThemeData with Diagnosticable { ...@@ -186,7 +159,6 @@ class ScrollbarThemeData with Diagnosticable {
thickness: thickness ?? this.thickness, thickness: thickness ?? this.thickness,
trackVisibility: trackVisibility ?? this.trackVisibility, trackVisibility: trackVisibility ?? this.trackVisibility,
showTrackOnHover: showTrackOnHover ?? this.showTrackOnHover, showTrackOnHover: showTrackOnHover ?? this.showTrackOnHover,
isAlwaysShown: isAlwaysShown ?? this.isAlwaysShown,
interactive: interactive ?? this.interactive, interactive: interactive ?? this.interactive,
radius: radius ?? this.radius, radius: radius ?? this.radius,
thumbColor: thumbColor ?? this.thumbColor, thumbColor: thumbColor ?? this.thumbColor,
...@@ -212,7 +184,6 @@ class ScrollbarThemeData with Diagnosticable { ...@@ -212,7 +184,6 @@ class ScrollbarThemeData with Diagnosticable {
thickness: MaterialStateProperty.lerp<double?>(a?.thickness, b?.thickness, t, lerpDouble), thickness: MaterialStateProperty.lerp<double?>(a?.thickness, b?.thickness, t, lerpDouble),
trackVisibility: MaterialStateProperty.lerp<bool?>(a?.trackVisibility, b?.trackVisibility, t, _lerpBool), trackVisibility: MaterialStateProperty.lerp<bool?>(a?.trackVisibility, b?.trackVisibility, t, _lerpBool),
showTrackOnHover: _lerpBool(a?.showTrackOnHover, b?.showTrackOnHover, t), showTrackOnHover: _lerpBool(a?.showTrackOnHover, b?.showTrackOnHover, t),
isAlwaysShown: _lerpBool(a?.isAlwaysShown, b?.isAlwaysShown, t),
interactive: _lerpBool(a?.interactive, b?.interactive, t), interactive: _lerpBool(a?.interactive, b?.interactive, t),
radius: Radius.lerp(a?.radius, b?.radius, t), radius: Radius.lerp(a?.radius, b?.radius, t),
thumbColor: MaterialStateProperty.lerp<Color?>(a?.thumbColor, b?.thumbColor, t, Color.lerp), thumbColor: MaterialStateProperty.lerp<Color?>(a?.thumbColor, b?.thumbColor, t, Color.lerp),
...@@ -230,7 +201,6 @@ class ScrollbarThemeData with Diagnosticable { ...@@ -230,7 +201,6 @@ class ScrollbarThemeData with Diagnosticable {
thickness, thickness,
trackVisibility, trackVisibility,
showTrackOnHover, showTrackOnHover,
isAlwaysShown,
interactive, interactive,
radius, radius,
thumbColor, thumbColor,
...@@ -254,7 +224,6 @@ class ScrollbarThemeData with Diagnosticable { ...@@ -254,7 +224,6 @@ class ScrollbarThemeData with Diagnosticable {
&& other.thickness == thickness && other.thickness == thickness
&& other.trackVisibility == trackVisibility && other.trackVisibility == trackVisibility
&& other.showTrackOnHover == showTrackOnHover && other.showTrackOnHover == showTrackOnHover
&& other.isAlwaysShown == isAlwaysShown
&& other.interactive == interactive && other.interactive == interactive
&& other.radius == radius && other.radius == radius
&& other.thumbColor == thumbColor && other.thumbColor == thumbColor
...@@ -272,7 +241,6 @@ class ScrollbarThemeData with Diagnosticable { ...@@ -272,7 +241,6 @@ class ScrollbarThemeData with Diagnosticable {
properties.add(DiagnosticsProperty<MaterialStateProperty<double?>>('thickness', thickness, defaultValue: null)); properties.add(DiagnosticsProperty<MaterialStateProperty<double?>>('thickness', thickness, defaultValue: null));
properties.add(DiagnosticsProperty<MaterialStateProperty<bool?>>('trackVisibility', trackVisibility, defaultValue: null)); properties.add(DiagnosticsProperty<MaterialStateProperty<bool?>>('trackVisibility', trackVisibility, defaultValue: null));
properties.add(DiagnosticsProperty<bool>('showTrackOnHover', showTrackOnHover, defaultValue: null)); properties.add(DiagnosticsProperty<bool>('showTrackOnHover', showTrackOnHover, defaultValue: null));
properties.add(DiagnosticsProperty<bool>('isAlwaysShown', isAlwaysShown, defaultValue: null));
properties.add(DiagnosticsProperty<bool>('interactive', interactive, defaultValue: null)); properties.add(DiagnosticsProperty<bool>('interactive', interactive, defaultValue: null));
properties.add(DiagnosticsProperty<Radius>('radius', radius, defaultValue: null)); properties.add(DiagnosticsProperty<Radius>('radius', radius, defaultValue: null));
properties.add(DiagnosticsProperty<MaterialStateProperty<Color?>>('thumbColor', thumbColor, defaultValue: null)); properties.add(DiagnosticsProperty<MaterialStateProperty<Color?>>('thumbColor', thumbColor, defaultValue: null));
......
...@@ -984,19 +984,9 @@ class RawScrollbar extends StatefulWidget { ...@@ -984,19 +984,9 @@ class RawScrollbar extends StatefulWidget {
this.mainAxisMargin = 0.0, this.mainAxisMargin = 0.0,
this.crossAxisMargin = 0.0, this.crossAxisMargin = 0.0,
this.padding, this.padding,
@Deprecated(
'Use thumbVisibility instead. '
'This feature was deprecated after v2.9.0-1.0.pre.',
)
this.isAlwaysShown,
}) : assert( }) : assert(
thumbVisibility == null || isAlwaysShown == null, !(thumbVisibility == false && (trackVisibility ?? false)),
'Scrollbar thumb appearance should only be controlled with thumbVisibility, ' 'A scrollbar track cannot be drawn without a scrollbar thumb.',
'isAlwaysShown is deprecated.'
),
assert(
!((thumbVisibility == false || isAlwaysShown == false) && (trackVisibility ?? false)),
'A scrollbar track cannot be drawn without a scrollbar thumb.'
), ),
assert(minThumbLength >= 0), assert(minThumbLength >= 0),
assert(minOverscrollLength == null || minOverscrollLength <= minThumbLength), assert(minOverscrollLength == null || minOverscrollLength <= minThumbLength),
...@@ -1149,100 +1139,12 @@ class RawScrollbar extends StatefulWidget { ...@@ -1149,100 +1139,12 @@ class RawScrollbar extends StatefulWidget {
/// scroll view associated with the parent [PrimaryScrollController]. /// scroll view associated with the parent [PrimaryScrollController].
/// * [PrimaryScrollController], which associates a [ScrollController] with /// * [PrimaryScrollController], which associates a [ScrollController] with
/// a subtree. /// a subtree.
///
/// Replaces deprecated [isAlwaysShown].
/// {@endtemplate} /// {@endtemplate}
/// ///
/// Subclass [Scrollbar] can hide and show the scrollbar thumb in response to /// Subclass [Scrollbar] can hide and show the scrollbar thumb in response to
/// [MaterialState]s by using [ScrollbarThemeData.thumbVisibility]. /// [MaterialState]s by using [ScrollbarThemeData.thumbVisibility].
final bool? thumbVisibility; final bool? thumbVisibility;
/// {@template flutter.widgets.Scrollbar.isAlwaysShown}
/// Indicates that the scrollbar thumb should be visible, even when a scroll
/// is not underway.
///
/// When false, the scrollbar will be shown during scrolling
/// and will fade out otherwise.
///
/// When true, the scrollbar will always be visible and never fade out. This
/// requires that the Scrollbar can access the [ScrollController] of the
/// associated Scrollable widget. This can either be the provided [controller],
/// or the [PrimaryScrollController] of the current context.
///
/// * When providing a controller, the same ScrollController must also be
/// provided to the associated Scrollable widget.
/// * The [PrimaryScrollController] is used by default for a [ScrollView]
/// that has not been provided a [ScrollController] and that has a
/// [ScrollView.scrollDirection] of [Axis.vertical]. This automatic
/// behavior does not apply to those with Axis.horizontal. To explicitly
/// use the PrimaryScrollController, set [ScrollView.primary] to true.
///
/// Defaults to false when null.
///
/// {@tool snippet}
///
/// ```dart
/// // (e.g. in a stateful widget)
///
/// final ScrollController controllerOne = ScrollController();
/// final ScrollController controllerTwo = ScrollController();
///
/// @override
/// Widget build(BuildContext context) {
/// return Column(
/// children: <Widget>[
/// SizedBox(
/// height: 200,
/// child: Scrollbar(
/// thumbVisibility: true,
/// controller: controllerOne,
/// child: ListView.builder(
/// controller: controllerOne,
/// itemCount: 120,
/// itemBuilder: (BuildContext context, int index) {
/// return Text('item $index');
/// },
/// ),
/// ),
/// ),
/// SizedBox(
/// height: 200,
/// child: CupertinoScrollbar(
/// thumbVisibility: true,
/// controller: controllerTwo,
/// child: SingleChildScrollView(
/// controller: controllerTwo,
/// child: const SizedBox(
/// height: 2000,
/// width: 500,
/// child: Placeholder(),
/// ),
/// ),
/// ),
/// ),
/// ],
/// );
/// }
/// ```
/// {@end-tool}
///
/// See also:
///
/// * [RawScrollbarState.showScrollbar], an overridable getter which uses
/// this value to override the default behavior.
/// * [ScrollView.primary], which indicates whether the ScrollView is the primary
/// scroll view associated with the parent [PrimaryScrollController].
/// * [PrimaryScrollController], which associates a [ScrollController] with
/// a subtree.
///
/// This is deprecated, [thumbVisibility] should be used instead.
/// {@endtemplate}
@Deprecated(
'Use thumbVisibility instead. '
'This feature was deprecated after v2.9.0-1.0.pre.',
)
final bool? isAlwaysShown;
/// The [OutlinedBorder] of the scrollbar's thumb. /// The [OutlinedBorder] of the scrollbar's thumb.
/// ///
/// Only one of [radius] and [shape] may be specified. For a rounded rectangle, /// Only one of [radius] and [shape] may be specified. For a rounded rectangle,
...@@ -1453,14 +1355,9 @@ class RawScrollbarState<T extends RawScrollbar> extends State<T> with TickerProv ...@@ -1453,14 +1355,9 @@ class RawScrollbarState<T extends RawScrollbar> extends State<T> with TickerProv
/// Subclasses can override this getter to make its value depend on an inherited /// Subclasses can override this getter to make its value depend on an inherited
/// theme. /// theme.
/// ///
/// Defaults to false when [RawScrollbar.isAlwaysShown] or /// Defaults to false when [RawScrollbar.thumbVisibility] is null.
/// [RawScrollbar.thumbVisibility] is null.
///
/// See also:
///
/// * [RawScrollbar.isAlwaysShown], which overrides the default behavior.
@protected @protected
bool get showScrollbar => widget.isAlwaysShown ?? widget.thumbVisibility ?? false; bool get showScrollbar => widget.thumbVisibility ?? false;
bool get _showTrack => showScrollbar && (widget.trackVisibility ?? false); bool get _showTrack => showScrollbar && (widget.trackVisibility ?? false);
...@@ -1546,9 +1443,7 @@ class RawScrollbarState<T extends RawScrollbar> extends State<T> with TickerProv ...@@ -1546,9 +1443,7 @@ class RawScrollbarState<T extends RawScrollbar> extends State<T> with TickerProv
: 'provided ScrollController'; : 'provided ScrollController';
String when = ''; String when = '';
if (widget.isAlwaysShown ?? false) { if (widget.thumbVisibility ?? false) {
when = 'Scrollbar.isAlwaysShown is true';
} else if (widget.thumbVisibility ?? false) {
when = 'Scrollbar.thumbVisibility is true'; when = 'Scrollbar.thumbVisibility is true';
} else if (enableGestures) { } else if (enableGestures) {
when = 'the scrollbar is interactive'; when = 'the scrollbar is interactive';
...@@ -1658,9 +1553,8 @@ class RawScrollbarState<T extends RawScrollbar> extends State<T> with TickerProv ...@@ -1658,9 +1553,8 @@ class RawScrollbarState<T extends RawScrollbar> extends State<T> with TickerProv
@override @override
void didUpdateWidget(T oldWidget) { void didUpdateWidget(T oldWidget) {
super.didUpdateWidget(oldWidget); super.didUpdateWidget(oldWidget);
if (widget.isAlwaysShown != oldWidget.isAlwaysShown if (widget.thumbVisibility != oldWidget.thumbVisibility) {
|| widget.thumbVisibility != oldWidget.thumbVisibility) { if (widget.thumbVisibility ?? false) {
if ((widget.isAlwaysShown ?? false) || (widget.thumbVisibility ?? false)) {
assert(_debugScheduleCheckHasValidScrollPosition()); assert(_debugScheduleCheckHasValidScrollPosition());
_fadeoutTimer?.cancel(); _fadeoutTimer?.cancel();
_fadeoutAnimationController.animateTo(1.0); _fadeoutAnimationController.animateTo(1.0);
......
...@@ -400,14 +400,14 @@ void main() { ...@@ -400,14 +400,14 @@ void main() {
}, },
); );
testWidgets('When isAlwaysShown is true, must pass a controller or find PrimaryScrollController', (WidgetTester tester) async { testWidgets('When thumbVisibility is true, must pass a controller or find PrimaryScrollController', (WidgetTester tester) async {
Widget viewWithScroll() { Widget viewWithScroll() {
return const Directionality( return const Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: MediaQuery( child: MediaQuery(
data: MediaQueryData(), data: MediaQueryData(),
child: CupertinoScrollbar( child: CupertinoScrollbar(
isAlwaysShown: true, thumbVisibility: true,
child: SingleChildScrollView( child: SingleChildScrollView(
child: SizedBox( child: SizedBox(
width: 4000.0, width: 4000.0,
...@@ -425,7 +425,7 @@ void main() { ...@@ -425,7 +425,7 @@ void main() {
}, },
); );
testWidgets('When isAlwaysShown is true, must pass a controller or find PrimaryScrollController that is attached to a scroll view', (WidgetTester tester) async { testWidgets('When thumbVisibility is true, must pass a controller or find PrimaryScrollController that is attached to a scroll view', (WidgetTester tester) async {
final ScrollController controller = ScrollController(); final ScrollController controller = ScrollController();
Widget viewWithScroll() { Widget viewWithScroll() {
return Directionality( return Directionality(
...@@ -434,7 +434,7 @@ void main() { ...@@ -434,7 +434,7 @@ void main() {
data: const MediaQueryData(), data: const MediaQueryData(),
child: CupertinoScrollbar( child: CupertinoScrollbar(
controller: controller, controller: controller,
isAlwaysShown: true, thumbVisibility: true,
child: const SingleChildScrollView( child: const SingleChildScrollView(
child: SizedBox( child: SizedBox(
width: 4000.0, width: 4000.0,
...@@ -526,7 +526,7 @@ void main() { ...@@ -526,7 +526,7 @@ void main() {
expect(find.byType(CupertinoScrollbar), paints..rrect()); expect(find.byType(CupertinoScrollbar), paints..rrect());
}); });
testWidgets('On first render with isAlwaysShown: true, the thumb shows with PrimaryScrollController', (WidgetTester tester) async { testWidgets('On first render with thumbVisibility: true, the thumb shows with PrimaryScrollController', (WidgetTester tester) async {
final ScrollController controller = ScrollController(); final ScrollController controller = ScrollController();
Widget viewWithScroll() { Widget viewWithScroll() {
return Directionality( return Directionality(
...@@ -538,7 +538,7 @@ void main() { ...@@ -538,7 +538,7 @@ void main() {
child: Builder( child: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return const CupertinoScrollbar( return const CupertinoScrollbar(
isAlwaysShown: true, thumbVisibility: true,
child: SingleChildScrollView( child: SingleChildScrollView(
primary: true, primary: true,
child: SizedBox( child: SizedBox(
...@@ -560,7 +560,7 @@ void main() { ...@@ -560,7 +560,7 @@ void main() {
}, },
); );
testWidgets('On first render with isAlwaysShown: true, the thumb shows', (WidgetTester tester) async { testWidgets('On first render with thumbVisibility: true, the thumb shows', (WidgetTester tester) async {
final ScrollController controller = ScrollController(); final ScrollController controller = ScrollController();
Widget viewWithScroll() { Widget viewWithScroll() {
return Directionality( return Directionality(
...@@ -570,7 +570,7 @@ void main() { ...@@ -570,7 +570,7 @@ void main() {
child: PrimaryScrollController( child: PrimaryScrollController(
controller: controller, controller: controller,
child: CupertinoScrollbar( child: CupertinoScrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: controller, controller: controller,
child: const SingleChildScrollView( child: const SingleChildScrollView(
child: SizedBox( child: SizedBox(
...@@ -593,7 +593,7 @@ void main() { ...@@ -593,7 +593,7 @@ void main() {
expect(find.byType(CupertinoScrollbar), paints..rrect()); expect(find.byType(CupertinoScrollbar), paints..rrect());
}); });
testWidgets('On first render with isAlwaysShown: false, the thumb is hidden', (WidgetTester tester) async { testWidgets('On first render with thumbVisibility: false, the thumb is hidden', (WidgetTester tester) async {
final ScrollController controller = ScrollController(); final ScrollController controller = ScrollController();
Widget viewWithScroll() { Widget viewWithScroll() {
return Directionality( return Directionality(
...@@ -621,9 +621,9 @@ void main() { ...@@ -621,9 +621,9 @@ void main() {
expect(find.byType(CupertinoScrollbar), isNot(paints..rect())); expect(find.byType(CupertinoScrollbar), isNot(paints..rect()));
}); });
testWidgets('With isAlwaysShown: true, fling a scroll. While it is still scrolling, set isAlwaysShown: false. The thumb should not fade out until the scrolling stops.', (WidgetTester tester) async { testWidgets('With thumbVisibility: true, fling a scroll. While it is still scrolling, set thumbVisibility: false. The thumb should not fade out until the scrolling stops.', (WidgetTester tester) async {
final ScrollController controller = ScrollController(); final ScrollController controller = ScrollController();
bool isAlwaysShown = true; bool thumbVisibility = true;
Widget viewWithScroll() { Widget viewWithScroll() {
return StatefulBuilder( return StatefulBuilder(
builder: (BuildContext context, StateSetter setState) { builder: (BuildContext context, StateSetter setState) {
...@@ -634,7 +634,7 @@ void main() { ...@@ -634,7 +634,7 @@ void main() {
child: Stack( child: Stack(
children: <Widget>[ children: <Widget>[
CupertinoScrollbar( CupertinoScrollbar(
isAlwaysShown: isAlwaysShown, thumbVisibility: thumbVisibility,
controller: controller, controller: controller,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: controller, controller: controller,
...@@ -649,10 +649,10 @@ void main() { ...@@ -649,10 +649,10 @@ void main() {
child: CupertinoButton( child: CupertinoButton(
onPressed: () { onPressed: () {
setState(() { setState(() {
isAlwaysShown = !isAlwaysShown; thumbVisibility = !thumbVisibility;
}); });
}, },
child: const Text('change isAlwaysShown'), child: const Text('change thumbVisibility'),
), ),
), ),
], ],
...@@ -679,10 +679,10 @@ void main() { ...@@ -679,10 +679,10 @@ void main() {
); );
testWidgets( testWidgets(
'With isAlwaysShown: false, set isAlwaysShown: true. The thumb should be always shown directly', 'With thumbVisibility: false, set thumbVisibility: true. The thumb should be always shown directly',
(WidgetTester tester) async { (WidgetTester tester) async {
final ScrollController controller = ScrollController(); final ScrollController controller = ScrollController();
bool isAlwaysShown = false; bool thumbVisibility = false;
Widget viewWithScroll() { Widget viewWithScroll() {
return StatefulBuilder( return StatefulBuilder(
builder: (BuildContext context, StateSetter setState) { builder: (BuildContext context, StateSetter setState) {
...@@ -693,7 +693,7 @@ void main() { ...@@ -693,7 +693,7 @@ void main() {
child: Stack( child: Stack(
children: <Widget>[ children: <Widget>[
CupertinoScrollbar( CupertinoScrollbar(
isAlwaysShown: isAlwaysShown, thumbVisibility: thumbVisibility,
controller: controller, controller: controller,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: controller, controller: controller,
...@@ -708,10 +708,10 @@ void main() { ...@@ -708,10 +708,10 @@ void main() {
child: CupertinoButton( child: CupertinoButton(
onPressed: () { onPressed: () {
setState(() { setState(() {
isAlwaysShown = !isAlwaysShown; thumbVisibility = !thumbVisibility;
}); });
}, },
child: const Text('change isAlwaysShown'), child: const Text('change thumbVisibility'),
), ),
), ),
], ],
...@@ -733,11 +733,11 @@ void main() { ...@@ -733,11 +733,11 @@ void main() {
); );
testWidgets( testWidgets(
'With isAlwaysShown: false, fling a scroll. While it is still scrolling, set isAlwaysShown: true. ' 'With thumbVisibility: false, fling a scroll. While it is still scrolling, set thumbVisibility: true. '
'The thumb should not fade even after the scrolling stops', 'The thumb should not fade even after the scrolling stops',
(WidgetTester tester) async { (WidgetTester tester) async {
final ScrollController controller = ScrollController(); final ScrollController controller = ScrollController();
bool isAlwaysShown = false; bool thumbVisibility = false;
Widget viewWithScroll() { Widget viewWithScroll() {
return StatefulBuilder( return StatefulBuilder(
builder: (BuildContext context, StateSetter setState) { builder: (BuildContext context, StateSetter setState) {
...@@ -748,7 +748,7 @@ void main() { ...@@ -748,7 +748,7 @@ void main() {
child: Stack( child: Stack(
children: <Widget>[ children: <Widget>[
CupertinoScrollbar( CupertinoScrollbar(
isAlwaysShown: isAlwaysShown, thumbVisibility: thumbVisibility,
controller: controller, controller: controller,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: controller, controller: controller,
...@@ -763,10 +763,10 @@ void main() { ...@@ -763,10 +763,10 @@ void main() {
child: CupertinoButton( child: CupertinoButton(
onPressed: () { onPressed: () {
setState(() { setState(() {
isAlwaysShown = !isAlwaysShown; thumbVisibility = !thumbVisibility;
}); });
}, },
child: const Text('change isAlwaysShown'), child: const Text('change thumbVisibility'),
), ),
), ),
], ],
...@@ -800,11 +800,11 @@ void main() { ...@@ -800,11 +800,11 @@ void main() {
); );
testWidgets( testWidgets(
'Toggling isAlwaysShown while not scrolling fades the thumb in/out. ' 'Toggling thumbVisibility while not scrolling fades the thumb in/out. '
'This works even when you have never scrolled at all yet', 'This works even when you have never scrolled at all yet',
(WidgetTester tester) async { (WidgetTester tester) async {
final ScrollController controller = ScrollController(); final ScrollController controller = ScrollController();
bool isAlwaysShown = true; bool thumbVisibility = true;
Widget viewWithScroll() { Widget viewWithScroll() {
return StatefulBuilder( return StatefulBuilder(
builder: (BuildContext context, StateSetter setState) { builder: (BuildContext context, StateSetter setState) {
...@@ -815,7 +815,7 @@ void main() { ...@@ -815,7 +815,7 @@ void main() {
child: Stack( child: Stack(
children: <Widget>[ children: <Widget>[
CupertinoScrollbar( CupertinoScrollbar(
isAlwaysShown: isAlwaysShown, thumbVisibility: thumbVisibility,
controller: controller, controller: controller,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: controller, controller: controller,
...@@ -830,10 +830,10 @@ void main() { ...@@ -830,10 +830,10 @@ void main() {
child: CupertinoButton( child: CupertinoButton(
onPressed: () { onPressed: () {
setState(() { setState(() {
isAlwaysShown = !isAlwaysShown; thumbVisibility = !thumbVisibility;
}); });
}, },
child: const Text('change isAlwaysShown'), child: const Text('change thumbVisibility'),
), ),
), ),
], ],
...@@ -1011,7 +1011,7 @@ void main() { ...@@ -1011,7 +1011,7 @@ void main() {
child: MediaQuery( child: MediaQuery(
data: const MediaQueryData(), data: const MediaQueryData(),
child: CupertinoScrollbar( child: CupertinoScrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: scrollController, controller: scrollController,
...@@ -1155,7 +1155,7 @@ void main() { ...@@ -1155,7 +1155,7 @@ void main() {
home: PrimaryScrollController( home: PrimaryScrollController(
controller: scrollController, controller: scrollController,
child: CupertinoScrollbar( child: CupertinoScrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: const SingleChildScrollView( child: const SingleChildScrollView(
child: SizedBox(width: 4000.0, height: 4000.0), child: SizedBox(width: 4000.0, height: 4000.0),
...@@ -1266,7 +1266,7 @@ void main() { ...@@ -1266,7 +1266,7 @@ void main() {
home: PrimaryScrollController( home: PrimaryScrollController(
controller: scrollController, controller: scrollController,
child: CupertinoScrollbar( child: CupertinoScrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
scrollbarOrientation: ScrollbarOrientation.left, scrollbarOrientation: ScrollbarOrientation.left,
child: const SingleChildScrollView( child: const SingleChildScrollView(
......
...@@ -3801,7 +3801,7 @@ void main() { ...@@ -3801,7 +3801,7 @@ void main() {
title: const Text('AppBar'), title: const Text('AppBar'),
), ),
body: Scrollbar( body: Scrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: controller, controller: controller,
child: ListView( child: ListView(
controller: controller, controller: controller,
......
...@@ -265,14 +265,14 @@ void main() { ...@@ -265,14 +265,14 @@ void main() {
}); });
testWidgets( testWidgets(
'When isAlwaysShown is true, must pass a controller or find PrimaryScrollController', 'When thumbVisibility is true, must pass a controller or find PrimaryScrollController',
(WidgetTester tester) async { (WidgetTester tester) async {
Widget viewWithScroll() { Widget viewWithScroll() {
return _buildBoilerplate( return _buildBoilerplate(
child: Theme( child: Theme(
data: ThemeData(), data: ThemeData(),
child: const Scrollbar( child: const Scrollbar(
isAlwaysShown: true, thumbVisibility: true,
child: SingleChildScrollView( child: SingleChildScrollView(
child: SizedBox( child: SizedBox(
width: 4000.0, width: 4000.0,
...@@ -291,7 +291,7 @@ void main() { ...@@ -291,7 +291,7 @@ void main() {
); );
testWidgets( testWidgets(
'When isAlwaysShown is true, must pass a controller that is attached to a scroll view or find PrimaryScrollController', 'When thumbVisibility is true, must pass a controller that is attached to a scroll view or find PrimaryScrollController',
(WidgetTester tester) async { (WidgetTester tester) async {
final ScrollController controller = ScrollController(); final ScrollController controller = ScrollController();
Widget viewWithScroll() { Widget viewWithScroll() {
...@@ -299,7 +299,7 @@ void main() { ...@@ -299,7 +299,7 @@ void main() {
child: Theme( child: Theme(
data: ThemeData(), data: ThemeData(),
child: Scrollbar( child: Scrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: controller, controller: controller,
child: const SingleChildScrollView( child: const SingleChildScrollView(
child: SizedBox( child: SizedBox(
...@@ -318,14 +318,14 @@ void main() { ...@@ -318,14 +318,14 @@ void main() {
}, },
); );
testWidgets('On first render with isAlwaysShown: true, the thumb shows', (WidgetTester tester) async { testWidgets('On first render with thumbVisibility: true, the thumb shows', (WidgetTester tester) async {
final ScrollController controller = ScrollController(); final ScrollController controller = ScrollController();
Widget viewWithScroll() { Widget viewWithScroll() {
return _buildBoilerplate( return _buildBoilerplate(
child: Theme( child: Theme(
data: ThemeData(), data: ThemeData(),
child: Scrollbar( child: Scrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: controller, controller: controller,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: controller, controller: controller,
...@@ -344,7 +344,7 @@ void main() { ...@@ -344,7 +344,7 @@ void main() {
expect(find.byType(Scrollbar), paints..rect()); expect(find.byType(Scrollbar), paints..rect());
}); });
testWidgets('On first render with isAlwaysShown: true, the thumb shows with PrimaryScrollController', (WidgetTester tester) async { testWidgets('On first render with thumbVisibility: true, the thumb shows with PrimaryScrollController', (WidgetTester tester) async {
final ScrollController controller = ScrollController(); final ScrollController controller = ScrollController();
Widget viewWithScroll() { Widget viewWithScroll() {
return _buildBoilerplate( return _buildBoilerplate(
...@@ -355,7 +355,7 @@ void main() { ...@@ -355,7 +355,7 @@ void main() {
child: Builder( child: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return const Scrollbar( return const Scrollbar(
isAlwaysShown: true, thumbVisibility: true,
child: SingleChildScrollView( child: SingleChildScrollView(
primary: true, primary: true,
child: SizedBox( child: SizedBox(
...@@ -376,14 +376,14 @@ void main() { ...@@ -376,14 +376,14 @@ void main() {
expect(find.byType(Scrollbar), paints..rect()); expect(find.byType(Scrollbar), paints..rect());
}); });
testWidgets('On first render with isAlwaysShown: false, the thumb is hidden', (WidgetTester tester) async { testWidgets('On first render with thumbVisibility: false, the thumb is hidden', (WidgetTester tester) async {
final ScrollController controller = ScrollController(); final ScrollController controller = ScrollController();
Widget viewWithScroll() { Widget viewWithScroll() {
return _buildBoilerplate( return _buildBoilerplate(
child: Theme( child: Theme(
data: ThemeData(), data: ThemeData(),
child: Scrollbar( child: Scrollbar(
isAlwaysShown: false, thumbVisibility: false,
controller: controller, controller: controller,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: controller, controller: controller,
...@@ -403,10 +403,10 @@ void main() { ...@@ -403,10 +403,10 @@ void main() {
}); });
testWidgets( testWidgets(
'With isAlwaysShown: true, fling a scroll. While it is still scrolling, set isAlwaysShown: false. The thumb should not fade out until the scrolling stops.', 'With thumbVisibility: true, fling a scroll. While it is still scrolling, set thumbVisibility: false. The thumb should not fade out until the scrolling stops.',
(WidgetTester tester) async { (WidgetTester tester) async {
final ScrollController controller = ScrollController(); final ScrollController controller = ScrollController();
bool isAlwaysShown = true; bool thumbVisibility = true;
Widget viewWithScroll() { Widget viewWithScroll() {
return _buildBoilerplate( return _buildBoilerplate(
child: StatefulBuilder( child: StatefulBuilder(
...@@ -418,12 +418,12 @@ void main() { ...@@ -418,12 +418,12 @@ void main() {
child: const Icon(Icons.threed_rotation), child: const Icon(Icons.threed_rotation),
onPressed: () { onPressed: () {
setState(() { setState(() {
isAlwaysShown = !isAlwaysShown; thumbVisibility = !thumbVisibility;
}); });
}, },
), ),
body: Scrollbar( body: Scrollbar(
isAlwaysShown: isAlwaysShown, thumbVisibility: thumbVisibility,
controller: controller, controller: controller,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: controller, controller: controller,
...@@ -457,10 +457,10 @@ void main() { ...@@ -457,10 +457,10 @@ void main() {
); );
testWidgets( testWidgets(
'With isAlwaysShown: false, set isAlwaysShown: true. The thumb should be always shown directly', 'With thumbVisibility: false, set thumbVisibility: true. The thumb should be always shown directly',
(WidgetTester tester) async { (WidgetTester tester) async {
final ScrollController controller = ScrollController(); final ScrollController controller = ScrollController();
bool isAlwaysShown = false; bool thumbVisibility = false;
Widget viewWithScroll() { Widget viewWithScroll() {
return _buildBoilerplate( return _buildBoilerplate(
child: StatefulBuilder( child: StatefulBuilder(
...@@ -472,12 +472,12 @@ void main() { ...@@ -472,12 +472,12 @@ void main() {
child: const Icon(Icons.threed_rotation), child: const Icon(Icons.threed_rotation),
onPressed: () { onPressed: () {
setState(() { setState(() {
isAlwaysShown = !isAlwaysShown; thumbVisibility = !thumbVisibility;
}); });
}, },
), ),
body: Scrollbar( body: Scrollbar(
isAlwaysShown: isAlwaysShown, thumbVisibility: thumbVisibility,
controller: controller, controller: controller,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: controller, controller: controller,
...@@ -506,10 +506,10 @@ void main() { ...@@ -506,10 +506,10 @@ void main() {
); );
testWidgets( testWidgets(
'With isAlwaysShown: false, fling a scroll. While it is still scrolling, set isAlwaysShown: true. The thumb should not fade even after the scrolling stops', 'With thumbVisibility: false, fling a scroll. While it is still scrolling, set thumbVisibility: true. The thumb should not fade even after the scrolling stops',
(WidgetTester tester) async { (WidgetTester tester) async {
final ScrollController controller = ScrollController(); final ScrollController controller = ScrollController();
bool isAlwaysShown = false; bool thumbVisibility = false;
Widget viewWithScroll() { Widget viewWithScroll() {
return _buildBoilerplate( return _buildBoilerplate(
child: StatefulBuilder( child: StatefulBuilder(
...@@ -521,12 +521,12 @@ void main() { ...@@ -521,12 +521,12 @@ void main() {
child: const Icon(Icons.threed_rotation), child: const Icon(Icons.threed_rotation),
onPressed: () { onPressed: () {
setState(() { setState(() {
isAlwaysShown = !isAlwaysShown; thumbVisibility = !thumbVisibility;
}); });
}, },
), ),
body: Scrollbar( body: Scrollbar(
isAlwaysShown: isAlwaysShown, thumbVisibility: thumbVisibility,
controller: controller, controller: controller,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: controller, controller: controller,
...@@ -566,10 +566,10 @@ void main() { ...@@ -566,10 +566,10 @@ void main() {
); );
testWidgets( testWidgets(
'Toggling isAlwaysShown while not scrolling fades the thumb in/out. This works even when you have never scrolled at all yet', 'Toggling thumbVisibility while not scrolling fades the thumb in/out. This works even when you have never scrolled at all yet',
(WidgetTester tester) async { (WidgetTester tester) async {
final ScrollController controller = ScrollController(); final ScrollController controller = ScrollController();
bool isAlwaysShown = true; bool thumbVisibility = true;
Widget viewWithScroll() { Widget viewWithScroll() {
return _buildBoilerplate( return _buildBoilerplate(
child: StatefulBuilder( child: StatefulBuilder(
...@@ -581,12 +581,12 @@ void main() { ...@@ -581,12 +581,12 @@ void main() {
child: const Icon(Icons.threed_rotation), child: const Icon(Icons.threed_rotation),
onPressed: () { onPressed: () {
setState(() { setState(() {
isAlwaysShown = !isAlwaysShown; thumbVisibility = !thumbVisibility;
}); });
}, },
), ),
body: Scrollbar( body: Scrollbar(
isAlwaysShown: isAlwaysShown, thumbVisibility: thumbVisibility,
controller: controller, controller: controller,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: controller, controller: controller,
...@@ -685,7 +685,7 @@ void main() { ...@@ -685,7 +685,7 @@ void main() {
data: const MediaQueryData(), data: const MediaQueryData(),
child: Scrollbar( child: Scrollbar(
interactive: true, interactive: true,
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: scrollController, controller: scrollController,
...@@ -855,7 +855,7 @@ void main() { ...@@ -855,7 +855,7 @@ void main() {
controller: scrollController, controller: scrollController,
child: Scrollbar( child: Scrollbar(
interactive: true, interactive: true,
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: const SingleChildScrollView( child: const SingleChildScrollView(
child: SizedBox(width: 4000.0, height: 4000.0), child: SizedBox(width: 4000.0, height: 4000.0),
...@@ -941,7 +941,9 @@ void main() { ...@@ -941,7 +941,9 @@ void main() {
testWidgets('Scrollbar thumb color completes a hover animation', (WidgetTester tester) async { testWidgets('Scrollbar thumb color completes a hover animation', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeData(scrollbarTheme: const ScrollbarThemeData(isAlwaysShown: true)), theme: ThemeData(
scrollbarTheme: ScrollbarThemeData(thumbVisibility: MaterialStateProperty.all(true)),
),
home: const SingleChildScrollView( home: const SingleChildScrollView(
child: SizedBox(width: 4000.0, height: 4000.0), child: SizedBox(width: 4000.0, height: 4000.0),
), ),
...@@ -986,8 +988,8 @@ void main() { ...@@ -986,8 +988,8 @@ void main() {
testWidgets('Hover animation is not triggered by tap gestures', (WidgetTester tester) async { testWidgets('Hover animation is not triggered by tap gestures', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeData(scrollbarTheme: const ScrollbarThemeData( theme: ThemeData(scrollbarTheme: ScrollbarThemeData(
isAlwaysShown: true, thumbVisibility: MaterialStateProperty.all(true),
showTrackOnHover: true, showTrackOnHover: true,
)), )),
home: const SingleChildScrollView( home: const SingleChildScrollView(
...@@ -1128,7 +1130,7 @@ void main() { ...@@ -1128,7 +1130,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeData(scrollbarTheme: ScrollbarThemeData( theme: ThemeData(scrollbarTheme: ScrollbarThemeData(
isAlwaysShown: true, thumbVisibility: MaterialStateProperty.all(true),
trackVisibility: MaterialStateProperty.resolveWith((Set<MaterialState> states) { trackVisibility: MaterialStateProperty.resolveWith((Set<MaterialState> states) {
if (states.contains(MaterialState.hovered)) { if (states.contains(MaterialState.hovered)) {
return true; return true;
...@@ -1192,8 +1194,8 @@ void main() { ...@@ -1192,8 +1194,8 @@ void main() {
testWidgets('Scrollbar showTrackOnHover', (WidgetTester tester) async { testWidgets('Scrollbar showTrackOnHover', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeData(scrollbarTheme: const ScrollbarThemeData( theme: ThemeData(scrollbarTheme: ScrollbarThemeData(
isAlwaysShown: true, thumbVisibility: MaterialStateProperty.all(true),
showTrackOnHover: true, showTrackOnHover: true,
)), )),
home: const SingleChildScrollView( home: const SingleChildScrollView(
...@@ -1389,7 +1391,7 @@ void main() { ...@@ -1389,7 +1391,7 @@ void main() {
controller: scrollController, controller: scrollController,
child: Scrollbar( child: Scrollbar(
interactive: false, interactive: false,
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: const SingleChildScrollView( child: const SingleChildScrollView(
child: SizedBox(width: 4000.0, height: 4000.0), child: SizedBox(width: 4000.0, height: 4000.0),
...@@ -1457,7 +1459,7 @@ void main() { ...@@ -1457,7 +1459,7 @@ void main() {
home: PrimaryScrollController( home: PrimaryScrollController(
controller: scrollController, controller: scrollController,
child: Scrollbar( child: Scrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: SingleChildScrollView( child: SingleChildScrollView(
dragStartBehavior: DragStartBehavior.down, dragStartBehavior: DragStartBehavior.down,
...@@ -1552,7 +1554,7 @@ void main() { ...@@ -1552,7 +1554,7 @@ void main() {
controller: scrollController, controller: scrollController,
child: Scrollbar( child: Scrollbar(
interactive: true, interactive: true,
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: const SingleChildScrollView( child: const SingleChildScrollView(
child: SizedBox(width: 4000.0, height: 4000.0), child: SizedBox(width: 4000.0, height: 4000.0),
...@@ -1714,10 +1716,10 @@ void main() { ...@@ -1714,10 +1716,10 @@ void main() {
); );
}); });
testWidgets('Scrollbar.isAlwaysShown triggers assertion when multiple ScrollPositions are attached.', (WidgetTester tester) async { testWidgets('Scrollbar.thumbVisibility triggers assertion when multiple ScrollPositions are attached.', (WidgetTester tester) async {
Widget getTabContent({ ScrollController? scrollController }) { Widget getTabContent({ ScrollController? scrollController }) {
return Scrollbar( return Scrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: ListView.builder( child: ListView.builder(
controller: scrollController, controller: scrollController,
...@@ -1794,7 +1796,7 @@ void main() { ...@@ -1794,7 +1796,7 @@ void main() {
controller: scrollController, controller: scrollController,
child: Scrollbar( child: Scrollbar(
interactive: true, interactive: true,
isAlwaysShown: true, thumbVisibility: true,
scrollbarOrientation: orientation, scrollbarOrientation: orientation,
controller: scrollController, controller: scrollController,
child: const SingleChildScrollView( child: const SingleChildScrollView(
......
...@@ -38,7 +38,7 @@ void main() { ...@@ -38,7 +38,7 @@ void main() {
home: ScrollConfiguration( home: ScrollConfiguration(
behavior: const NoScrollbarBehavior(), behavior: const NoScrollbarBehavior(),
child: Scrollbar( child: Scrollbar(
isAlwaysShown: true, thumbVisibility: true,
showTrackOnHover: true, showTrackOnHover: true,
controller: scrollController, controller: scrollController,
child: SingleChildScrollView( child: SingleChildScrollView(
...@@ -131,7 +131,7 @@ void main() { ...@@ -131,7 +131,7 @@ void main() {
home: ScrollConfiguration( home: ScrollConfiguration(
behavior: const NoScrollbarBehavior(), behavior: const NoScrollbarBehavior(),
child: Scrollbar( child: Scrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: scrollController, controller: scrollController,
...@@ -261,7 +261,7 @@ void main() { ...@@ -261,7 +261,7 @@ void main() {
await tester.pumpWidget(MaterialApp( await tester.pumpWidget(MaterialApp(
theme: ThemeData(scrollbarTheme: const ScrollbarThemeData(interactive: false)), theme: ThemeData(scrollbarTheme: const ScrollbarThemeData(interactive: false)),
home: Scrollbar( home: Scrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: scrollController, controller: scrollController,
...@@ -309,7 +309,7 @@ void main() { ...@@ -309,7 +309,7 @@ void main() {
theme: ThemeData(scrollbarTheme: const ScrollbarThemeData(interactive: false)), theme: ThemeData(scrollbarTheme: const ScrollbarThemeData(interactive: false)),
home: Scrollbar( home: Scrollbar(
interactive: true, interactive: true,
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: scrollController, controller: scrollController,
...@@ -353,7 +353,6 @@ void main() { ...@@ -353,7 +353,6 @@ void main() {
testWidgets('Scrollbar widget properties take priority over theme', (WidgetTester tester) async { testWidgets('Scrollbar widget properties take priority over theme', (WidgetTester tester) async {
const double thickness = 4.0; const double thickness = 4.0;
const double hoverThickness = 4.0;
const bool showTrackOnHover = true; const bool showTrackOnHover = true;
const Radius radius = Radius.circular(3.0); const Radius radius = Radius.circular(3.0);
final ScrollController scrollController = ScrollController(); final ScrollController scrollController = ScrollController();
...@@ -367,7 +366,6 @@ void main() { ...@@ -367,7 +366,6 @@ void main() {
behavior: const NoScrollbarBehavior(), behavior: const NoScrollbarBehavior(),
child: Scrollbar( child: Scrollbar(
thickness: thickness, thickness: thickness,
hoverThickness: hoverThickness,
thumbVisibility: true, thumbVisibility: true,
showTrackOnHover: showTrackOnHover, showTrackOnHover: showTrackOnHover,
radius: radius, radius: radius,
...@@ -426,19 +424,18 @@ void main() { ...@@ -426,19 +424,18 @@ void main() {
find.byType(Scrollbar), find.byType(Scrollbar),
paints paints
..rect( ..rect(
rect: const Rect.fromLTRB(792.0, 0.0, 800.0, 600.0), rect: const Rect.fromLTRB(784.0, 0.0, 800.0, 600.0),
color: const Color(0x08000000), color: const Color(0x08000000),
) )
..line( ..line(
p1: const Offset(792.0, 0.0), p1: const Offset(784.0, 0.0),
p2: const Offset(792.0, 600.0), p2: const Offset(784.0, 600.0),
strokeWidth: 1.0, strokeWidth: 1.0,
color: const Color(0x1a000000), color: const Color(0x1a000000),
) )
..rrect( ..rrect(
rrect: RRect.fromRectAndRadius( rrect: RRect.fromRectAndRadius(
// Scrollbar thumb is larger const Rect.fromLTRB(786.0, 10.0, 798.0, 100.0),
const Rect.fromLTRB(794.0, 10.0, 798.0, 100.0),
const Radius.circular(3.0), const Radius.circular(3.0),
), ),
// Hover color // Hover color
...@@ -461,7 +458,7 @@ void main() { ...@@ -461,7 +458,7 @@ void main() {
home: ScrollConfiguration( home: ScrollConfiguration(
behavior: const NoScrollbarBehavior(), behavior: const NoScrollbarBehavior(),
child: Scrollbar( child: Scrollbar(
isAlwaysShown: true, thumbVisibility: true,
showTrackOnHover: true, showTrackOnHover: true,
controller: scrollController, controller: scrollController,
child: SingleChildScrollView( child: SingleChildScrollView(
...@@ -636,7 +633,7 @@ void main() { ...@@ -636,7 +633,7 @@ void main() {
home: ScrollConfiguration( home: ScrollConfiguration(
behavior: const NoScrollbarBehavior(), behavior: const NoScrollbarBehavior(),
child: Scrollbar( child: Scrollbar(
isAlwaysShown: true, thumbVisibility: true,
showTrackOnHover: true, showTrackOnHover: true,
controller: scrollController, controller: scrollController,
child: SingleChildScrollView( child: SingleChildScrollView(
......
...@@ -693,7 +693,7 @@ void main() { ...@@ -693,7 +693,7 @@ void main() {
child: MediaQuery( child: MediaQuery(
data: const MediaQueryData(), data: const MediaQueryData(),
child: RawScrollbar( child: RawScrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: scrollController, controller: scrollController,
...@@ -958,7 +958,7 @@ void main() { ...@@ -958,7 +958,7 @@ void main() {
child: PrimaryScrollController( child: PrimaryScrollController(
controller: scrollController, controller: scrollController,
child: RawScrollbar( child: RawScrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: const SingleChildScrollView( child: const SingleChildScrollView(
child: SizedBox(width: 4000.0, height: 4000.0), child: SizedBox(width: 4000.0, height: 4000.0),
...@@ -1013,7 +1013,7 @@ void main() { ...@@ -1013,7 +1013,7 @@ void main() {
child: PrimaryScrollController( child: PrimaryScrollController(
controller: scrollController, controller: scrollController,
child: RawScrollbar( child: RawScrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: const SingleChildScrollView( child: const SingleChildScrollView(
child: SizedBox(width: 4000.0, height: 4000.0), child: SizedBox(width: 4000.0, height: 4000.0),
...@@ -1071,7 +1071,7 @@ void main() { ...@@ -1071,7 +1071,7 @@ void main() {
child: PrimaryScrollController( child: PrimaryScrollController(
controller: scrollController, controller: scrollController,
child: RawScrollbar( child: RawScrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: const SingleChildScrollView( child: const SingleChildScrollView(
primary: true, primary: true,
...@@ -1139,7 +1139,7 @@ void main() { ...@@ -1139,7 +1139,7 @@ void main() {
child: PrimaryScrollController( child: PrimaryScrollController(
controller: scrollController, controller: scrollController,
child: RawScrollbar( child: RawScrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: const SingleChildScrollView( child: const SingleChildScrollView(
child: SizedBox(width: 4000.0, height: 4000.0), child: SizedBox(width: 4000.0, height: 4000.0),
...@@ -1262,7 +1262,7 @@ void main() { ...@@ -1262,7 +1262,7 @@ void main() {
child: PrimaryScrollController( child: PrimaryScrollController(
controller: scrollController, controller: scrollController,
child: RawScrollbar( child: RawScrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: const SingleChildScrollView( child: const SingleChildScrollView(
child: SizedBox(width: 4000.0, height: 4000.0), child: SizedBox(width: 4000.0, height: 4000.0),
...@@ -1428,7 +1428,7 @@ void main() { ...@@ -1428,7 +1428,7 @@ void main() {
FlutterError.onError = handler; FlutterError.onError = handler;
}); });
testWidgets('RawScrollbar.isAlwaysShown asserts that a ScrollPosition is attached', (WidgetTester tester) async { testWidgets('RawScrollbar.thumbVisibility asserts that a ScrollPosition is attached', (WidgetTester tester) async {
final FlutterExceptionHandler? handler = FlutterError.onError; final FlutterExceptionHandler? handler = FlutterError.onError;
FlutterErrorDetails? error; FlutterErrorDetails? error;
FlutterError.onError = (FlutterErrorDetails details) { FlutterError.onError = (FlutterErrorDetails details) {
...@@ -1441,7 +1441,7 @@ void main() { ...@@ -1441,7 +1441,7 @@ void main() {
child: MediaQuery( child: MediaQuery(
data: const MediaQueryData(), data: const MediaQueryData(),
child: RawScrollbar( child: RawScrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: ScrollController(), controller: ScrollController(),
thumbColor: const Color(0x11111111), thumbColor: const Color(0x11111111),
child: const SingleChildScrollView( child: const SingleChildScrollView(
...@@ -1518,7 +1518,7 @@ void main() { ...@@ -1518,7 +1518,7 @@ void main() {
child: PrimaryScrollController( child: PrimaryScrollController(
controller: scrollController, controller: scrollController,
child: RawScrollbar( child: RawScrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: const SingleChildScrollView( child: const SingleChildScrollView(
child: SizedBox(width: 4000.0, height: 4000.0), child: SizedBox(width: 4000.0, height: 4000.0),
...@@ -1691,7 +1691,7 @@ void main() { ...@@ -1691,7 +1691,7 @@ void main() {
child: PrimaryScrollController( child: PrimaryScrollController(
controller: scrollController, controller: scrollController,
child: RawScrollbar( child: RawScrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: const SingleChildScrollView( child: const SingleChildScrollView(
reverse: true, reverse: true,
...@@ -1764,7 +1764,7 @@ void main() { ...@@ -1764,7 +1764,7 @@ void main() {
data: const MediaQueryData(), data: const MediaQueryData(),
child: RawScrollbar( child: RawScrollbar(
mainAxisMargin: 10, mainAxisMargin: 10,
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: scrollController, controller: scrollController,
...@@ -1797,7 +1797,7 @@ void main() { ...@@ -1797,7 +1797,7 @@ void main() {
borderRadius: BorderRadius.all(Radius.circular(8.0)) borderRadius: BorderRadius.all(Radius.circular(8.0))
), ),
controller: scrollController, controller: scrollController,
isAlwaysShown: true, thumbVisibility: true,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: scrollController, controller: scrollController,
child: const SizedBox(height: 1000.0), child: const SizedBox(height: 1000.0),
...@@ -1833,7 +1833,7 @@ void main() { ...@@ -1833,7 +1833,7 @@ void main() {
controller: scrollController, controller: scrollController,
minThumbLength: 21, minThumbLength: 21,
minOverscrollLength: 8, minOverscrollLength: 8,
isAlwaysShown: true, thumbVisibility: true,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: scrollController, controller: scrollController,
child: const SizedBox(width: 1000.0, height: 50000.0), child: const SizedBox(width: 1000.0, height: 50000.0),
...@@ -1859,7 +1859,7 @@ void main() { ...@@ -1859,7 +1859,7 @@ void main() {
shape: const CircleBorder(side: BorderSide(width: 2.0)), shape: const CircleBorder(side: BorderSide(width: 2.0)),
thickness: 36.0, thickness: 36.0,
controller: scrollController, controller: scrollController,
isAlwaysShown: true, thumbVisibility: true,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: scrollController, controller: scrollController,
child: const SizedBox(height: 1000.0, width: 1000), child: const SizedBox(height: 1000.0, width: 1000),
...@@ -1894,7 +1894,7 @@ void main() { ...@@ -1894,7 +1894,7 @@ void main() {
child: RawScrollbar( child: RawScrollbar(
controller: scrollController, controller: scrollController,
crossAxisMargin: 30, crossAxisMargin: 30,
isAlwaysShown: true, thumbVisibility: true,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: scrollController, controller: scrollController,
child: const SizedBox(width: 1000.0, height: 1000.0), child: const SizedBox(width: 1000.0, height: 1000.0),
...@@ -1920,7 +1920,7 @@ void main() { ...@@ -1920,7 +1920,7 @@ void main() {
thickness: 20, thickness: 20,
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.only(topLeft: Radius.circular(8))), shape: const RoundedRectangleBorder(borderRadius: BorderRadius.only(topLeft: Radius.circular(8))),
controller: scrollController, controller: scrollController,
isAlwaysShown: true, thumbVisibility: true,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: scrollController, controller: scrollController,
child: const SizedBox(height: 1000.0, width: 1000.0), child: const SizedBox(height: 1000.0, width: 1000.0),
...@@ -1952,7 +1952,7 @@ void main() { ...@@ -1952,7 +1952,7 @@ void main() {
data: const MediaQueryData(), data: const MediaQueryData(),
child: RawScrollbar( child: RawScrollbar(
controller: scrollController, controller: scrollController,
isAlwaysShown: true, thumbVisibility: true,
minOverscrollLength: 8.0, minOverscrollLength: 8.0,
minThumbLength: 36.0, minThumbLength: 36.0,
child: SingleChildScrollView( child: SingleChildScrollView(
...@@ -1984,7 +1984,7 @@ void main() { ...@@ -1984,7 +1984,7 @@ void main() {
data: const MediaQueryData(), data: const MediaQueryData(),
child: RawScrollbar( child: RawScrollbar(
controller: scrollController, controller: scrollController,
isAlwaysShown: true, thumbVisibility: true,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: scrollController, controller: scrollController,
child: const SizedBox(height: 1000.0), child: const SizedBox(height: 1000.0),
...@@ -2010,7 +2010,7 @@ void main() { ...@@ -2010,7 +2010,7 @@ void main() {
data: const MediaQueryData(), data: const MediaQueryData(),
child: RawScrollbar( child: RawScrollbar(
controller: scrollController, controller: scrollController,
isAlwaysShown: true, thumbVisibility: true,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: scrollController, controller: scrollController,
child: SizedBox(width: double.infinity, height: height) child: SizedBox(width: double.infinity, height: height)
...@@ -2044,7 +2044,7 @@ void main() { ...@@ -2044,7 +2044,7 @@ void main() {
child: PrimaryScrollController( child: PrimaryScrollController(
controller: scrollController, controller: scrollController,
child: RawScrollbar( child: RawScrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: const SingleChildScrollView( child: const SingleChildScrollView(
child: SizedBox( child: SizedBox(
...@@ -2084,7 +2084,7 @@ void main() { ...@@ -2084,7 +2084,7 @@ void main() {
child: MediaQuery( child: MediaQuery(
data: const MediaQueryData(), data: const MediaQueryData(),
child: RawScrollbar( child: RawScrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: verticalScrollController, controller: verticalScrollController,
// This scrollbar will receive scroll notifications from both nested // This scrollbar will receive scroll notifications from both nested
// scroll views of opposite axes, but should stay on the vertical // scroll views of opposite axes, but should stay on the vertical
...@@ -2149,7 +2149,7 @@ void main() { ...@@ -2149,7 +2149,7 @@ void main() {
return notification.depth == 0; return notification.depth == 0;
}, },
controller: scrollController, controller: scrollController,
isAlwaysShown: true, thumbVisibility: true,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: scrollController, controller: scrollController,
child: const SingleChildScrollView(), child: const SingleChildScrollView(),
...@@ -2179,7 +2179,7 @@ void main() { ...@@ -2179,7 +2179,7 @@ void main() {
child: RawScrollbar( child: RawScrollbar(
controller: scrollController, controller: scrollController,
interactive: true, interactive: true,
isAlwaysShown: true, thumbVisibility: true,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: scrollController, controller: scrollController,
child: Container( child: Container(
...@@ -2222,7 +2222,7 @@ void main() { ...@@ -2222,7 +2222,7 @@ void main() {
child: PrimaryScrollController( child: PrimaryScrollController(
controller: scrollController, controller: scrollController,
child: RawScrollbar( child: RawScrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: CustomScrollView( child: CustomScrollView(
primary: true, primary: true,
...@@ -2304,7 +2304,7 @@ void main() { ...@@ -2304,7 +2304,7 @@ void main() {
child: PrimaryScrollController( child: PrimaryScrollController(
controller: scrollController, controller: scrollController,
child: RawScrollbar( child: RawScrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: CustomScrollView( child: CustomScrollView(
center: uniqueKey, center: uniqueKey,
...@@ -2730,7 +2730,7 @@ void main() { ...@@ -2730,7 +2730,7 @@ void main() {
child: PrimaryScrollController( child: PrimaryScrollController(
controller: scrollController, controller: scrollController,
child: RawScrollbar( child: RawScrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: CustomScrollView( child: CustomScrollView(
controller: scrollController, controller: scrollController,
...@@ -2800,7 +2800,7 @@ void main() { ...@@ -2800,7 +2800,7 @@ void main() {
child: PrimaryScrollController( child: PrimaryScrollController(
controller: scrollController, controller: scrollController,
child: RawScrollbar( child: RawScrollbar(
isAlwaysShown: true, thumbVisibility: true,
controller: scrollController, controller: scrollController,
child: CustomScrollView( child: CustomScrollView(
controller: scrollController, controller: scrollController,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment