Englischer Projektschnappschuss. Aktuelle Inhalte auf GitHub.
flutter anchor_scroll_controller
This package implement a ScrollController which supports anchor. That is, AnchorScrollController supports to scroll to index and listen to index changed while scrolling by user.
Features
Scroll to index
Listen to index changed
Getting Started
In the pubspec.yaml of your flutter project, add the following dependency:
If the size of items are fixed, there is no need to wrap item with AnchorItemWrapper. Just set the fixedItemSize param of AnchorScrollController to the size of items. For example, if the height of all items are 50, then set fixedItemSize param to 50.
For the ScrollView which needs to support pin, wrap pinned headers with AnchorItemWrapper. See pin_scroll_view.dart for more detail.
If you already have a ScrollController and want to use it, wrap the ListView with AnchorScrollViewWrapper and wrap its items with AnchorItemWrapper. Meanwhile, set the scrollViewWrapper param instead of controller param to AnchorItemWrapper. See cascaded_scroll_controller.dart for more detail.