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

Allow listening to primary ScrollController #506

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Lootwig
Copy link

@Lootwig Lootwig commented Dec 12, 2023

Adds an optional callback to ScrollablePositionedList that provides access to updates on the primary ScrollController.

This enables reading the ScrollPosition of the controller, in my case required for checking whether a list still fully fits on the screen or is scrollable already.

  • I signed the [CLA].
  • All tests from running flutter test pass.
  • flutter analyze does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Adds an optional callback to `ScrollablePositionedList` that provides access to updates on the primary ScrollController.
@Lootwig
Copy link
Author

Lootwig commented Dec 12, 2023

Note, I'm starting to think whether it might make even more sense to just allow injecting your own ScrollController instead - I noticed that if the parent widget of the List changes size, the controller doesn't fire a notifyListeners if the list isn't actually scrolled, which means I have to handle this case differently anyway via callbacks triggered when the parent rebuilds (and reading the controller's value then, because they do update)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant