toSvg method
Create an SVG file with this Barcode from String data
Implementation
@nonVirtual
String toSvg(
String data, {
double x = 0,
double y = 0,
double width = 200,
double height = 80,
bool drawText = true,
String fontFamily = 'monospace',
double? fontHeight,
double? textPadding,
int color = 0x000000,
bool fullSvg = true,
double baseline = .75,
}) {
fontHeight ??= height * 0.2;
textPadding ??= height * 0.05;
final recipe = make(
data,
width: width.toDouble(),
height: height.toDouble(),
drawText: drawText,
fontHeight: fontHeight,
textPadding: textPadding,
);
return _toSvg(recipe, x, y, width, height, fontFamily, fontHeight,
textPadding, color, fullSvg, baseline);
}