Included a Markdown Text component and used it to draw the ReportDetails page

This commit is contained in:
2026-08-31 15:35:17 +02:00
parent a2528def24
commit 9c60b64bf0
2 changed files with 314 additions and 4 deletions
+8 -4
View File
@@ -1,5 +1,6 @@
import 'package:ac_web/Api/Dtos/EReportType.dart';
import 'package:ac_web/Api/Dtos/ReportDto.dart';
import 'package:ac_web/Widgets/MarkdownText.dart';
import 'package:flutter/material.dart';
/// Page that shows every detail of a single report, including the full text.
@@ -40,10 +41,13 @@ class ReportDetails extends StatelessWidget{
_buildInfoRow(context, "Date", _formatTimestamp(local)),
_buildInfoRow(context, "Id", report.id),
const Divider(),
SelectableText(
report.text.isEmpty ? "This report has no text." : report.text,
style: Theme.of(context).textTheme.bodyMedium,
),
if (report.text.isEmpty)
SelectableText(
"This report has no text.",
style: Theme.of(context).textTheme.bodyMedium,
)
else
MarkdownText(data: report.text),
],
),
),