animated_scroll_view 1.0.2 copy "animated_scroll_view: ^1.0.2" to clipboard
animated_scroll_view: ^1.0.2 copied to clipboard

Scrollable widgets, that helps you easily animate items removing, inserting, moving etc.

example/example.md

Take one of the widgets, provided by this package:

  • AnimatedListView
  • SliverAnimatedListView
  • AnimatedGridView
  • SliverAnimatedGridView
  • AnimatedPageView

Example:

AnimatedListView(
    eventController: eventController,
    // [itemsNotifier] is optional
    itemsNotifier: itemsNotifier,
    idMapper: (object) => object.id.toString(),
    items: items,
    itemBuilder: (item) {
        return ListTile(
            leading: SizedBox.square(
                dimension: 20,
                child: ColoredBox(color: item.color),
            ),
            title: Text('ItemId: ${item.id}'),
        );
    },
);

And then, using event controller, add some event:

eventController.add(
    MoveItemEvent.byId(
        itemId: itemId,
        newIndex: newIndex,
    ),
);

// Also, you can use the "short-cut" version:
eventController.moveById(
    itemId: itemId,
    newIndex: newIndex,
);

And the item will be moved with animation!

Also, there are InsertItemEvent and RemoveItemEvent provided by default.

In addition, you can implement your own event, with your logic.

7
likes
140
pub points
57%
popularity

Publisher

verified publisherrepur.dev

Scrollable widgets, that helps you easily animate items removing, inserting, moving etc.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

collection, flutter, meta

More

Packages that depend on animated_scroll_view