问题
I'm trying to make a list on my flutter app. But, Every time I scroll all the way to the top there is this animation showing up like this:
https://i.stack.imgur.com/Z7mHh.jpg, https://i.stack.imgur.com/EAIyj.jpg
Is there a way to hide this animation?
回答1:
NotificationListener<OverscrollIndicatorNotification>(
onNotification: (OverscrollIndicatorNotification overscroll) {
overscroll.disallowGlow();
},
child: ListView.builder(...));
As official docs say
GlowingOverscrollIndicator generates OverscrollIndicatorNotification before showing an overscroll indication. To prevent the indicator from showing the indication, call OverscrollIndicatorNotification.disallowGlow on the notification.
回答2:
you can solve this problem using two method.
1) if You can afford bounce back effect then simply use ListView.builder's property physics and set value BouncingScrollPhysics().
physics: BouncingScrollPhysics(),
2) you can also solve using ScrollConfiguration and costume ScrollBehavior. in details
来源:https://stackoverflow.com/questions/53153219/how-can-i-disable-the-animation-when-you-scroll-all-the-way-to-the-top-in-listvi