indexscroll_listview_builder library
A Flutter package providing an enhanced ListView.builder with index-based scrolling.
This library exports the main widget IndexScrollListViewBuilder which extends Flutter's standard ListView.builder with the ability to programmatically scroll to any item by its index, even if that item hasn't been built yet.
Key features:
- Programmatic scrolling to any item by index
- Smooth, configurable animations
- Automatic handling of edge cases (first/last items)
- Optional scrollbar support with full customization
- Smart constraint handling for unbounded layouts
- Customizable item alignment in viewport
Example:
import 'package:indexscroll_listview_builder/indexscroll_listview_builder.dart';
IndexScrollListViewBuilder(
itemCount: 100,
indexToScrollTo: 50, // Automatically scroll to item 50
itemBuilder: (context, index) {
return ListTile(title: Text('Item $index'));
},
)
See also:
- IndexScrollListViewBuilder, the main widget
- IndexedScrollController, for advanced programmatic control
Classes
- IndexedScrollController
- A specialized scroll controller that enables programmatic scrolling to specific indexed items within a scrollable list.
- IndexedScrollTag
- A widget that tags a child with an index for use with IndexedScrollController.
- IndexScrollListViewBuilder
- A highly customizable ListView.builder with built-in index-based scrolling capabilities.