toSvg method
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,
})
Implementation
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 Iterable<BarcodeElement> 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);
}