Included a Markdown Text component and used it to draw the ReportDetails page
This commit is contained in:
@@ -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),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user