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),