dotdart 0.9.0
dotdart: ^0.9.0 copied to clipboard
Build-time Flutter asset compiler that generates typed, optimized widgets from SVG, Lottie, images, and GIFs for mobile, web, and desktop.
0.9.0 #
- BREAKING: Generated Lotties now play once by default and keep their final
frame visible. Pass
playback: LottiePlayback.loopto retain the previous continuous-loop behavior. Lottie namespace libraries re-export the shared enum from the generateddotdart.g.dartfile. - Fixed completed one-time playback and
progress: 1rendering a blank frame by holding the final visible position before the Lottie out-point. - Added
delayanddurationto generated Lottie accessors.delaywaits once before automatic playback starts, whiledurationcan make the full animation play faster or slower without changing its internal timing. - Added static and animated Lottie trim paths for paths, rectangles, and ellipses, including start, end, offset, wraparound, and parallel or sequential handling of multiple shapes in the default drawing direction.
- Generated trim-path painters use Flutter's native path metrics and remain self-contained without a Lottie runtime dependency.
- Reduced generated Lottie frame work by reusing laid-out text painters, compacting adjacent constant keyframes, and caching sequential trim-path lengths outside the paint loop.
- Moved thumbhash decoding entirely to generation time. Generated image and GIF widgets now contain precomputed placeholder colors and reuse one frame builder, avoiding base64 and inverse-DCT work during their first render.
0.8.0 #
- BREAKING: Replaced namespace-wide image and GIF precaching with generated
per-asset cache classes. Use
$ImagesCache.precacheProfile(context, width: 160)before rendering$Images.profile(width: 160), then call$ImagesCache.removeProfile(context, width: 160)when that decoded image is no longer needed. Omitting both dimensions uses the generated widget's default display size, and removal preserves an image that is still live.
0.7.0 #
- Updated package metadata, documentation, contribution, support links, and example application identifiers for the transfer to the Ventairy organization.
- Added Lottie precomposition layers, static editable text layers, and static additive masks.
- Added parented Lottie layer transforms and null controller layers, preserving orbit and other hierarchical motion from the source animation.
- Generated Lottie accessors now expose nullable
Stringfields for text layers through a generatedoverridesobject. Passing a value replaces the text stored in the Lottie document. - Repeated named Lottie layers now receive numbered override fields instead of sharing one override, so each layer can be customized independently.
- Corrected Lottie shape-group stacking so background shapes no longer cover map and illustration groups above them.
- Added a
clipparameter to generated Lottie accessors. It defaults totrueto clip painting to the Lottie canvas; passfalseto allow overflow. - Reduced generated Lottie frame work by omitting non-rendering controller layers, sharing safe timeline guards, and precomputing canvas geometry and text paint offsets outside the paint loop.
- Fixed automatic Lottie playback resuming after app lifecycle or reduced-motion pauses by keeping the painter attached to its stopped controller.
- Hardened Lottie generation by rejecting duplicate or cyclic precompositions, invalid non-composition references, unsupported time remapping and mask transfer values, and by safely escaping source-breaking layer and text content.
- Combined multiple fully opaque additive masks before clipping instead of intersecting them one at a time.
- BREAKING: Lottie text and color values now live under each accessor's
generated
overridesobject. Named text fields end inText, such asjobTitleTextandjobTitleTextColor; names already ending inTextare not changed twice. Other named fields include values such asmiamiArtworkColor1. Unnamed layers retain predictabletext1,color1, and later fallbacks. Move old direct arguments into the generated overrides class using the field shown by Dart analysis or generated API completion.
0.6.2 #
- Stopped committing the package lockfile so dependency-range compatibility is validated while keeping the example application reproducible.
- Made CI run the pinned Dart and Flutter release commands directly.
0.6.1 #
- Improved consumer documentation and package guidance for supported images and GIFs.
- Added complete Flutter platform runners to the example and an animated Lottie fixture with deterministic regression coverage.
- Updated generated Lottie animation startup for strict analysis with
very_good_analysis10.x. - Added the release checklist and tag-triggered trusted-publishing workflow for future releases.
0.6.0 #
- Extracted dotdart into its own public repository with standalone FVM, Makefile, CI, package documentation, and a runnable three-pipeline example.
- Added
<defs>,<clipPath>, andclip-path="url(#id)"support for SVG. SVGs with<defs>blocks containing<clipPath>definitions now parse and generate correctly. The clip path geometry is emitted as astatic final Pathfield and applied viacanvas.clipPath()in the generatedCustomPainter.clip-ruleon<clipPath>elements is respected (evenodd / nonzero). Non-existentclip-pathreferences produce a build warning and are treated as no-ops per the SVG spec.<use>and<symbol>remain unsupported. - Omit unused reusable paint fields from generated Lottie painters so fill-only and stroke-only animations remain warning-free under strict analysis.
- Raise the minimum
globversion to2.1.3so minimum-dependency test resolutions use a Dart 3-compatiblepackage:fileimplementation. - Use the Flutter SDK batch launchers in generated-consumer integration tests so the full suite runs on Windows as well as macOS and Linux.
0.5.0 #
- Added
maintainAspectRatio(defaulttrue) to generated SVG and Lottie widgets. When a caller passes bothwidthandheight, the widget now keeps the native aspect ratio by default, using the larger requested value as the reference dimension and recomputing the other. SetmaintainAspectRatio: falseto apply both dimensions directly (the previous behavior, which could distort). Image widgets are unaffected — they continue to use thefitparameter.
0.4.1 #
- Fixed image and GIF aspect-ratio calculations for width-only and height-only sizing.
- Fixed cold thumbhash placeholder decoding by preserving the complete AC coefficient payload.
- Replaced duplicate thumbhash runtime emitters with one canonical generated source.
- Changed namespace precaching to decode images sequentially for safer memory use on low-end devices.
- Restricted stale cleanup to files with dotdart's exact ownership header and added path, traversal, and symlink guards.
- Added strict configuration, identifier, reserved-word, duplicate-input, and generated-symbol validation.
- Added path-aware malformed Lottie errors and source-path context for asset parser failures.
- Centralized generated asset and parameter contracts across widget constructors and namespace accessors.
- Removed blanket generated-code lint suppression and added a real build_runner consumer fixture that analyzes and renders generated SVG, Lottie, static images, portrait images, landscape images, animated GIFs, and thumbhash output.
0.4.0 #
- Added image pipeline:
image:config key inpubspec.yamlfor images and GIFs (WebP, PNG, JPEG, GIF). Generates optimized$Namespace.assetName()accessors returningImage.assetwith decode-time downsampling, embedded thumbhash placeholders, dominant color, andRepaintBoundarywrapping. - Added build-time metadata embedding: intrinsic dimensions, format,
animated flag, dominant color, and thumbhash are probed at build time and
emitted as
static constfields in the generated widget — zero runtime dimension probing. - Added thumbhash instant placeholders: every generated image and GIF widget
renders a blurry thumbhash placeholder in frame 1 (before the real image
decodes) via a shared
_dotdartImageFrameBuilder. No flash of empty. - Added
_dotdartImageFrameBuildershared function +_DotdartThumbhashDecoder_DotdartThumbhashPainteremitted once per namespace file.
- Added
precachemethod andcacheKeyconstants to image and GIF namespaces for per-screen image memory management and coordinated cache warming. - Added
imagebuild-time dependency (^4.8.0) for pixel decoding, dominant color extraction, and thumbhash generation. Never imported by generated code. - Added an internal image/GIF asset type to the namespace enum.
- Documentation: README updated with image support section, quick-start example, and reframed purpose. AGENTS.md architecture tree updated.
- Tests: 22 new tests across models, parsers, thumbhash encoder, generator, and widget levels.
0.3.0 #
- BREAKING: Generated output is now grouped by source folder into namespace
classes. Each folder produces one flat
<folder>.g.dartfile (e.g.lib/gen/icons.g.dart) containing anabstract final class $NamespaceNamewith one static method per asset.- Before:
lib/gen/cross.g.dart→const Cross(width: 24). - After:
lib/gen/icons.g.dart→$Icons.cross(width: 24).
- Before:
- BREAKING: Widget classes are now library-private (prefixed with
_). Consumers must use the$Namespace.assetName(...)accessor methods, which returnWidget. Direct construction orfind.byTypewith the generated class is no longer possible from outside the generated file. - BREAKING: The old flat per-asset
.g.dartfiles are no longer generated. Existing flat files are deleted on the first build after upgrading. - Added: shared mixins in generated files —
_DotdartSvgSizingfor SVG widgets and_DotdartLottieAnimationState<T>for Lottie widgets — eliminating duplicatedbuild(),_defaultSizeFor(),_applyOpacity(), and lifecycle methods across all generated classes in a file. - Added:
DotdartNamespaceCollisionExceptionthrown when two assets in the same folder produce identical widget class names. - Added:
NamespaceAssemblerthat produces the combined namespace file with shared header, imports, mixins, and all widget classes. - Added:
AccessorParammodel andNaminghelper for deriving accessor/method names from file paths (camelCase for methods, PascalCase for classes). - Added: stale file cleanup — the post-process builder deletes
.g.dartfiles from previous runs that are no longer in the current output set. - Fixed: SVG generator no longer emits
widget.width/widget.heightinsideStatelessWidget.build()—StatelessWidgethas nowidgetproperty. This was masked by.g.dartanalysis exclusion. - Migration: update import paths from
package:<app>/gen/<asset>.g.darttopackage:<app>/gen/<folder>.g.dartand replace direct widget construction with$Namespace.assetName(...). In tests, find widgets viafind.byWidgetPredicate((w) => w.runtimeType.toString() == '_ClassName')instead offind.byType(ClassName).
0.2.0 #
- Add SVG pipeline:
<path>,<rect>,<circle>,<ellipse>,<line>,<polyline>,<polygon>elements with groups and transforms. - Presentation attributes:
fill,fill-opacity,fill-rule,stroke,stroke-width,stroke-linecap,stroke-linejoin,opacity. - Color theming: distinct fill/stroke colors become
color1,color2, … props (deduplicated), mirroring the Lottie color API. - Precompiled geometry: all SVG paths are converted to
static final Pathat build time — no runtime XML parsing, no picture cache allocation. - Generated widgets are
StatelessWidget(no animation machinery). - Sizing and layout mirror the Lottie widget pattern: aspect from viewBox,
LayoutBuilder/OverflowBoxfor fluid or explicit sizing. viewBoxsupport, includingmin-x/min-ycanvas offset.transformattribute:translate(),scale(),rotate().- Style inheritance: attributes on
<g>propagate to children. - Built-in minimal XML parser (no external
xmldependency needed).
0.1.0 #
- Initial release.
- Introduce the asset-to-Dart compiler architecture for turning supported visual asset formats into pure Dart widget code at build time.
- Ship the first asset pipeline with Lottie support: shape layers, rect/ellipse/path shapes, fills, strokes, groups, transforms, animated keyframes with bezier easing, hold keyframes, spatial tangents.
- Design the package for multiple asset types — each type gets its own parser and generator.
- Configuration via
dotdart:section inpubspec.yamlwith type-keyed entries (lottie:, futuresvg:). - Generated widgets:
StatefulWidget+CustomPainter, lifecycle-aware, nullableprogressprop for manual timeline control, per-color props. - Optimize generated animation hot paths with reusable paints, prebuilt static geometry and compound paths, specialized scalar evaluators, exact bezier result reuse, constant transform folding, and redundant transform removal.
- Keep supported translucent compound strokes visually unified without using
saveLayer. - PostProcessBuilder pattern (like
flutter_gen_runner) for configurable output directory.