Commit bc945f6
Changed files (2)
lib
l10n
model
lib/l10n/app_en.arb
@@ -393,5 +393,11 @@
"exportPdfHeaderFontSize": "Header font size",
"@exportPdfHeaderFontSize": {},
"exportPdfCellFontSize": "Row font size",
- "@exportPdfCellFontSize": {}
+ "@exportPdfCellFontSize": {},
+ "average": "Average",
+ "@average": {},
+ "maximum": "Maximum",
+ "@maximum": {},
+ "minimum": "Minimum",
+ "@minimum": {}
}
lib/model/export_import.dart
@@ -146,14 +146,15 @@ class ExportFileCreator {
pageFormat: PdfPageFormat.a4,
build: (pw.Context context) {
return [
- _buildDocumentTitle(dateFormatter, analyzer),
+ _buildPdfTitle(dateFormatter, analyzer),
+ _buildPdfStatistics(analyzer),
_buildPdfTable(data, dateFormatter),
];
}));
return await pdf.save();
}
- pw.Widget _buildDocumentTitle(DateFormat dateFormatter, BloodPressureAnalyser analyzer) {
+ pw.Widget _buildPdfTitle(DateFormat dateFormatter, BloodPressureAnalyser analyzer) {
return pw.Container(
child: pw.Text(
localizations.pdfDocumentTitle(dateFormatter.format(analyzer.firstDay!), dateFormatter.format(analyzer.lastDay!)),
@@ -164,6 +165,20 @@ class ExportFileCreator {
);
}
+ pw.Widget _buildPdfStatistics(BloodPressureAnalyser analyzer) {
+ return pw.Container(
+ margin: const pw.EdgeInsets.all(20),
+ child: pw.TableHelper.fromTextArray(
+ data: [
+ ['',localizations.sysLong, localizations.diaLong, localizations.pulLong], // TODO: localizations.pulsePressure],
+ [localizations.average, analyzer.avgDia, analyzer.avgSys, analyzer.avgPul],
+ [localizations.maximum, analyzer.maxDia, analyzer.maxSys, analyzer.maxPul],
+ [localizations.minimum, analyzer.minDia, analyzer.minSys, analyzer.minPul],
+ ]
+ ),
+ );
+ }
+
pw.Widget _buildPdfTable(List<BloodPressureRecord> data, DateFormat dateFormatter) {
final tableData = exportColumnsConfig.createTable(data, true);