9

I have a ListView with shrinkWrap: true.

Also, I have applied BouncingScrollPhysics() to the ListView

The problem is bounce physics only works at the bottom of ListView. When I scroll to the top, it doesn't show the bounce effect.

CopsOnRoad
  • 237,138
  • 77
  • 654
  • 440
Xihuny
  • 1,410
  • 4
  • 19
  • 48

5 Answers5

24

You can try this:

SingleChildScrollView(
  physics: BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()),
  child: Column(...),
)
CopsOnRoad
  • 237,138
  • 77
  • 654
  • 440
6

I had the same problem, I just used physics: AlwaysScrollableScrollPhysics(parent: BouncingScrollPhysics())

underfilho
  • 211
  • 2
  • 9
4

BouncingScrollPhysics() does not always work if the ListView is not 'full'. For example if the ListView needs 5 items to fill its view and become scrollable, then the BouncingScrollPhysics() will probably only work when the ListView contains 5 or more items.

Ali Amin
  • 355
  • 1
  • 2
  • 8
1

Try using NeverScrollableScrollPhysics into the ListView.builder.

But first set the bouncing scroll physics:

child: SingleChildScrollView(
physics: const BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()),

And in the ListView use both shrinkWrap and physics:

ListView.builder(
shrinkWrap: true, physics: const NeverScrollableScrollPhysics(),
help-info.de
  • 6,695
  • 16
  • 39
  • 41
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 26 '22 at 12:05
0

if above Functions are not works you should use this one physics: BouncingScrollPhysics(),

  • But that's what the question is about! They _already_ applied `BouncingScrollPhysics()` and _it's not working_. – Jeremy Caney Mar 29 '22 at 19:23
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 30 '22 at 05:39