save method

Uint8List save()

save API.

Implementation

Uint8List save() {
  final List<ChartPoint>? points = chart;
  return SheetTemplate(
    kind: SheetKind.score,
    skin: SheetSkin.tiles,
    direction: direction,
    theme: theme,
    font: font,
    fontBold: fontBold,
    owner: author,
    labels: SheetLabels(document: labels.document, notes: labels.next),
    subject: title,
    paragraphs: summary.isEmpty ? const <String>[] : <String>[summary],
    metrics: <(String, String)>[
      for (final BriefMetric metric in metrics)
        (metric.label, metric.hint.isEmpty ? metric.value : '${metric.value}  ${metric.hint}'),
    ],
    chart: points,
    sections: <TemplateSection>[
      if (next.isNotEmpty) TemplateSection(heading: labels.next, body: next.join('\n')),
    ],
    footer: footer.isEmpty ? author.name : footer,
  ).save();
}