Skip to content

Instantly share code, notes, and snippets.

@kitoko552
Created February 5, 2020 07:07
Show Gist options
  • Save kitoko552/f9f7bf95baab0d1a1fdc6e27ea9e25e6 to your computer and use it in GitHub Desktop.
Save kitoko552/f9f7bf95baab0d1a1fdc6e27ea9e25e6 to your computer and use it in GitHub Desktop.
final controller = ItemScrollController();
final listener = ItemPositionsListener.create();
ScrollablePositionedList.builder(
itemCount: _maxItemCount,
itemScrollController: controller,
itemPositionsListener: listener, // ItemPositionsListenerでスクロールを監視
itemBuilder: (context, index) {
return child;
},
);
// スクロール処理
controller.jumpTo(index: index);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment