Status timestamps on task pdf

This commit is contained in:
Marc Rejohn Castillano 2026-02-21 23:54:20 +08:00
parent 302d52fe4f
commit 6b16dc234b

View File

@ -229,21 +229,38 @@ Future<Uint8List> 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),