svg_painter_annotation 0.1.1 copy "svg_painter_annotation: ^0.1.1" to clipboard
svg_painter_annotation: ^0.1.1 copied to clipboard

Annotations for the svg_painter code generator, enabling compilation of SVGs into Flutter CustomPainters.

svg_painter_annotation #

This package provides the annotations used by svg_painter to generate CustomPainter code from SVG files or code.

Usage #

Use the @SvgPainter annotation to mark a class for code generation.

From File #

Annotate a class with @SvgPainter.file to generate a painter from an SVG file in your asset bundle or package.

@SvgPainter.file('assets/my_icon.svg')
class MyIconPainter extends _$MyIconPainter {}

From Code #

Annotate a class with @SvgPainter.code to generate a painter directly from an SVG string.

@SvgPainter.code('<svg>...</svg>')
class MyInlinePainter extends _$MyInlinePainter {}

Features #

  • Type-Safe: Generates a dedicated CustomPainter subclass.
  • Compile-Time: No runtime XML parsing overhead.
1
likes
160
points
76
downloads

Publisher

unverified uploader

Weekly Downloads

Annotations for the svg_painter code generator, enabling compilation of SVGs into Flutter CustomPainters.

Homepage
Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

MIT (license)

Dependencies

meta

More

Packages that depend on svg_painter_annotation