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

RetainableScrollController #6

Merged
merged 1 commit into from
Mar 18, 2023
Merged

RetainableScrollController #6

merged 1 commit into from
Mar 18, 2023

Conversation

SimonWang9610
Copy link
Owner

  • support RetainableScrollController to avoid scrolling up/down when inserting new items into the top of a ListView

The problem behaves like the below:

not_retain.mp4

The reason that does not adjust the scroll offset by adding jumpTo as a post-frame callback is that the painting may flicker: like:

retain_post_frame.mp4

By adjusting the ScrollPosition.pixels during the layout phase in RetainableScrollController, we could avoid flickering during painting, the final result is like this:

retain.mp4

@SimonWang9610
Copy link
Owner Author

support RetainableScrollController

@SimonWang9610 SimonWang9610 reopened this Mar 18, 2023
@SimonWang9610 SimonWang9610 merged commit bcc976a into main Mar 18, 2023
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.

None yet

1 participant