declarative_animated_list 0.0.2

Flutter Android iOS web

An implementation of animated list widget that will be automatically updated based on different lists snippets.

Declarative animated list #

An implementation of animated list widget that will be automatically updated based on different lists snippets. Based on Android's DiffUtil with slight changes to support Flutter's declarative UI.


//Create a list tile, wrapped with an animation applying widget
Widget _buildAnimatedTile(final Animation<double> animation, final PresentationModel model) {
  return FadeTransition(
    opacity: animation,
    child: SizeTransition(
      sizeFactor: animation,
      axisAlignment: 0.0,
      child: SomeWidget(model),
    ),
  );
}

Widget _buildRemovingTile(final Animation<double> animation, final PresentationModel model) { 
  //... 
}

final DeclarativeList<PresentationModel> declarativeList = DeclarativeList(
  items: presentationModels,
  itemBuilder: (BuildContext ctx, PresentationModel model, int index, Animation<double> animation) {
    return _buildAnimatedTile(animation, model);
  },
  removeBuilder: (BuildContext ctx, PresentationModel model, int index, Animation<double> animation) {
    return _buildRemovingTile(animation, model);
  }  
);


And... that's it!

Getting Started #

1. Add dependency to your pubspec.yaml

dependencies:
  declarative_animated_list: ^0.0.1

2. Import it

import 'package:declarative_animated_list/declarative_animated_list.dart';

3. Use it! Refer to the examples folder if needed.

1
likes
110
pub points
41%
popularity

An implementation of animated list widget that will be automatically updated based on different lists snippets.

Homepage
Repository
View/report issues

Documentation

API reference

Uploader

orkay255@gmail.com

License

Apache 2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on declarative_animated_list