Skip to content
Articles
Article

scroll_to_index_list: jump or animate to any item index in a Flutter list

by Abdeldjalil Chougui dev.to

6 min read

"Scroll to message 4,812" sounds like something a list should just do. In Flutter it is harder than it looks. A ListView builds its items lazily and knows the height of an item only after laying it out. To scroll to a pixel offset you need the heights of everything before the target, and with items of different heights nobody knows them until they are built. scrollable_positioned_list solved this…

Forum

Questions about this, or something to add?

Discuss on the forum

Report this · Wrote this? Claim it

FlutterX is supported by