xvg 0.3.1
xvg: ^0.3.1 copied to clipboard
High-performance static & animated SVG rendering for Flutter. Rust (usvg) parses, Flutter's own GPU pipeline renders — no CPU rasterizer, SMIL animation support.
0.3.1 #
- Docs: pubspec
homepageandrepositorynow point to the package directory on themainbranch.
0.3.0 #
- Fix: macOS builds failed at CodeSign when consuming the package from pub.dev because pub expands the framework's symlinks. The package now ships only
Versions/A, and the podspec recreates the versioned-bundle symlinks atpod install. The archive no longer contains three copies of the binary. - Fix root viewBox origin, scaling and preserveAspectRatio on the animated (Dart) path, including text dispatch and image-provider rasterization. Root width/height accept unitless and
pxvalues. Xvg/SvgImageProvidernow route static SVGs containing<text>to the Dart engine so the text renders; documents without animations settle after the first frame. ExplicitStaticXvgstill skips text. The whole source follows Dart-path limits (no pattern/marker or tspan/textPath; filters limited to blur).AnimationDetector.hasAnimationskeeps its meaning.- Upgrade usvg to 0.50 (Windows x64 prebuilt 462 KB → 448 KB).
- Breaking:
XvgStaticrenamed toStaticXvgandXvgAnimatedrenamed toAnimatedXvg(Flutter-style naming; no deprecated aliases).Xvgis unchanged.
0.2.0 #
- Breaking:
maxFpsrenamed tofps: null follows global; 0 freezes at the first frame;double.infinityis unlimited and ignores global. - Add
Xvg.fpsfor live global animation frame-rate control; externalanimationdrivers and static sources are unaffected. Xvg.ensureInitialized({double? fps})sets the initial globalXvg.fpsat startup (non-null only, applied on every call).- Fix: the macOS prebuilt
xvg.framework/xvgsymlink pointed to the oldVersions/Current/svgxname, and the published archive stored the framework symlinks as plain files, so linking a macOS app failed withframework 'xvg' not found. The link now points toVersions/Current/xvg, and releases are published from a Linux GitHub Actions job that keeps real symlinks.
0.1.3 #
- Docs: README wording rewritten in plain language.
- Add an experimental Flutter Web demo using Rust wasm, synchronous web initialization, browser source loading, and main-thread SMIL parsing. Native bridge and supported pub platforms remain unchanged.
- Build and deploy the demo under
xvg/demo/; wasm artifacts are generated in CI and excluded from the pub package.
0.1.2 #
- Docs: new Chinese README (
README.zh-CN.md); both READMEs gain a detailedXvg.stringguide, a complete API reference (caches, animation controller/events, image providers,RustLib) and table of contents. Dartdoc added forXvgPixelSnapmembers. - A static showcase page is published at https://icodejoo.github.io/dart-labs/xvg/ (not part of the package).
0.1.1 #
- Fix: 0.1.0 was published without
lib/src/rust/(the generated flutter_rust_bridge Dart bindings): an unanchoredrust/rule in.pubignorealso excluded it, so the package did not compile. The rule now only excludes the top-levelrust/crate. Use 0.1.1.
0.1.0 #
Initial release.
- Static SVG: Rust (
usvg) parsing into a cachedui.Picture— shapes, gradients, patterns, clip-path, mask, filters (Gaussian blur),currentColor, group/element opacity, embedded base64 images. Onlydata:URIs are decoded;<image href>never touches the local file system. Reference graphs and CSS are bounded to resist amplification attacks; parse untrusted SVG in a background isolate. - Animated SVG: an original Dart-side engine, parsed once and sampled every
frame with no per-frame FFI crossing.
- SMIL:
<animate>,<animateTransform>,<animateMotion>,<set>, clock values, begin-value-lists with syncbase/offset instances, restart rules. - CSS (SVGator CSS exports and a general subset):
@keyframes,animationshorthand/longhand, per-keyframecubic-bezier/steps,transformlists,offset-path,d: path()morphing, colors andstroke-dasharray.transition-*,var()/calc()and SVGator's JS export are not supported. - Group opacity, nested masks, clip paths, luminance/alpha masks and blur.
- SMIL:
Xvgdispatches to the static or animated path based on the source, withstring/asset/network/file/memoryconstructors.NetworkXvg,AssetXvg,FileXvgandMemoryXvgsniff bytes and hand bitmaps to Flutter's decoder.- Playback control:
XvgAnimationController(play/pause/stop/seek, signed rates, once/loop/ping-pong ranges, duration fitting, cues), FlutterAnimationdriving viaXvgAnimated.animation, and element/loop events (onEvent, CSS@keyframesevents included). Animations pause whileTickerModeis disabled. XvgDocumentCachewith async parsing in a persistent isolate andprewarm.XvgPixelSnapviewport pixel alignment (auto,always,never).XvgAnimationQualityperformance trade-offs on the animated path.- Precompiled native libraries ship in the package (Android ×4 ABIs, iOS xcframework, macOS framework, Linux x64/arm64, Windows x64/arm64); consumers never compile Rust.