• Taha Tesser's avatar
    Fix `Scrollbar.thickness` property is ignored when the `Scrollbar` is hovered (#144012) · 41b1aea2
    Taha Tesser authored
    fixes [`Scrollbar.thickness` property is ignored when the `Scrollbar` is hovered](https://github.com/flutter/flutter/issues/143881)
    
    ### Code sample
    
    <details>
    <summary>expand to view the code sample</summary> 
    
    ```dart
    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;
    }
    ```
    
    </details>
    
    ### Preview
    
    | Before | After |
    | --------------- | --------------- |
    | <img src="https://github.com/flutter/flutter/assets/48603081/3537d60d-a5b2-488d-aa99-4c36c3721657"  /> | <img src="https://github.com/flutter/flutter/assets/48603081/cfd02095-a327-4b16-8ece-0d1c9e6813ce" /> |
    41b1aea2
Name
Last commit
Last update
.github Loading commit data...
.vscode Loading commit data...
bin Loading commit data...
dev Loading commit data...
examples Loading commit data...
packages Loading commit data...
.ci.yaml Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CODEOWNERS Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
CONTRIBUTING.md Loading commit data...
LICENSE Loading commit data...
PATENT_GRANT Loading commit data...
README.md Loading commit data...
TESTOWNERS Loading commit data...
analysis_options.yaml Loading commit data...
dartdoc_options.yaml Loading commit data...
flutter_console.bat Loading commit data...