diff --git a/ac_web/lib/Widgets/LatestReportColumn.dart b/ac_web/lib/Widgets/LatestReportColumn.dart index b52065e..2bbb2e7 100644 --- a/ac_web/lib/Widgets/LatestReportColumn.dart +++ b/ac_web/lib/Widgets/LatestReportColumn.dart @@ -88,6 +88,8 @@ class _LatestReportColumnState extends State{ widgets.add(LatestReportEntry( text: reports[i].title, icon: icon, + author: reports[i].author, + timestamp: reports[i].timestamp, onTap: () => _openReport(report), )); } diff --git a/ac_web/lib/Widgets/LatestReportEntry.dart b/ac_web/lib/Widgets/LatestReportEntry.dart index a848a14..77ac32e 100644 --- a/ac_web/lib/Widgets/LatestReportEntry.dart +++ b/ac_web/lib/Widgets/LatestReportEntry.dart @@ -1,10 +1,19 @@ import 'package:flutter/material.dart'; class LatestReportEntry extends StatelessWidget{ - const LatestReportEntry({super.key, required this.text, required this.icon, this.onTap}); + const LatestReportEntry({ + super.key, + required this.text, + required this.icon, + required this.author, + required this.timestamp, + this.onTap, + }); final String text; final IconData icon; + final String author; + final DateTime timestamp; final VoidCallback? onTap; @override @@ -23,8 +32,28 @@ class LatestReportEntry extends StatelessWidget{ child: Row( children: [ Icon(icon), - Text(text), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + spacing: 4, + children: [ + // Long titles are wrapped over multiple lines instead of overflowing. + Text( + text, + softWrap: true, + style: Theme.of(context).textTheme.titleMedium, + ), + Text( + "$author • ${_timestampLabel()}", + softWrap: true, + style: Theme.of(context).textTheme.bodySmall, + ), + ], + ), + ), ], + crossAxisAlignment: CrossAxisAlignment.start, spacing: 8, ), margin: EdgeInsetsGeometry.all(16), @@ -32,4 +61,16 @@ class LatestReportEntry extends StatelessWidget{ ) ); } -} \ No newline at end of file + + /// e.g. "15.08.2025 09:05" + String _timestampLabel() { + final DateTime local = timestamp.toLocal(); + + final String day = local.day.toString().padLeft(2, '0'); + final String month = local.month.toString().padLeft(2, '0'); + final String hour = local.hour.toString().padLeft(2, '0'); + final String minute = local.minute.toString().padLeft(2, '0'); + + return "$day.$month.${local.year} $hour:$minute"; + } +}