Skip to content

Conversation

@TahaTesser
Copy link
Member

fixes Scrollbar.thickness property is ignored when the Scrollbar is hovered

Code sample

expand to view the code sample
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    final ScrollController scrollController = ScrollController();

    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Material(
        child: ScrollConfiguration(
          behavior: const NoScrollbarBehavior(),
          child: ScrollbarTheme(
            data: ScrollbarThemeData(
              thickness: MaterialStateProperty.all(25.0),
              showTrackOnHover: true,
            ),
            child: Scrollbar(
              thickness: 50.0,
              thumbVisibility: true,
              radius: const Radius.circular(3.0),
              controller: scrollController,
              child: SingleChildScrollView(
                controller: scrollController,
                child: const SizedBox(width: 4000.0, height: 4000.0),
              ),
            ),
          ),
        ),
      ),
    );
  }
}

class NoScrollbarBehavior extends ScrollBehavior {
  const NoScrollbarBehavior();

  @override
  Widget buildScrollbar(
          BuildContext context, Widget child, ScrollableDetails details) =>
      child;
}

Preview

Before After

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. f: scrolling Viewports, list views, slivers, etc. labels Feb 23, 2024
@TahaTesser TahaTesser requested a review from Piinks February 23, 2024 14:16
@TahaTesser TahaTesser marked this pull request as ready for review February 23, 2024 14:16
Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

This is one of those that make me think - gosh how did this bug live here for so long! 🐛

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice readability improvement! 👍

@TahaTesser TahaTesser force-pushed the fix_scrollbar_thickness_hovered branch from e4f3620 to a2ea844 Compare February 26, 2024 08:31
@TahaTesser TahaTesser added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 26, 2024
@auto-submit auto-submit bot merged commit 41b1aea into flutter:master Feb 26, 2024
@TahaTesser TahaTesser deleted the fix_scrollbar_thickness_hovered branch February 26, 2024 10:37
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 26, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 26, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Feb 26, 2024
flutter/flutter@1e8dd1e...b77560e

2024-02-26 [email protected] Roll Flutter Engine from 32d7f9f0f546 to a15326b2c439 (1 revision) (flutter/flutter#144143)
2024-02-26 [email protected] Fix `Scrollbar.thickness` property is ignored when the `Scrollbar` is hovered (flutter/flutter#144012)
2024-02-26 [email protected] Roll Flutter Engine from 168cc5c0a195 to 32d7f9f0f546 (1 revision) (flutter/flutter#144128)
2024-02-26 [email protected] Roll Flutter Engine from 330e743203b0 to 168cc5c0a195 (1 revision) (flutter/flutter#144125)
2024-02-26 [email protected] Roll Flutter Engine from fd3136782aae to 330e743203b0 (1 revision) (flutter/flutter#144123)
2024-02-26 [email protected] Roll Flutter Engine from f372329c9099 to fd3136782aae (1 revision) (flutter/flutter#144118)
2024-02-26 [email protected] Roll Flutter Engine from da3d49c30bcc to f372329c9099 (2 revisions) (flutter/flutter#144117)
2024-02-26 [email protected] Revert "Re-enable Impeller goldens blocking. (#144023)" (flutter/flutter#144115)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
LouiseHsu pushed a commit to LouiseHsu/packages that referenced this pull request Mar 7, 2024
flutter/flutter@1e8dd1e...b77560e

2024-02-26 [email protected] Roll Flutter Engine from 32d7f9f0f546 to a15326b2c439 (1 revision) (flutter/flutter#144143)
2024-02-26 [email protected] Fix `Scrollbar.thickness` property is ignored when the `Scrollbar` is hovered (flutter/flutter#144012)
2024-02-26 [email protected] Roll Flutter Engine from 168cc5c0a195 to 32d7f9f0f546 (1 revision) (flutter/flutter#144128)
2024-02-26 [email protected] Roll Flutter Engine from 330e743203b0 to 168cc5c0a195 (1 revision) (flutter/flutter#144125)
2024-02-26 [email protected] Roll Flutter Engine from fd3136782aae to 330e743203b0 (1 revision) (flutter/flutter#144123)
2024-02-26 [email protected] Roll Flutter Engine from f372329c9099 to fd3136782aae (1 revision) (flutter/flutter#144118)
2024-02-26 [email protected] Roll Flutter Engine from da3d49c30bcc to f372329c9099 (2 revisions) (flutter/flutter#144117)
2024-02-26 [email protected] Revert "Re-enable Impeller goldens blocking. (#144023)" (flutter/flutter#144115)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App f: material design flutter/packages/flutter/material repository. f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scrollbar.thickness property is ignored when the Scrollbar is hovered

2 participants