Home > OS >  How to disable dragging down from buttom in this list view
How to disable dragging down from buttom in this list view

Time:09-15

I have a basic list view in my app And when I drag down from buttom it show the blue widget like in the vid. Is there a way to disable it? Or change it color? enter image description here

CodePudding user response:

You can try BouncingScrollPhysics with all lists or grids or scroll view:

//ScrollView:
SingleChildScrollView(
      physics: BouncingScrollPhysics(),
)

//For ListView: 
ListView.builder(
    physics: BouncingScrollPhysics(),
}
//GridView
GridView.Builder(
    physics: BouncingScrollPhysics(),
)

ScrollConfiguration(
          behavior: new ScrollBehavior()..buildViewportChrome(context, null, AxisDirection.down),
          child: SingleChildScrollView()
);

CodePudding user response:

The glow will disappear by changing the ListView's physics property to BouncingScrollPhysics.

ListView.builder(
    physics: BouncingScrollPhysics(),
}

CodePudding user response:

this is Material glow. you can use Cupertino package else use physics: BouncingScrollPhysics()

CodePudding user response:

You need to do like this.

class NoSplash extends StatelessWidget {
  NoSplash({this.child});

  final Widget child;

  @override
  Widget build(BuildContext context) {
    return NotificationListener<OverscrollIndicatorNotification>(
        onNotification: (OverscrollIndicatorNotification overscroll) {
          overscroll.disallowGlow();
          return true;
        },
        child: child);
  }
}
  • Related