You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to https://pub.dev/packages/flutter_staggered_animations I would like to be able to only animate a list's items once they appear.
Regardless of scrolling, or items changing, they should only animate for the first time.
The text was updated successfully, but these errors were encountered:
Interesting! I'll have to look at how they made that work. Worst case, I anticipate it would be pretty easy for the author of flutter_staggered_animations to create an animation type that would accept any flutter_animate instance.
Keeping open and will look into it when time permits. Feel free to take a stab at it in the meantime.
gskinner
changed the title
Add an AnimationLimiter kinda feature.
Defer animation on list items until scrolled into view
Sep 21, 2024
Okay, I've been giving this a bunch of thought, and have the start of a flexible API in mind that I'm fairly sure can be implemented:
foo.animate(hiddenBehavior: myBehavior);
HiddenBehavior(behavior, visibleFraction=0.5, resetOnHide=false, keepAlive=true)
// behaviors:HiddenBehavior.PLAY// play immediately on creationHiddenBehavior.SKIP// skip to end if initially hiddenHiddenBehavior.PAUSE// remain paused at beginning if initially hiddenHiddenBehavior.WAIT// pause until visible
This would facilitate all of the behaviors I can think of:
current behavior (play on creation)
only play visible items, new items scroll in already at the end (or start) of their animation
play each item only when it first scrolls in
play every time it scrolls back in
Feedback is very welcome. I'm not 100% sure I love the naming of HiddenBehavior, but I think it's a bit more semantically intuitive than VisibilityBehavior (which is perhaps the more expected choice).
Similar to https://pub.dev/packages/flutter_staggered_animations I would like to be able to only animate a list's items once they appear.
Regardless of scrolling, or items changing, they should only animate for the first time.
The text was updated successfully, but these errors were encountered: