implicitly_animated_reorderable_list 0.1.10

  • Readme
  • Changelog
  • Example
  • Installing
  • 93

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.


Click here to view the full example.

Installing #

Add it to your pubspec.yaml file:

  implicitly_animated_reorderable_list: ^0.1.10

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.


// Specify the generic type of the data in the list.
  // The current items in the list.
  items: items,
  // Called by the DiffUtil to decide whether two object represent the same item.
  // For example, if your items have unique ids, this method should check their id equality.
  areItemsTheSame: (a, b) => ==,
  // Called, as needed, to build list item widgets.
  // List items are only built when they're scrolled into view.
  itemBuilder: (context, animation, item, index) {
    // Specifiy a transition to be used by the ImplicitlyAnimatedList.
    // See the Transitions section on how to import this transition.
    return SizeFadeTranstion(
      sizeFraction: 0.7,
      curve: Curves.easeInOut,
      animation: animation,
      child: Text(,
  // An optional builder when an item was removed from the list.
  // If not specified, the List uses the itemBuilder with 
  // the animation reversed.
  removedItemBuilder: (context, animation, oldItem) {
    return FadeTransition(
      opacity: animation,
      child: Text(,

If you have a CustomScrollView you can use the SliverImplicitlyAnimatedList.

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.


  items: items,
  areItemsTheSame: (oldItem, newItem) => ==,
  onReorderFinished: (item, from, to, newItems) {
    // Remember to update the underlying data when the list has been
    // reordered.
    setState(() {
  itemBuilder: (context, itemAnimation, item, index) {
    // Each item must be wrapped in a Reorderable widget.
    return Reorderable(
      // Each item must have an unique key.
      key: ValueKey(item),
      // The animation of the Reorderable builder can be used to
      // change to appearance of the item between dragged and normal
      // state. For example to add elevation when the item is being dragged.
      // This is not to be confused with the animation of the itemBuilder.
      // Implicit animations (like AnimatedContainer) are sadly not yet supported.
      builder: (context, dragAnimation, inDrag) {
        final t = dragAnimation.value;
        final elevation = lerpDouble(0, 8, t);
        final color = Color.lerp(Colors.white, Colors.white.withOpacity(0.8), t);

        return SizeFadeTranstion(
          sizeFraction: 0.7,
          curve: Curves.easeInOut,
          animation: itemAnimation,
          child: Material(
            color: color,
            elevation: elevation,
            type: MaterialType.transparency,
            child: ListTile(
              title: Text(,
              // The child of a Handle can initialize a drag/reorder.
              // This could for example be an Icon or the whole item itself. You can
              // use the delay parameter to specify the duration for how long a pointer
              // must press the child, until it can be dragged.
              trailing: Handle(
                delay: const Duration(milliseconds: 100),
                child: Icon(
                  color: Colors.grey,

For a more in depth example click here.

Transitions #

You can use some custom transitions (such as the SizeFadeTransition) for item animations by importing the transitions pack:

import 'package:implicitly_animated_reorderable_list/transitions.dart';

If you want to contribute your own custom transitions, feel free to make a pull request.

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.

Contribution #

If you like this package, consider giving it a star on GitHub and a like on

Roadmap #

You can take a look at the Roadmap to see which featues I am working on or plan to implement in future versions.

Changelog #

0.1.5 to 0.1.10 #

  • Bug fixes and performance improvements.

0.1.4 #

  • Made Handle scroll aware to only initiate a drag when the scroll position didn't change.
  • Added horizontal scrollDirection support for ImplicitlyAnimatedReorderableList

0.1.0 #

  • Initial release


import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

import 'package:example/ui/ui.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
      const SystemUiOverlayStyle(
        statusBarColor: Colors.transparent,

    return MaterialApp(
      title: 'Implicitly Animated Reorderable List Example',
      theme: ThemeData.light().copyWith(
        accentColor: Colors.amber.shade800,
        dividerTheme: DividerThemeData(
          thickness: 1,
          color: Colors.grey.shade300,
      debugShowCheckedModeBanner: false,
      home: const LanguagePage(),

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  implicitly_animated_reorderable_list: ^0.1.10

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:implicitly_animated_reorderable_list/implicitly_animated_reorderable_list.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Apr 3, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Health suggestions

Format lib/implicitly_animated_reorderable_list.dart.

Run flutter format to format lib/implicitly_animated_reorderable_list.dart.

Format lib/src/diff/diff.dart.

Run flutter format to format lib/src/diff/diff.dart.

Format lib/src/diff/diff_delegate.dart.

Run flutter format to format lib/src/diff/diff_delegate.dart.

Fix additional 13 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/diff/diff_model.dart (Run flutter format to format lib/src/diff/diff_model.dart.)
  • lib/src/diff/myers_diff.dart (Run flutter format to format lib/src/diff/myers_diff.dart.)
  • lib/src/diff/path_node.dart (Run flutter format to format lib/src/diff/path_node.dart.)
  • lib/src/handle.dart (Run flutter format to format lib/src/handle.dart.)
  • lib/src/implicitly_animated_list.dart (Run flutter format to format lib/src/implicitly_animated_list.dart.)
  • lib/src/implicitly_animated_list_base.dart (Run flutter format to format lib/src/implicitly_animated_list_base.dart.)
  • lib/src/implicitly_animated_reorderable_list.dart (Run flutter format to format lib/src/implicitly_animated_reorderable_list.dart.)
  • lib/src/reorderable.dart (Run flutter format to format lib/src/reorderable.dart.)
  • lib/src/src.dart (Run flutter format to format lib/src/src.dart.)
  • lib/src/transitions/size_fade_transition.dart (Run flutter format to format lib/src/transitions/size_fade_transition.dart.)
  • lib/src/transitions/transitions.dart (Run flutter format to format lib/src/transitions/transitions.dart.)
  • lib/src/util/invisible.dart (Run flutter format to format lib/src/util/invisible.dart.)
  • lib/src/util/util.dart (Run flutter format to format lib/src/util/util.dart.)


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
async ^2.4.0 2.4.1
flutter 0.0.0
meta ^1.1.8 1.1.8
Transitive dependencies
collection 1.14.11 1.14.12
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies