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.
You can try this:
SingleChildScrollView(
physics: BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()),
child: Column(...),
)
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.
I had the same problem, I just used physics: AlwaysScrollableScrollPhysics(parent: BouncingScrollPhysics())
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(),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With