flutter Preserving Scroll Position code example
Example 1: disable scrollview flutter
physics = NeverScrollableScrollPhysics()
Example 2: how to scroll to a position in flutter listview
ItemScrollController _scrollController = ItemScrollController();
ScrollablePositionedList.builder(
itemScrollController: _scrollController,
itemCount: _myList.length,
itemBuilder: (context, index) {
return _myList[index];
},
)
_scrollController.scrollTo(index: 150, duration: Duration(seconds: 1));