From 6b16dc234b5575b7e6574ddbed6e351f5ca86d32 Mon Sep 17 00:00:00 2001 From: Marc Rejohn Castillano Date: Sat, 21 Feb 2026 23:54:20 +0800 Subject: [PATCH] Status timestamps on task pdf --- lib/screens/tasks/task_pdf.dart | 45 +++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/lib/screens/tasks/task_pdf.dart b/lib/screens/tasks/task_pdf.dart index 976c7b61..e4074742 100644 --- a/lib/screens/tasks/task_pdf.dart +++ b/lib/screens/tasks/task_pdf.dart @@ -229,21 +229,38 @@ Future buildTaskPdfBytes( child: pw.Text(actionTakenText), ), pw.SizedBox(height: 12), - pw.Text('History updates:'), - pw.SizedBox(height: 6), - pw.Column( - crossAxisAlignment: pw.CrossAxisAlignment.start, + // Historical timestamps: always show the labels; values may be empty + pw.Row( children: [ - for (final log in logs) - pw.Row( - children: [ - pw.Text(AppTime.formatDate(log.createdAt)), - pw.SizedBox(width: 8), - pw.Text(AppTime.formatTime(log.createdAt)), - pw.SizedBox(width: 8), - pw.Text(log.actionType), - ], - ), + pw.Text('Created At:'), + pw.SizedBox(width: 8), + pw.Text( + '${AppTime.formatDate(task.createdAt)} ${AppTime.formatTime(task.createdAt)}', + ), + ], + ), + pw.SizedBox(height: 6), + pw.Row( + children: [ + pw.Text('Started At:'), + pw.SizedBox(width: 8), + pw.Text( + task.startedAt == null + ? '' + : '${AppTime.formatDate(task.startedAt!)} ${AppTime.formatTime(task.startedAt!)}', + ), + ], + ), + pw.SizedBox(height: 6), + pw.Row( + children: [ + pw.Text('Closed At:'), + pw.SizedBox(width: 8), + pw.Text( + task.completedAt == null + ? '' + : '${AppTime.formatDate(task.completedAt!)} ${AppTime.formatTime(task.completedAt!)}', + ), ], ), pw.SizedBox(height: 12),