Add delay timer for animation start and improve disposal handling#4
Open
VadymMatus wants to merge 1 commit into
Open
Add delay timer for animation start and improve disposal handling#4VadymMatus wants to merge 1 commit into
VadymMatus wants to merge 1 commit into
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.
Fix: Resolve Pending Timer Issue During Widget Disposal
Problem
During widget tests, the following error occurred when using the
AutoScrollTextwidget with thedelayBeforeparameter:A Timer is still pending even after the widget tree was disposed.This issue arises because the widget is disposed before the
_delayBeforeStartAnimationmethod completes its operation, leaving a pending timer.Solution
• Replaced the
_delayBeforeStartAnimationmethod with a direct call to start the timer (_delayTimer).• The
_initScrollmethod was updated to set up a new Timer for thedelayBeforeduration. Once the delay is over, the periodic timer is started for the scroll animation.• Ensured that the timers are properly managed and canceled when the widget is disposed to prevent any lingering timers that may cause issues during widget tests.
Changes
• The new Timer is created with the
delayBeforeparameter directly inside_initScroll, instead of using a separate_delayBeforeStartAnimationmethod.• Ensured that timers are disposed of correctly to prevent them from running after the widget is disposed.
• Added widget tests to validate the behavior, especially around the
delayBeforeparameter and its interaction with widget disposal in the context of Bouncing mode.This update resolves the issue of pending timers during widget disposal, especially in automated tests.