How can I prepare ItemScrollController _scrollController = ItemScrollController();
when the app are starting, it jumps directly to the index?
I am using the ScrollablePositionedList: https://pub.dev/packages/scrollable_positioned_list
CodePudding user response:
Try this.
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) {
// executes after build
_scrollController.jumpTo(index: YOUR_INDEX);
});
super.initState();
}