svg_painter 0.0.1-alpha.1
svg_painter: ^0.0.1-alpha.1 copied to clipboard
Code generator that converts SVG files to Flutter CustomPainter classes. Use with svg_painter_annotation.
svg_painter #
Code generator that converts SVG files to Flutter CustomPainter classes.
Status #
This package is under development. Full functionality coming soon.
Installation #
Add to your pubspec.yaml:
dependencies:
svg_painter_annotation: ^0.0.1
dev_dependencies:
svg_painter: ^0.0.1
build_runner: ^2.4.0
Usage #
- Annotate your class with
@SvgPainter:
import 'package:svg_painter_annotation/svg_painter_annotation.dart';
part 'my_icon.g.dart';
@SvgPainter(filePath: 'assets/icon.svg')
class MyIcon extends _$MyIcon {}
- Run the generator:
dart run build_runner build
- Use the generated widget:
MyIcon(
fillColor1: Colors.blue,
)
Features (Planned) #
Å
- Convert SVG files to CustomPainter code
- Support for basic shapes (circle, rect, path)
- Customizable color parameters
- Aspect ratio preservation
See Also #
- svg_painter_annotation - The annotation package