Skip to content
pubscout

implicitly_animated_reorderable_list_2

0.6.0, released 3 years ago by an unverified publisher

A Flutter ListView that implicitly animates list changes and supports reordering.

WASM-ready
$ flutter pub add implicitly_animated_reorderable_list_2
Source repository

What it does

It provides ImplicitlyAnimatedList, SliverImplicitlyAnimatedList, and ImplicitlyAnimatedReorderableList widgets that automatically calculate differences between lists using the MyersDiff algorithm and animate insertions, removals, updates, and reorders.

AI-written summary of version 0.6.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need a ListView or Sliver that automatically animates item insertions, removals, and updates.
  • You need to allow users to reorder list items with custom drag animations.

Skip it when

  • You are dealing with extremely large lists where diff calculations might impact performance.
  • You need standard non-animated list views.

Strengths

  • Implicitly calculates changes between two lists using the MyersDiff algorithm.
  • Supports reordering with customizable drag animations and handles.
  • Computes differences on a background isolate by default.

Weaknesses

  • May take significant time when computing diffs for very large lists.
  • Implicit animations like AnimatedContainer inside Reorderables are not yet supported.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
2
ImplicitlyAnimatedReorderableList<MyGenericType>(
  items: items,
  areItemsTheSame: (oldItem, newItem) => oldItem.id == newItem.id,
  onReorderFinished: (item, from, to, newItems) {
    setState(() {
      items
        ..clear()
        ..addAll(newItems);
    });
  },
  itemBuilder: (context, itemAnimation, item, index) {
    return Reorderable(
      key: ValueKey(item),
      builder: (context, dragAnimation, inDrag) {
        return SizeFadeTransition(
          sizeFraction: 0.7,
          curve: Curves.easeInOut,
          animation: itemAnimation,
          child: ListTile(
            title: Text(item.name),
          ),
        );
      },
    );
  },
)

Alternatives

Packages that do the same job and could replace implicitly_animated_reorderable_list_2.

Works with

Packages commonly used together with implicitly_animated_reorderable_list_2: ones it builds on, ones built on it, and its own family.