Repository navigation
fix(mix): stop animation when a style drops its animation config - #1071
Merged
Merged
Conversation
leoafarias
changed the base branch from
main
to
feat/blur-modifier-tile-mode
September 29, 2026 04:13
leoafarias
force-pushed
the
fix/animation-config-removal
branch
from
September 29, 2026 04:13
08fd423 to
48fc63e
Compare
leoafarias
added this pull request to stack #1075
September 29, 2026 04:13
3 of 4 tasks
tilucasoli
force-pushed
the
fix/animation-config-removal
branch
from
September 29, 2026 12:26
48fc63e to
3390368
Compare
tilucasoli
force-pushed
the
fix/animation-config-removal
branch
from
September 29, 2026 13:20
3390368 to
33efa81
Compare
leoafarias
force-pushed
the
fix/animation-config-removal
branch
from
September 29, 2026 15:36
33efa81 to
aa40706
Compare
1 of 4 tasks
tilucasoli
force-pushed
the
fix/animation-config-removal
branch
from
October 1, 2026 02:12
aa40706 to
e5db0e6
Compare
When a style's animation config became null, StyleAnimationBuilder recreated the driver with the previous config. For implicit configs this animates back to the new spec, but keyframe and phase drivers produce their own specs and loop without a trigger, so the old animation kept running and overrode the new style. Only curve and spring configs are now reused as a fallback; keyframe and phase configs are dropped and the new spec is applied directly.
tilucasoli
force-pushed
the
fix/animation-config-removal
branch
from
October 1, 2026 02:57
e5db0e6 to
0e78421
Compare
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.
Problem
StyleAnimationBuilderis always in the tree (viaStyleSpecBuilder), so dropping an animation from a style goes throughdidUpdateWidget. When the new config is null, it recreated the driver withconfig ?? oldConfig. That fallback (#930) is intended for implicit animations, so a variant that removes its animation still animates back. For a loopingkeyframeAnimationorphaseAnimation(no trigger, socontroller.repeat()), the old driver was rebuilt and kept looping forever, emitting its own specs instead of the new style.pumpAndSettletimed out and the new style never rendered.Fix
Only
CurveAnimationConfigandSpringAnimationConfigare reused as the fallback when the config is removed. Keyframe and phase configs fall through toNoAnimationDriver, which stops the loop and applies the new spec directly. The existing implicit fallback behavior and its test are unchanged.Tests
style_animation_builder_test.dartthat go throughBox/StyleBuilder: a looping keyframe animation and a looping phase animation are replaced by a plainBoxStyler. Both failed before the fix (animations still running) and pass after it.fvm flutter testinpackages/mix: all 2981 tests pass.fvm dart analyze packages/mix: no new issues (7 pre-existingprefer_initializing_formalsinfos in unrelated files).