ariedov / flutter_snaplist

A small library for creating snapping lists.
MIT License
452 stars 53 forks source link

Future update not reflecting #12

Closed kumar-aakash86 closed 5 years ago

kumar-aakash86 commented 5 years ago

Hi, Thanks for this great plugin. But I am facing one issue in this.

Once you bind the SnapList on page it is not updating when data changed. I tried this with streambuilder, futurebuilder & async data list.

In FutureBuilder & StreamBuilder, its loading the data & list count is changed but SnapList items are not changing. Also it keep firing positionUpdate callback after list refresh.

In async data list, one the page load I am getting the data from server & when I call setState its showing first item. No gesture is working & positionUpdate callback fires with index as "-1".

I am trying now with this project's branch. Will let you know if I found something.

ariedov commented 5 years ago

Thanks for the issue and the help!

kumar-aakash86 commented 5 years ago

UPDATE I was trying with your source code & found that its actually building the newly added items in list but scrolling is not working after last item of previous list. If I change the tabs & scroll again it scroll to updated list count. After that load more fires again it again fails to scroll to newly added items.

So looks like in this code it somewhere calculating the scroll height beforehand (I guess). I don't know bloc pattern so it may take sometime for me to understand this. Will update soon.

kumar-aakash86 commented 5 years ago

Hi, I fixed the issue & created a PR. Please see.

ariedov commented 5 years ago

@kumar-aakash86 Thank you a lot! I'll take a look later today!

ariedov commented 5 years ago

That is fixed, thank you!