declarative_animated_list 0.1.0-nullsafety.0 copy "declarative_animated_list: ^0.1.0-nullsafety.0" to clipboard
declarative_animated_list: ^0.1.0-nullsafety.0 copied to clipboard

outdated

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.

20
likes
0
pub points
75%
popularity

Publisher

unverified uploader

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

Homepage
Repository
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on declarative_animated_list