SvgImage constructor

SvgImage({
  1. required String svg,
  2. BoxFit fit = BoxFit.contain,
  3. Alignment alignment = Alignment.center,
  4. bool clip = true,
  5. double? width,
  6. double? height,
  7. PdfColor? colorFilter,
})

Implementation

factory SvgImage({
  required String svg,
  BoxFit fit = BoxFit.contain,
  Alignment alignment = Alignment.center,
  bool clip = true,
  double? width,
  double? height,
  PdfColor? colorFilter,
}) {
  final xml = XmlDocument.parse(svg);
  final parser = SvgParser(
    xml: xml,
    colorFilter: colorFilter,
  );

  return SvgImage._fromParser(
    parser,
    fit,
    alignment,
    clip,
    width,
    height,
  );
}