how to disable scroll glow?

586 Views Asked by At

I am quite new to Flutter and have a problem that I can't figure out how to remove/disable the Scrollglow in my written Code. Any solution I have seen so far did not work for me and i don't know why. Does anyone know how I can do it?

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

  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        centerTitle: true,
        title: const Text("Fertigungsrechner"),
        backgroundColor: const Color.fromRGBO(20, 20, 20, 10.0),
      ),
      backgroundColor: const Color.fromRGBO(00, 00, 00, 50),
      body: Container(
        padding: const EdgeInsets.all(0.0), //Abstand Kacheln von Seitenrand
        child: GridView.count(
          crossAxisCount: 2,
          children: <Widget>[
            MyMenu(
              path: "/rpm",
              title: "RPM",
              icon: Icons.abc_rounded,
              warna: Colors.white,
            ),
          ],
        ),
      ),
    );
  }
}
2

There are 2 best solutions below

0
On

Inside your GridView, add this property

physics: BouncingScrollPhysics()

The scroll glow will disappear.

0
On

You don't need to build your own custom ScrollBehavior class. Instead, just wrap your scrollable widget in a ScrollConfiguration widget and set the behavior property to:

const ScrollBehavior().copyWith(overscroll: false).

Full code example:

ScrollConfiguration(
  behavior: const ScrollBehavior().copyWith(overscroll: false),
  child: PageView(
    physics: const PageScrollPhysics(),
    controller: model.pageController,
    children: [
      PageOne(),
      PageTwo(),
      PageThree(),
      PageFour(),
    ],
  ),
),