toJson method
Der Block in der Form des Vertrags (expected/*.sheet*.json, npm 1.0):
kind line/logo/qr/brandMark, Felder englisch.
Implementation
Map<String, Object> toJson() => switch (this) {
SheetLine(:final text, :final bold, :final blank, :final doubleSizeLead) => {
'kind': 'line',
'text': text,
'bold': bold,
'blank': blank,
'doubleSizeLead': ?doubleSizeLead,
},
SheetLogoBlock(:final widthFraction, :final heightLines) => {
'kind': 'logo',
'widthFraction': widthFraction,
'heightLines': heightLines,
},
SheetQr(:final payload, :final widthFraction) => {'kind': 'qr', 'payload': payload, 'widthFraction': widthFraction},
SheetBrandMark(:final width, :final height) => {'kind': 'brandMark', 'width': width, 'height': height},
};