• 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
..
fix_data Loading commit data...
src Loading commit data...
analysis_options.yaml Loading commit data...
animation.dart Loading commit data...
cupertino.dart Loading commit data...
foundation.dart Loading commit data...
gestures.dart Loading commit data...
material.dart Loading commit data...
painting.dart Loading commit data...
physics.dart Loading commit data...
rendering.dart Loading commit data...
scheduler.dart Loading commit data...
semantics.dart Loading commit data...
services.dart Loading commit data...
widgets.dart Loading commit data...