fix:按html的假数据demo
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../data/models/models.dart';
|
||||
import '../../theme/app_icons.dart';
|
||||
import '../../theme/yanting_text.dart';
|
||||
import '../../theme/yanting_tokens.dart';
|
||||
import '../../theme/wise_tokens.dart';
|
||||
import '../../widgets/app_buttons.dart';
|
||||
import '../../widgets/app_card.dart';
|
||||
import '../../widgets/badges.dart';
|
||||
|
||||
@@ -32,9 +36,13 @@ class ReportCardWidget extends StatelessWidget {
|
||||
children: [
|
||||
AppBadge(text: report.interpretationLabel, kind: BadgeKind.brand),
|
||||
if (report.hasAudio)
|
||||
const AppBadge(text: '音频', icon: Icons.graphic_eq, kind: BadgeKind.audio),
|
||||
const AppBadge(
|
||||
text: '音频',
|
||||
icon: AppIcons.play,
|
||||
kind: BadgeKind.audio,
|
||||
),
|
||||
if (report.sourceTier.isNotEmpty)
|
||||
AppBadge(text: report.sourceTier, icon: Icons.verified_outlined, kind: BadgeKind.tier),
|
||||
AppBadge(text: report.sourceTier, kind: BadgeKind.tier),
|
||||
for (final topic in report.topics.take(3)) AppBadge(text: topic),
|
||||
],
|
||||
),
|
||||
@@ -44,8 +52,8 @@ class ReportCardWidget extends StatelessWidget {
|
||||
maxLines: hero ? 3 : 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: hero
|
||||
? Theme.of(context).textTheme.titleLarge
|
||||
: Theme.of(context).textTheme.titleMedium,
|
||||
? YantingText.sectionTitle.copyWith(fontSize: 21, height: 1.4)
|
||||
: YantingText.cardTitle,
|
||||
),
|
||||
if (report.oneLiner.isNotEmpty) ...[
|
||||
const SizedBox(height: WiseSpacing.x2),
|
||||
@@ -53,31 +61,44 @@ class ReportCardWidget extends StatelessWidget {
|
||||
report.oneLiner,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
style: YantingText.body.copyWith(
|
||||
color: YantingColors.mutedForeground,
|
||||
),
|
||||
),
|
||||
],
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
Row(
|
||||
Wrap(
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
spacing: 8,
|
||||
runSpacing: 8,
|
||||
children: [
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: onInstitutionTap,
|
||||
child: Text(
|
||||
'${report.institution.nameCn}${report.releasedAt == null ? '' : ' · ${formatDate(report.releasedAt)}'}',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
InkWell(
|
||||
onTap: onInstitutionTap,
|
||||
child: Text(
|
||||
report.institution.nameCn,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: YantingText.meta.copyWith(
|
||||
color: YantingColors.foreground,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (report.hasAudio)
|
||||
TextButton.icon(
|
||||
onPressed: onPlayTap,
|
||||
icon: const Icon(Icons.play_circle_outline, size: 18),
|
||||
label: const Text('听研报'),
|
||||
),
|
||||
if (report.releasedAt != null) ...[
|
||||
const _MetaDot(),
|
||||
Text(formatDate(report.releasedAt), style: YantingText.meta),
|
||||
],
|
||||
],
|
||||
),
|
||||
if (report.hasAudio) ...[
|
||||
const SizedBox(height: 14),
|
||||
AppButton(
|
||||
label: '听研报',
|
||||
icon: AppIcons.play,
|
||||
kind: hero ? AppButtonKind.primary : AppButtonKind.accent,
|
||||
onPressed: onPlayTap,
|
||||
),
|
||||
],
|
||||
],
|
||||
);
|
||||
return hero
|
||||
@@ -85,3 +106,19 @@ class ReportCardWidget extends StatelessWidget {
|
||||
: AppCard(onTap: onTap, child: child);
|
||||
}
|
||||
}
|
||||
|
||||
class _MetaDot extends StatelessWidget {
|
||||
const _MetaDot();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: 3,
|
||||
height: 3,
|
||||
decoration: const BoxDecoration(
|
||||
color: YantingColors.mutedForeground,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user