vector_graphics_compiler library

Classes

AffineMatrix
An immutable affine matrix, a 3x3 column-major-order matrix in which the last row is always set to the identity values, i.e. 0 0 1.
CloseCommand
A straight line from the current point to the current contour start point.
Color
An immutable representation of a 32 bit color.
ColorMapper
A class that transforms from one color to another during SVG parsing.
CubicToCommand
A command describing a cubic Bezier command from the current point to x3,y3 using control points x1,y1 and x2,y2.
DrawCommand
A drawing command combining the index of a Path or an IndexedVertices with a Paint.
Fill
An immutable representation of filling attributes for a Paint.
Gradient
A shading program to apply to a Paint. Implemented in LinearGradient and RadialGradient.
IndexedVertices
An optimized version of Vertices that uses an index buffer to specify reused vertex points.
LinearGradient
A Gradient that describes a linear gradient from from to to.
LineToCommand
A straight line from the current point to x,y.
MoveToCommand
Moves the current point to x,y as if picking up the pen.
Paint
An immutable collection of painting attributes.
Path
An immutable collection of PathCommands.
PathBuilder
Creates a new builder of Path objects.
PathCommand
An abstract, immutable representation of a path verb and its associated points.
Point
An immutable position in two-dimensional space.
RadialGradient
Creates a radial gradient centered at center that ends at radius distance from the center.
Rect
An immutable, 2D, axis-aligned, floating-point rectangle whose coordinates are relative to a given origin.
ResolvedClipNode
A clip node where all paths are known and transformed in a single coordinate space.
ResolvedImageNode
An image node that has a fully resolved position and data.
ResolvedMaskNode
A mask node with child and mask fully resolved.
ResolvedPathNode
A path node that has its bounds fully computed.
ResolvedPatternNode
A pattern node that has a fully resolved position and data.
ResolvedTextNode
A block of text that has its position and final transfrom fully known.
ResolvedTextPositionNode
A text position update that is final and has a fully known transform.
ResolvedVerticesNode
A node that draws resolved vertices.
ResolvingVisitor
A visitor class that processes relative coordinates in the tree into a single coordinate space, removing extra attributes, empty nodes, resolving references/masks/clips.
Stroke
An immutable collection of stroking properties for a Paint.
SvgTheme
A theme used when decoding an SVG picture.
TextConfig
Additional text specific configuration that is added to the encoding.
TextDecoration
A linear decoration to draw near the text.
TextPosition
A description of how to update the current text position.
VectorInstructions
An immutable collection of vector instructions, with width and height specifying the viewport coordinates.
Vertices
A description of vertex points for drawing triangles.

Enums

BlendMode
The Porter-Duff algorithm to use for blending.
DrawCommandType
The drawing mode of a DrawCommand.
FontWeight
The value of the font weight.
GradientUnitMode
Determines how to transform the points given for a gradient.
PaintingStyle
Strategies for painting shapes and paths on a canvas.
PathCommandType
The available types of path verbs.
PathFillType
Specifies the winding rule that decies how the interior of a Path is calculated.
StrokeCap
Styles to use for line endings.
StrokeJoin
Styles to use for line segment joins.
TextDecorationStyle
The style in which to draw a text decoration
TileMode
Defines what happens at the edge of a gradient or the sampling of a source image in an ImageFilter.

Constants

boldFontWeight → const FontWeight
A commonly used font weight that is heavier than normal.
normalFontWeight → const FontWeight
The default font weight.

Functions

encodeSvg({required String xml, required String debugName, SvgTheme theme = const SvgTheme(), bool enableMaskingOptimizer = true, bool enableClippingOptimizer = true, bool enableOverdrawOptimizer = true, bool warningsAsErrors = false, bool useHalfPrecisionControlPoints = false, ColorMapper? colorMapper}) Uint8List
String input, String filename Encode an SVG input string into a vector_graphics binary format.
initializeLibPathOps(String path) → void
Initialize the libpathops dynamic library.
initializeLibTesselator(String path) → void
Initialize the libtesselator dynamic library.
initializePathOpsFromFlutterCache() bool
Look up the location of the pathops from flutter's artifact cache.
initializeTessellatorFromFlutterCache() bool
Look up the location of the tessellator from flutter's artifact cache.
parse(String xml, {String key = '', bool warningsAsErrors = false, SvgTheme theme = const SvgTheme(), bool enableMaskingOptimizer = true, bool enableClippingOptimizer = true, bool enableOverdrawOptimizer = true, ColorMapper? colorMapper}) VectorInstructions
Parses an SVG string into a VectorInstructions object.
parseSvgPathData(String svg, [PathFillType? type]) Path
Creates a new Path object from an SVG path data string.
parseWithoutOptimizers(String xml, {String key = '', bool warningsAsErrors = false, SvgTheme theme = const SvgTheme()}) VectorInstructions
Parses an SVG string into a VectorInstructions object, with all optional optimizers disabled.