scrollable_positioned_list 0.3.4 copy "scrollable_positioned_list: ^0.3.4" to clipboard
scrollable_positioned_list: ^0.3.4 copied to clipboard

A list with helper methods to programmatically scroll to an item.

scrollable_positioned_list #

A flutter list that allows scrolling to a specific item in the list.

Also allows determining what items are currently visible.

Usage #

A ScrollablePositionedList works much like the builder version of ListView except that the list can be scrolled or jumped to a specific item.

Example #

A ScrollablePositionedList can be created with:

final ItemScrollController itemScrollController = ItemScrollController();
final ItemPositionsListener itemPositionsListener = ItemPositionsListener.create();

ScrollablePositionedList.builder(
  itemCount: 500,
  itemBuilder: (context, index) => Text('Item $index'),
  itemScrollController: itemScrollController,
  itemPositionsListener: itemPositionsListener,
);

One then can scroll to a particular item with:

itemScrollController.scrollTo(
  index: 150,
  duration: Duration(seconds: 2),
  curve: Curves.easeInOutCubic);

or jump to a particular item with:

itemScrollController.jumpTo(index: 150);

One can monitor what items are visible on screen with:

itemPositionsListener.itemPositions.addListener(() => ...);

A full example can be found in the example folder.


This is not an officially supported Google product.

1672
likes
0
pub points
99%
popularity

Publisher

verified publishergoogle.dev

A list with helper methods to programmatically scroll to an item.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

collection, flutter

More

Packages that depend on scrollable_positioned_list