Delayed animation of list item on scroll

1,354 views
Skip to first unread message

Sekib Omazic

unread,
Aug 7, 2018, 11:23:25 AM8/7/18
to Flutter Dev
Hi there,

I've already tried to get some help on gitter.im and StackOverflow (https://stackoverflow.com/questions/51678837/delayed-animation-of-list-items-when-scrolling) but no luck yet. I'd like ListView items to start scrolling after some delay when the user starts scrolling. Basically it is the behaviour like in the gif on the right side. Some direction on how to do it would be nice. Do I need to create a custom ScrollPhysics for this or is there a simpler way?

Any help is very appreciated!

Thanks.



Eric Seidel

unread,
Aug 7, 2018, 5:16:33 PM8/7/18
to Sekib Omazic, Flutter Dev
The gist you posted looks similar to how I would try.  I'd probably animate the padding on the individual tiles based on the scroll notifications.

I expect someone on this list (or stack overflow) can take a whack at the challenge.  Definitely looks doable in Flutter.

--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sekib Omazic

unread,
Aug 8, 2018, 2:17:47 AM8/8/18
to Flutter Dev
If I slightly change my gist like this:

if (userScrollNotification.direction.toString() ==
'ScrollDirection.reverse') {
direction = 1.0; _controller.reset(); // ADDED
print('start scrolling up from ${direction*tileHeight} to 0');
_controller.forward();
}
then I see all items get animated but the items "jump" down and then start sliding up. But all of them simultaneously - so it's not the wanted behaviour. I also tried using GestureDetection on each item but then scrolling doesn't take place at all.

Claude Grecea

unread,
Dec 31, 2018, 2:20:28 PM12/31/18
to Flutter Dev
Hi - I was wondering if you figured out a solution with animating items in a scrollable list? I am trying to do something similar and running into choppy scrolling not smooth.
Message has been deleted

Matthias Bruns

unread,
Jan 11, 2019, 6:57:08 AM1/11/19
to Flutter Dev
I've filed an issue for this on the flutter repo:
https://github.com/flutter/flutter/issues/26418

Seems that we do not have access to enough data to implement this.

Dominik Roszkowski

unread,
Aug 25, 2019, 8:06:03 AM8/25/19
to Flutter Development (flutter-dev)
Hi, did you succeed with your implementation? I also would like to have animated padding or "delayed" animation in my list. I tried to control mainAxisStride in SliverGridDelegate, but it would be possible only when related to scroll velocity.

Andy Greenshaw

unread,
Aug 25, 2019, 8:10:09 AM8/25/19
to Dominik Roszkowski, Flutter Development (flutter-dev)
It must be possible with ListTile / Container in the ListView with AnimatedPadding (https://api.flutter.dev/flutter/widgets/AnimatedPadding-class.html)

Cheers,
Andy
 

From: flutt...@googlegroups.com on behalf of Dominik Roszkowski <domin...@gmail.com>
Sent: Sunday, August 25, 2019 1:06 pm
To: Flutter Development (flutter-dev)
Subject: Re: Delayed animation of list item on scroll
 
--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.

To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages