diff_animated_list library

Animated lists and grids that work out inserts, removals, moves and changes by themselves.

Classes

DiffAnimatedGrid<T>
A scrolling grid that animates itself when items changes.
DiffAnimatedList<T>
A scrolling list that animates itself when items changes.
DiffAnimatedListController
Lets the app talk to a diff list, mainly after a user-driven reorder.
DiffAnimatedListTheme
Provides a default DiffAnimationConfig to every diff list below it.
DiffAnimationConfig
All timing and look settings of the animated lists.
DiffChangeTransitions
Ready-made transitions for content changes.
DiffOperation
One step of a diff, expressed as a plain list operation.
DiffResult
The outcome of comparing an old list with a new list.
DiffTransitions
Ready-made insert/remove transitions.
SliverDiffAnimatedGrid<T>
A sliver grid that animates itself when items changes.
SliverDiffAnimatedList<T>
A sliver list that animates itself when items changes.

Enums

DiffOperationType
The kind of a DiffOperation.

Constants

defaultMaxEditDistance → const int
Default cap on the edit distance searched by Myers' algorithm.

Functions

applyDiffOperations<T>(List<T> list, List<DiffOperation> operations, List<T> newItems) → void
Applies operations (from DiffResult.operations) to list in place, taking inserted and changed items from newItems.
diffKeys(List<Object?> oldKeys, List<Object?> newKeys, {bool detectMoves = true, int maxEditDistance = defaultMaxEditDistance}) → DiffResult
Compares two key lists and returns what changed.
diffKeysAsync(List<Object?> oldKeys, List<Object?> newKeys, {bool detectMoves = true, int maxEditDistance = defaultMaxEditDistance}) → Future<DiffResult>
Like diffKeys, but runs on a background isolate with compute.
diffLists<T>(List<T> oldList, List<T> newList, {Object? itemKey(T item)?, bool areItemsTheSame(T a, T b)?, bool areContentsTheSame(T a, T b)?, bool detectMoves = true, int maxEditDistance = defaultMaxEditDistance}) → DiffResult
Compares two lists of items.
reorderListItem<T>(List<T> list, int oldIndex, int newIndex) → void
Moves an item with the semantics of ReorderableListView.onReorder: newIndex is the index before the item is taken out, so when moving down it is one too high.

Typedefs

DiffChangeTransitionBuilder = Widget Function(BuildContext context, Widget oldChild, Widget newChild, Animation<double> animation)
Builds the look of an item whose content changed.
DiffItemBuilder<T> = Widget Function(BuildContext context, T item, int index)
Builds an item.
DiffMoveBuilder = Widget Function(BuildContext context, Widget child, Animation<double> animation)
Wraps an item while it slides to its new position after a move or after its neighbours moved. animation runs from 0 to 1.
DiffTransitionBuilder = Widget Function(BuildContext context, Widget child, Animation<double> animation)
Builds the insert/remove look of an item.