dotdart 0.6.2
dotdart: ^0.6.2 copied to clipboard
Type-safe Flutter asset access that compiles SVG, Lottie, and images into optimized Dart widgets.
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.