animated_stream_list 1.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 91

Animated Stream List #

Looking for a maintainer, my fling with Flutter has sadly come to an end

pub package

A Flutter library to easily display a list with animated changes from a Stream<List<E>>.
It's like StreamBuilder + ListView.Builder with animations.
Taken inspiration from the Animated List Sample and Java-diff-utils

// create tile view as the user is going to see it, attach any onClick callbacks etc. 
Widget _createTile(String item, Animation<double> animation) {    
 return SizeTransition(      
    axis: Axis.vertical,      
    sizeFactor: animation,      
    child: const Text(item),    

// what is going to be shown as the tile is being removed, usually same as above but without any 
// onClick callbacks as, most likely, you don't want the user to interact with a removed view 
Widget _createRemovedTile(String item, Animation<double> animation) {    
 return SizeTransition(      
    axis: Axis.vertical,      
    sizeFactor: animation,      
    child: const Text(item),    

final Stream<List<String>> list = // get list from some source, like BLOC  
final animatedView = AnimatedStreamList<String>(      
  streamList: list,      
  itemBuilder: (String item, int index, BuildContext context, Animation<double> animation) =>      
    _createTile(item, animation),      
  itemRemovedBuilder: (String item, int index, BuildContext context, Animation<double> animation) =>  
    _createRemovedTile(item, animation), 

Getting Started #

1. Add dependency to your pubspec.yaml

  animated_stream_list: ^0.0.4

2. Import it #

import 'package:animated_stream_list/animated_stream_list.dart';

3. Use it. See the examples folder for an ... example. #

Parameters #

@required Stream<List<E>> streamList;  
@required AnimatedStreamListItemBuilder<E> itemBuilder; 
@required AnimatedStreamListItemBuilder<E> itemRemovedBuilder; 

AnimatedStreamListItemBuilder<T> is just a function which builds a tile

typedef Widget AnimatedStreamListItemBuilder<T>(
  T item,
  int index,
  BuildContext context,
  Animation<double> animation,

Options #

List<E> initialList;

Initial list

Equalizer equals; 

Compares items for equality, by default it uses the == operator, it's critical this works properly.

Equalizer is function, that, given two items of the same type, returns true if they are equal, false otherwise

typedef bool Equalizer(dynamic item1, dynamic item2); 

You can check the Animated List Documentation for the rest:

Axis scrollDirection; 
bool reverse; 
ScrollController scrollController; 
bool primary; 
ScrollPhysics scrollPhysics; 
bool shrinkWrap; 
EdgeInsetsGeometry padding; 

[0.0.1] - 07.03.2019.

  • initial release.

[0.0.3] - 10.03.2019

  • expose index in the item builder function
  • make deleting items instant when change is needed

[0.0.4] - 11.03.2019

  • changes are done without animations
  • write test cases

[0.0.5] - 05.06.2019

  • allow setting initial list
  • fix memory leak

1.0.0 #

  • Exposed duration parameter to enable customisation
  • Cleaned up dependencies
  • Added a full example


example #

A new Flutter project.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

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

  animated_stream_list: ^1.0.0

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:animated_stream_list/animated_stream_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 Nov 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
flutter_test 0.0.0
meta ^1.1.6 1.1.7 1.1.8
Transitive dependencies
async 2.3.0 2.4.0
boolean_selector 1.0.5
charcode 1.1.2
collection 1.14.11 1.14.12
matcher 0.12.5 0.12.6
path 1.6.4
pedantic 1.8.0+1
sky_engine 0.0.99
source_span 1.5.5
stack_trace 1.9.3
stream_channel 2.0.0
string_scanner 1.0.5
term_glyph 1.1.0
test_api 0.2.5 0.2.11
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
benchmark_harness ^1.0.5
mockito ^4.1.1
quiver >=2.0.0 <3.0.0 2.0.5 2.1.2+1