Fix user provided scroll controllers not being managed correctly#385
Open
pitriq wants to merge 1 commit intowoltapp:mainfrom
Open
Fix user provided scroll controllers not being managed correctly#385pitriq wants to merge 1 commit intowoltapp:mainfrom
pitriq wants to merge 1 commit intowoltapp:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Hey,
I noticed that when passing a custom
ScrollControllerto one of my sheet’s pages, it was being attached to multiple scroll views, causing an error. The issue was due to a small mistake in the code that recreates scroll controllers when pages are initialized or changed.This PR ensures that when scroll controllers are recreated inside
WoltModalSheetAnimatedSwitcher, user-provided controllers (if present) are correctly reused. It also avoids disposing them, as they're user managed.Additionaly, I fixed the offset-tracking logic to properly track the offset of each controller — previously, it was repeatedly tracking the same controller's offset.
Related Issues
I believe one of the problems mentioned in #350 may be related to this.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]).This will ensure a smooth and quick review process.
///).melos run analyze) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?