Search code examples
flutterdartflutter-windows

Remove the scroll bar itself from the flutter


If you scroll through physics: const Never Scrollable ScrollPhysics() in SingleChildScrollView from the plutter, you will not be able to scroll, but if you bring the mouse to the right of the Container, a scroll bar will appear.

It's not a problem when using ios and android, but when using windows app, moving the mouse will cause a scrollbar to appear and it's uncomfortable.

I know it has the ability to block scrolling in the flutter, but how do I keep the scrollbar from appearing? I searched Google hard, but I couldn't find it.

I'd be so grateful if someone could help me.

Thank you.


Solution

  • Try ScrollbarTheme interactivity

    Set it to false

    Setting it at the theme:

    MaterialApp(
      theme: ThemeData(
        scrollbarTheme: ScrollbarThemeData(interactive: false),
      ),
    );
    

    Setting it above the widget

    ScrollbarTheme(
         data: ScrollbarThemeData(interactive: false),
         child: SingleChildScrollView(),
    );