SvgDocument class
A parsed SVG document, ready to be composited into a Scene via toGroup.
Parses a static subset of SVG 1.1 into this package's existing layer
types (PathLayer, Group) — see the package README's "SVG import"
section for exactly what's supported. There is no dedicated SvgLayer
type: an imported document is just a Group like any other, produced
once by parse rather than re-parsed on every render.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- naturalSize → Size2D?
-
The document's natural size, derived from its
viewBox(preferred) orwidth/heightattributes.nullif neither was present or parseable. Scale the result yourself via toGroup'stransform(e.g.LayerTransform(scale: Point2D(target.width / naturalSize.width, ...))) — there is no separatefitparameter, matching how every other layer kind in this package is scaled.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toGroup(
{String? id, LayerTransform transform = const LayerTransform(), Size2D? size, double opacity = 1.0, int zIndex = 0, bool visible = true}) → Group -
Composes the parsed document into a Group, ready to
scene.add(...). -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
parse(
String source) → SvgDocument -
Parses
source(SVG document text) into an SvgDocument.