fixes #2: 'Nested ScaleTap widget animates both ScaleTap widgets'#3
Open
rupinderjeet wants to merge 1 commit intofedeamura:masterfrom
Open
fixes #2: 'Nested ScaleTap widget animates both ScaleTap widgets'#3rupinderjeet wants to merge 1 commit intofedeamura:masterfrom
rupinderjeet wants to merge 1 commit intofedeamura:masterfrom
Conversation
Author
|
Here's a way to test this: |
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.
Fixes #2: 'Nested ScaleTap widget animates both ScaleTap widgets'
Events were propagating from 'inner' ScaleTap to 'outer' ScaleTap widget. This made both widgets to react with touch animation. To fix this, I needed a value that could be checked by all of ScaleTap widgets in nested tree to form a source-of-truth. To do this, I created
ScaleTapInfoclass whose value can be, optionally, passed from outside. When same instance of this class is sent to all nested ScaleTap widgets, they act as if they were stitched with same thread.I mark the tap-event as
consumedin inner ScaleTap widget, which is later on used by parent ScaleTap widget to consume the event only if it wasn't consumed before.The issue is fixed by default, and the developers do not need to change their code. This is because
ScaleTapInfohas a default instance included.If you have any queries, or feedback, please let me know.
Credit: https://stackoverflow.com/a/73481203/3682535