smil_animated_svg 0.2.0
smil_animated_svg: ^0.2.0 copied to clipboard
Render SMIL-animated SVGs in Flutter with programmatic pause / resume / speed control and per-colour replacement.
CHANGELOG #
0.2.0 #
colorMaponSvgFrameandAnimatedSvg: aMap<Color, Color>that replaces the SVG's ownfill/strokepaints as it renders, so one asset can serve any number of palettes. Matching is on the parsed colour rather than the text in the file (white,#fffand#ffffffare one key) and ignores alpha; the source's alpha multiplies into the replacement's.- The swap is applied to the parsed tree — keyframes included — and cached per palette. An SVG that animates its own
filltherefore interpolates in the replacement palette instead of only matching where it lands on a keyframe, and the painter's per-frame cost is unchanged. SvgNodeandSvgShapeare nowsealed. Breaking only for code outside this package that subclassed them (nothing did); in exchange, adding a shape can no longer silently skip a tree walk.- Fixed: an interpolated
<animate>colour lost its alpha channel on the way back into the live attribute map, so a fade between tworgba()keyframes rendered opaque. - Parse cache raised from 32 to 64 entries, since a recoloured tree is held alongside the one it was derived from.
0.1.0 #
- Initial release