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

Add optional scroll listener #31

Merged
merged 2 commits into from
Nov 5, 2024

Conversation

jayabrown
Copy link
Contributor

Add optional function to be passed in that allows parent widget to listen to the scroll percentage

@jayabrown
Copy link
Contributor Author

@paurakhsharma I'm not sure if this is the best way to do this. But I just want to be able to listen to scroll position so I can do some layout adjustments in the parent widget (like show/hide app bar, for example, depending on user scroll).

@paurakhsharma
Copy link
Owner

paurakhsharma commented Oct 31, 2024

Hey @jayabrown thank you for the PR.
I would suggest instead of passing in scrollListener callback what about we pass optional ScrollController just like in this PR: #16

The original author seem to have abandoned this PR but you can take inspiration from this. Please only make changes regarding ScrollController and not bottom and top padding related changes.

I believe that would solve what your are trying to achieve?

@jayabrown
Copy link
Contributor Author

Ok yes, that method is better.

Copy link
Owner

@paurakhsharma paurakhsharma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much!

@paurakhsharma paurakhsharma merged commit db5d04c into paurakhsharma:main Nov 5, 2024
1 check passed
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.

2 participants