How does flutter scroll to an item position in the listview according to its index?
A list scrolls to a specific item, but the height of the item may be uncertain
for example: scroll to the 22nd ListTile in the list
How does flutter scroll to an item position in the listview according to its index?
A list scrolls to a specific item, but the height of the item may be uncertain
for example: scroll to the 22nd ListTile in the list
Copyright © 2021 Jogjafile Inc.
Unfortunately, Flutter doesn't have
controller.jumpToIndex(index);you can achieve this by adding a third-party library which is called scrollable_positioned_list.
It is exactly like ListView but you can use
controller.jumpToIndex(index);For Example:
Init controller:
Add widget:
Call
scrollTomethod:Happy Coding :)