quire-io / scroll-to-index

scroll to index with fixed/variable row height inside Flutter scrollable widget
MIT License
511 stars 104 forks source link

Index value requirements #34

Closed amitkot closed 3 years ago

amitkot commented 3 years ago

When wrapping items in AutoScrollTab, what are the requirements for the values used as index? Do they need to be in order of the elements on the screen?

I have a CustomScrollView that contains multiple slivers with different heights. Do I need to use growing indexes according to the position in the view?

Thanks for this useful library!

jerrywell commented 3 years ago

yes, the index must be in order for searching. you can simply try the example and remove any properties of AutoScrollTag to see what it will behave.

amitkot commented 3 years ago

@jerrywell sorry for not responding earlier! For now scrolling works fine in my app where I use unique but not increasing indexes.

chuongdevJC commented 3 years ago

@jerrywell i faced same problem. i had a customScrollView with 2 [sliverList]s. i wrapped item In 'AutoScrollTag' but i still get error: (offsetToLastState?.offset ?? 0) >= 0': ERROR: %%%%%%%%%%%%%%: 20, 1, 1.0, RevealedOffset(offset: -666.4285714285714, rect: Rect.fromLTRB(0.0, 0.0, 411.4, 146.0))