4

Minimal code:

ListView.builder(
 physics: BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()),
 itemBuilder: (_, i) => ListTile(title: Text('$i')),
 itemCount: 50,
)

The BouncingScrollPhysics seems to have no effect. I am testing this on macOS.

asked Jul 29, 2021 at 14:03
4
  • it works on windows perfectly. btw you can try flutter clean and rebuild Commented Jul 29, 2021 at 14:16
  • @YeasinSheikh flutter clean, full restart, nothing worked, however this code works on iOS. Maybe it's a bug on macOS. Commented Jul 29, 2021 at 14:45
  • Got the same problem on windows. If I fire up the Android emulator it works fine. Commented Apr 26, 2022 at 19:26
  • I'm also seeing this bug in macOS. I'm on Flutter 3.0.5. Commented Jul 18, 2022 at 17:21

1 Answer 1

2

You don't need to set parent argument. You can just set empty constructor and it will work:

physics: BouncingScrollPhysics(),

Instead of setting physics parameter you can also use ScrollBehavior

class CustomScrollBehavior extends ScrollBehavior {
 const CustomScrollBehavior();
 @override
 ScrollPhysics getScrollPhysics(BuildContext context) {
 return const BouncingScrollPhysics();
 }
}
ScrollConfiguration(
 behavior: CustomScrollBehavior(),
 child: ListView.builder(
 // physics: BouncingScrollPhysics(),
 itemBuilder: (ctx, index) {
 ...
answered Jul 29, 2021 at 14:14
Sign up to request clarification or add additional context in comments.

3 Comments

I already tried this (before posting question), it didn't work.
This should work. Might be cache or full restart requires. Have you checked with ScrollConfiguration?
That is basically doing the same thing and hence it also didn't work :(

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.