Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove need for an extra pull #42

Merged
merged 2 commits into from
Oct 14, 2022
Merged

fix: remove need for an extra pull #42

merged 2 commits into from
Oct 14, 2022

Conversation

renancaraujo
Copy link
Contributor

@renancaraujo renancaraujo commented Oct 13, 2022

Description

Fixes: #41 (comment)

⚠️ Breaking ⚠️

Ad a breaking change, this delegates the re-fetching trigger from our custom code (reliant on ScrollPsotion) to the SliverList (SlverCosntraints reliant).

This will trigger the re-fetching once the last item in the list is built. That should happen when the viewport hits the bottom of the scrollable cache area.

Now that we rely on the cache area, we don't need scrollExtentThreshold nor the SliverInfiniteList needs to be the last sliver on a CustomScrollView.

Instead, the user can pass cacheExtent to the InfiniteList to customize the cache area of the internal ScrollView. SliverInfiniteList users can pass that to their own CustomScrollView.

The cache area is not exactly the same as cacheExtent since it is applied to both edges of the sliver, not only the trailing one.

Breaking changes:

Public member defaultScrollExtentThreshold was removed. Any tests and implementations that use it will break.

Public members InfiniteList.scrollExtentThreshold and SliverInfiniteList.scrollExtentThreshold were removed. Any implementation that specified these values will break.

Default behavior for InfiniteList.scrollExtentThreshold and SliverInfiniteList.scrollExtentThreshold was to apply defaultScrollExtentThreshold, which was equal to 400 pixels. Now that we rely on cacheExtent, the default value resorts to the frameworks RenderAbstractViewport.defaultCacheExtent. Which is equal to 250 pixels.

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

@felangel felangel added the bug Something isn't working as expected label Oct 13, 2022
@renancaraujo renancaraujo requested a review from felangel October 13, 2022 22:04
@renancaraujo renancaraujo merged commit 0b2492c into main Oct 14, 2022
@renancaraujo renancaraujo deleted the fix/extra-pull branch October 14, 2022 14:14
@b-nugent
Copy link

b-nugent commented Oct 14, 2022

Thanks so much @renancaraujo for taking a crack at this, I'm excited to try it out! 😄

Update: It works smoothly and flawlessly 👏

@felangel
Copy link
Contributor

Thanks so much @renancaraujo for taking a crack at this, I'm excited to try it out! 😄

This is included in v0.6.0 https://pub.dev/packages/very_good_infinite_list 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SliverInfiniteList sometimes requires an extra pull to load more items
4 participants