简体   繁体   中英

Scroll to a certain index on a horizontal ListView in flutter

I was wondering, how can I scroll to a certain index on a ListView? I wanted to start showing the ListView in the middle.

I think I have to use a controller but I'm not sure how to make it go to that position.

Thanks

You can use ScrollablePositionedList which is a widget developed by Google but not the flutter team scrollable_positioned_list . You will need to specify the scrollDirection .

Also there is a package indexed_list_view , you can give it a try (I didn't try it).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM