Skip to content

Add support for color slots (Lottie spec slots/sid)#415

Open
burakimdatt wants to merge 9 commits into
xvrh:masterfrom
burakimdatt:slots-support
Open

Add support for color slots (Lottie spec slots/sid)#415
burakimdatt wants to merge 9 commits into
xvrh:masterfrom
burakimdatt:slots-support

Conversation

@burakimdatt
Copy link
Copy Markdown
Contributor

@burakimdatt burakimdatt commented Apr 20, 2026

Problem

Lottie animations that use the spec Slots feature (root slots + property-level sid) render with encoded c.k colors in Flutter while web players apply the slot override.

Solution

  • Parse root slots into composition.colorSlots (static RGB/RGBA only).
  • Read sid inside animated property objects via KeyframesParser.parseWithSlot (same location as k, a, etc.).
  • After full parse, walk layers, precomps, and font character shape trees to replace AnimatableColorValue keyframes when a matching slot exists (order-independent vs root key order).

Scope / limitations

  • Color slots only (fill/stroke). No gradient/scalar/vector/text/image slots.
  • Animated slot values (p.a: 1) emit composition.addWarning and are skipped.
  • No runtime setSlot API (JSON only).

References

Tests

  • test/slots_test.dart + synthetic JSON under test/data/slots/

Changelog

## Next entry added for maintainer version bump.

burakimdatt and others added 7 commits April 9, 2026 15:26
…rsions for characters, matcher, material_color_utilities, meta, and test_api packages. Enhance FillContent class to support PathFillType.
Fixes path fillType assignment timing in both FillContent and GradientFillContent to occur during draw/bounds operations rather than initialization.
- Parse root slots block into composition.colorSlots
- Capture property-level sid via KeyframesParser.parseWithSlot
- Post-parse walk applies slot colors (order-independent vs layers)
- Include FontCharacter shape trees; @internal slotId on AnimatableColorValue
- Tests: test/data/slots + test/slots_test.dart

Made-with: Cursor
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.37%. Comparing base (4f1a5a5) to head (1b139bd).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #415      +/-   ##
==========================================
+ Coverage   83.15%   83.37%   +0.22%     
==========================================
  Files         161      161              
  Lines        6470     6544      +74     
==========================================
+ Hits         5380     5456      +76     
+ Misses       1090     1088       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

@tahsin-emre tahsin-emre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

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.

3 participants