Home > Enterprise >  How to move list item given source index and destination index with animation in flutter
How to move list item given source index and destination index with animation in flutter

Time:02-13

I am building a leaderboard screen in the flutter application, whenever the user comes to the leaderboard screen, I want to show the animation of his old position to a new position in the leaderboard, so I need an animation of this row to go up or down based on his standings, please someone help me which widget to use to get this functionality working. Thanks

CodePudding user response:

AnimatedList is the widget you are looking for. It automatically generates entrance and exit animation when items are added/deleted. Combined that with SizeTransition, and you will get a nice "growing/shrinking" effect.

There are some really good examples (and even a video tutorial) on the official docs as well.

You can also look at this answer for a more complex example of using 2 of them.

  • Related