Implicitly Animated Reorderable List
A Flutter ListView that implicitly calculates the changes between two lists using the MyersDiff algorithm and animates between them for you. The ImplicitlyAnimatedReorderableList adds reordering support to its items with fully custom animations.
A Flutter ListView that implicitly animates between the changes of two lists with support to reorder its items.
Click here to view the full example.
Installing
Add it to your pubspec.yaml
file:
Install packages from the command line
flutter packages get
Usage
The package contains two ListViews
: ImplicitlyAnimatedList
which is the base class and offers implicit animation for item insertions
, removals
as well as updates
, and ImplicitlyAnimatedReorderableList
which extends the ImplicitlyAnimatedList
and adds reordering support to its items. See examples below on how to use them.
ImplicitlyAnimatedList
ImplicitlyAnimatedList
is based on AnimatedList
and uses the MyersDiff
algorithm to calculate the difference between two lists and calls insertItem
and removeItem
on the AnimatedListState
for you.
Example
Note as
AnimatedList
doesn't support item moves, a move is handled by removing the item from the old index and inserting it at the new index.
ImplicitlyAnimatedReorderableList
ImplicitlyAnimatedReorderableList
is based on ImplicitlyAnimatedList
and adds reordering support to the list.
Example
For a more in depth example click here.
Caveats
Note that this package is still in its very early phase and not enough testing has been done to guarantee stability.
Also note that computing the diff between two very large lists my take significant amount of time (the computation is done on a background isolate though).
Acknowledgements
The diff algorithm that ImplicitlyAnimatedList
uses was written by Dawid Bota at GitLab.
Roadmap
You can take a look at the Roadmap to see which featues I am working on or plan to implement in future versions.