fix:按html的假数据demo
This commit is contained in:
@@ -4,6 +4,9 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
|
||||
import '../../../data/api/report_data_source.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_card.dart';
|
||||
import '../../../widgets/badges.dart';
|
||||
@@ -50,7 +53,7 @@ class ModuleRendererRegistry {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_ModuleHeader(module: module),
|
||||
const SizedBox(height: WiseSpacing.x4),
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
_contentFor(
|
||||
context,
|
||||
type: module.type,
|
||||
@@ -66,12 +69,12 @@ class ModuleRendererRegistry {
|
||||
compact: module.renderMode != 'inline',
|
||||
),
|
||||
if (module.hasDetailPage) ...[
|
||||
const SizedBox(height: WiseSpacing.x4),
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: TextButton.icon(
|
||||
onPressed: openDetail,
|
||||
icon: const Icon(Icons.open_in_new),
|
||||
icon: const Icon(AppIcons.externalLink),
|
||||
label: const Text('查看详情'),
|
||||
),
|
||||
),
|
||||
@@ -183,20 +186,20 @@ class ModuleDetailPage extends HookConsumerWidget {
|
||||
body: snapshot.connectionState != ConnectionState.done
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: snapshot.hasError
|
||||
? Center(
|
||||
child: TextButton(
|
||||
onPressed: () => retryCount.value++,
|
||||
child: Text(
|
||||
snapshot.error.toString(),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
)
|
||||
: _ModuleDetailContent(
|
||||
detail: snapshot.data!,
|
||||
report: report,
|
||||
registry: registry,
|
||||
? Center(
|
||||
child: TextButton(
|
||||
onPressed: () => retryCount.value++,
|
||||
child: Text(
|
||||
snapshot.error.toString(),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
)
|
||||
: _ModuleDetailContent(
|
||||
detail: snapshot.data!,
|
||||
report: report,
|
||||
registry: registry,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -215,8 +218,13 @@ class _ModuleDetailContent extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView(
|
||||
padding: const EdgeInsets.all(WiseSpacing.x4),
|
||||
padding: const EdgeInsets.fromLTRB(WiseSpacing.x4, 4, WiseSpacing.x4, 16),
|
||||
children: [
|
||||
Text(
|
||||
detail.titleCn,
|
||||
style: YantingText.sectionTitle.copyWith(fontSize: 21),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x2),
|
||||
AppCard(
|
||||
child: registry.page(
|
||||
context,
|
||||
@@ -226,10 +234,7 @@ class _ModuleDetailContent extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
Text(
|
||||
'缓存版本 ${detail.cacheVersion}',
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
Text('缓存版本 ${detail.cacheVersion}', style: YantingText.meta),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -247,7 +252,7 @@ class _ModuleHeader extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Text(
|
||||
module.titleCn,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
style: YantingText.cardTitle.copyWith(fontSize: 17),
|
||||
),
|
||||
),
|
||||
if (module.layer.isNotEmpty)
|
||||
@@ -276,7 +281,7 @@ class _BasicInfo extends StatelessWidget {
|
||||
payload['summary_cn'],
|
||||
asString(payload['scope_cn'], report?.oneLiner ?? ''),
|
||||
),
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
style: YantingText.body,
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x2),
|
||||
Wrap(
|
||||
@@ -306,8 +311,14 @@ class _CoreInsights extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
for (final point in points)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: WiseSpacing.x3),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(bottom: WiseSpacing.x3),
|
||||
padding: const EdgeInsets.all(WiseSpacing.x3),
|
||||
decoration: BoxDecoration(
|
||||
color: YantingColors.background,
|
||||
border: Border.all(color: YantingColors.border),
|
||||
borderRadius: BorderRadius.circular(YantingRadius.md),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -316,10 +327,7 @@ class _CoreInsights extends StatelessWidget {
|
||||
kind: _kindBadge(asString(point['kind'])),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x1),
|
||||
Text(
|
||||
asString(point['text']),
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
Text(asString(point['text']), style: YantingText.body),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -341,13 +349,10 @@ class _SourceCompliance extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (asString(payload['source_note']).isNotEmpty)
|
||||
Text(
|
||||
asString(payload['source_note']),
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
Text(asString(payload['source_note']), style: YantingText.body),
|
||||
if (institution != null) ...[
|
||||
const SizedBox(height: WiseSpacing.x4),
|
||||
Text('发布机构', style: Theme.of(context).textTheme.titleMedium),
|
||||
Text('发布机构', style: YantingText.cardTitle.copyWith(fontSize: 17)),
|
||||
const SizedBox(height: WiseSpacing.x2),
|
||||
_InfoLine(label: '机构名称', value: institution.nameCn),
|
||||
if (institution.nameEn.isNotEmpty)
|
||||
@@ -373,24 +378,20 @@ class _SourceCompliance extends StatelessWidget {
|
||||
],
|
||||
if (asString(payload['copyright_cn']).isNotEmpty) ...[
|
||||
const SizedBox(height: WiseSpacing.x4),
|
||||
Text(
|
||||
asString(payload['copyright_cn']),
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
Text(asString(payload['copyright_cn']), style: YantingText.meta),
|
||||
],
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0x109A6500),
|
||||
borderRadius: BorderRadius.circular(WiseRadius.sm),
|
||||
color: YantingColors.background,
|
||||
border: Border.all(color: YantingColors.border),
|
||||
borderRadius: BorderRadius.circular(YantingRadius.md),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(WiseSpacing.x3),
|
||||
child: Text(
|
||||
asString(payload['disclaimer'], '本内容为公开/授权研报的结构化解读,不构成投资建议。'),
|
||||
style: Theme.of(
|
||||
context,
|
||||
).textTheme.bodySmall?.copyWith(color: WiseColors.warning),
|
||||
style: YantingText.meta.copyWith(color: YantingColors.warning),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -415,12 +416,12 @@ class _InfoLine extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
label,
|
||||
style: Theme.of(
|
||||
context,
|
||||
).textTheme.labelSmall?.copyWith(color: WiseColors.ink700),
|
||||
style: YantingText.badge.copyWith(
|
||||
color: YantingColors.mutedForeground,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x1),
|
||||
Text(value, style: Theme.of(context).textTheme.bodyMedium),
|
||||
Text(value, style: YantingText.body),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -478,14 +479,12 @@ class _InstitutionModule extends StatelessWidget {
|
||||
final name = asString(payload['name_cn'], report?.institution.nameCn ?? '');
|
||||
return Row(
|
||||
children: [
|
||||
const Icon(Icons.account_balance_outlined, color: WiseColors.primary),
|
||||
const Icon(AppIcons.bank, color: YantingColors.foreground),
|
||||
const SizedBox(width: WiseSpacing.x2),
|
||||
Expanded(
|
||||
child: Text(name, style: Theme.of(context).textTheme.bodyMedium),
|
||||
),
|
||||
Expanded(child: Text(name, style: YantingText.body)),
|
||||
Text(
|
||||
'${asInt(payload['report_count'], report?.institution.reportCount ?? 0)} 份',
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
style: YantingText.meta,
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -509,19 +508,15 @@ class _SectionsModule extends StatelessWidget {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (summary.isNotEmpty)
|
||||
Text(summary, style: Theme.of(context).textTheme.bodyMedium),
|
||||
if (summary.isNotEmpty) Text(summary, style: YantingText.body),
|
||||
for (final section in sections) ...[
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
Text(
|
||||
asString(section['heading']),
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
style: YantingText.cardTitle.copyWith(fontSize: 17),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x1),
|
||||
Text(
|
||||
asString(section['body']),
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
Text(asString(section['body']), style: YantingText.body),
|
||||
],
|
||||
],
|
||||
);
|
||||
@@ -542,39 +537,40 @@ class _KeyDataModule extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
for (final row in rows)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: WiseSpacing.x4),
|
||||
child: Column(
|
||||
Container(
|
||||
margin: const EdgeInsets.only(bottom: WiseSpacing.x3),
|
||||
padding: const EdgeInsets.all(WiseSpacing.x3),
|
||||
decoration: BoxDecoration(
|
||||
color: YantingColors.secondary,
|
||||
borderRadius: BorderRadius.circular(YantingRadius.md),
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
asString(row['metric']),
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(asString(row['metric']), style: YantingText.meta),
|
||||
const SizedBox(height: 6),
|
||||
Text(
|
||||
asString(row['judgment'], asString(row['importance'])),
|
||||
style: YantingText.body.copyWith(
|
||||
color: YantingColors.foreground,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x1),
|
||||
const SizedBox(width: WiseSpacing.x2),
|
||||
Text(
|
||||
_valueWithUnit(row),
|
||||
style: Theme.of(context).textTheme.bodyLarge,
|
||||
textAlign: TextAlign.right,
|
||||
style: YantingText.cardTitle.copyWith(
|
||||
fontSize: 17,
|
||||
fontFeatures: YantingTypographyFeatures.tabularNums,
|
||||
),
|
||||
),
|
||||
if (asString(
|
||||
row['judgment'],
|
||||
asString(row['importance']),
|
||||
).isNotEmpty) ...[
|
||||
const SizedBox(height: WiseSpacing.x1),
|
||||
Text(
|
||||
asString(row['judgment'], asString(row['importance'])),
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
],
|
||||
if (asString(row['importance']).isNotEmpty &&
|
||||
asString(row['importance']) !=
|
||||
asString(row['judgment'])) ...[
|
||||
const SizedBox(height: WiseSpacing.x1),
|
||||
Text(
|
||||
asString(row['importance']),
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -596,37 +592,81 @@ class _TimelineModule extends StatelessWidget {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
for (final event in events)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: WiseSpacing.x4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (asString(event['date']).isNotEmpty)
|
||||
Text(
|
||||
asString(event['date']),
|
||||
style: Theme.of(
|
||||
context,
|
||||
).textTheme.labelSmall?.copyWith(color: WiseColors.primary),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x1),
|
||||
Text(
|
||||
asString(event['event']),
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x1),
|
||||
Text(
|
||||
asString(event['impact']),
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
],
|
||||
),
|
||||
for (var index = 0; index < events.length; index++)
|
||||
_TimelineEntry(
|
||||
event: events[index],
|
||||
isLast: index == events.length - 1,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _TimelineEntry extends StatelessWidget {
|
||||
const _TimelineEntry({required this.event, required this.isLast});
|
||||
|
||||
final JsonMap event;
|
||||
final bool isLast;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return IntrinsicHeight(
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Container(
|
||||
width: 9,
|
||||
height: 9,
|
||||
margin: const EdgeInsets.only(top: 6),
|
||||
decoration: const BoxDecoration(
|
||||
color: YantingColors.primary,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
if (!isLast)
|
||||
Expanded(
|
||||
child: Container(
|
||||
width: 1,
|
||||
margin: const EdgeInsets.symmetric(vertical: 4),
|
||||
color: YantingColors.border,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(width: WiseSpacing.x2),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(bottom: WiseSpacing.x3),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (asString(event['date']).isNotEmpty)
|
||||
Text(
|
||||
asString(event['date']),
|
||||
style: YantingText.meta.copyWith(
|
||||
color: YantingColors.foreground,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x1),
|
||||
Text(
|
||||
asString(event['event']),
|
||||
style: YantingText.cardTitle.copyWith(fontSize: 17),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x1),
|
||||
Text(asString(event['impact']), style: YantingText.body),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _StudyGuideModule extends StatelessWidget {
|
||||
const _StudyGuideModule({required this.payload, required this.compact});
|
||||
|
||||
@@ -642,21 +682,15 @@ class _StudyGuideModule extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (asString(payload['intro_cn']).isNotEmpty)
|
||||
Text(
|
||||
asString(payload['intro_cn']),
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
Text(asString(payload['intro_cn']), style: YantingText.body),
|
||||
for (final item in faqs)
|
||||
ExpansionTile(
|
||||
tilePadding: EdgeInsets.zero,
|
||||
title: Text(asString(item['question'])),
|
||||
title: Text(asString(item['question']), style: YantingText.body),
|
||||
children: [
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
asString(item['answer']),
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
child: Text(asString(item['answer']), style: YantingText.body),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -694,7 +728,7 @@ class _StructureGraphModule extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
asString(payload['root']),
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
style: YantingText.cardTitle.copyWith(fontSize: 17),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
for (final node in nodes)
|
||||
@@ -705,16 +739,13 @@ class _StructureGraphModule extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
asString(node['label']),
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
style: YantingText.cardTitle.copyWith(fontSize: 17),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x1),
|
||||
for (final child in asStringList(node['children']))
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: WiseSpacing.x1),
|
||||
child: Text(
|
||||
child,
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
child: Text(child, style: YantingText.body),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -745,12 +776,12 @@ class _RelatedSourcesModule extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
asString(item['title']),
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
style: YantingText.cardTitle.copyWith(fontSize: 17),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x1),
|
||||
Text(
|
||||
asString(item['summary_cn'], asString(item['source_name'])),
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
style: YantingText.body,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -784,34 +815,34 @@ class _DifferentiatedViewModule extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
asString(item['topic']),
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
style: YantingText.cardTitle.copyWith(fontSize: 17),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x2),
|
||||
if (asString(item['consensus_view']).isNotEmpty) ...[
|
||||
Text(
|
||||
'常见观点',
|
||||
style: Theme.of(
|
||||
context,
|
||||
).textTheme.labelSmall?.copyWith(color: WiseColors.ink700),
|
||||
style: YantingText.badge.copyWith(
|
||||
color: YantingColors.mutedForeground,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x1),
|
||||
Text(
|
||||
asString(item['consensus_view']),
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
style: YantingText.body,
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x2),
|
||||
],
|
||||
if (asString(item['report_position']).isNotEmpty) ...[
|
||||
Text(
|
||||
'报告观点',
|
||||
style: Theme.of(
|
||||
context,
|
||||
).textTheme.labelSmall?.copyWith(color: WiseColors.primary),
|
||||
style: YantingText.badge.copyWith(
|
||||
color: YantingColors.foreground,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x1),
|
||||
Text(
|
||||
asString(item['report_position']),
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
style: YantingText.body,
|
||||
),
|
||||
],
|
||||
],
|
||||
@@ -842,10 +873,7 @@ class _WeaknessesModule extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (asString(payload['disclaimer_cn']).isNotEmpty)
|
||||
Text(
|
||||
asString(payload['disclaimer_cn']),
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
Text(asString(payload['disclaimer_cn']), style: YantingText.meta),
|
||||
for (final item in items)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
@@ -857,13 +885,10 @@ class _WeaknessesModule extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
asString(item['topic']),
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
style: YantingText.cardTitle.copyWith(fontSize: 17),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x1),
|
||||
Text(
|
||||
asString(item['weakness']),
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
Text(asString(item['weakness']), style: YantingText.body),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -881,9 +906,9 @@ class _WeaknessesModule extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
'需要继续验证',
|
||||
style: Theme.of(
|
||||
context,
|
||||
).textTheme.labelSmall?.copyWith(color: WiseColors.warning),
|
||||
style: YantingText.badge.copyWith(
|
||||
color: YantingColors.warning,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x1),
|
||||
for (final note
|
||||
@@ -892,10 +917,7 @@ class _WeaknessesModule extends StatelessWidget {
|
||||
: counterEvidence)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: WiseSpacing.x1),
|
||||
child: Text(
|
||||
note,
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
child: Text(note, style: YantingText.meta),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -922,15 +944,11 @@ class _Preview extends StatelessWidget {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (headline.isNotEmpty)
|
||||
Text(headline, style: Theme.of(context).textTheme.bodyMedium),
|
||||
if (headline.isNotEmpty) Text(headline, style: YantingText.body),
|
||||
for (final item in highlights.take(3))
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: WiseSpacing.x1),
|
||||
child: Text(
|
||||
'• $item',
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
child: Text('• $item', style: YantingText.meta),
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -953,7 +971,7 @@ class _TextLines extends StatelessWidget {
|
||||
.join('\n');
|
||||
return Text(
|
||||
values.isEmpty ? '该模块暂无可展示内容。' : values,
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
style: YantingText.body,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,9 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
|
||||
import '../../data/api/report_data_source.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';
|
||||
@@ -42,10 +45,11 @@ class ReportDetailPage extends HookConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final retryCount = useState(0);
|
||||
final detailFuture = useMemoized(
|
||||
() => dataSource.reportDetail(reportId),
|
||||
[dataSource, reportId, retryCount.value],
|
||||
);
|
||||
final detailFuture = useMemoized(() => dataSource.reportDetail(reportId), [
|
||||
dataSource,
|
||||
reportId,
|
||||
retryCount.value,
|
||||
]);
|
||||
final snapshot = useFuture(detailFuture);
|
||||
const registry = ModuleRendererRegistry();
|
||||
|
||||
@@ -54,20 +58,20 @@ class ReportDetailPage extends HookConsumerWidget {
|
||||
body: snapshot.connectionState != ConnectionState.done
|
||||
? const LoadingState()
|
||||
: snapshot.hasError
|
||||
? ErrorState(
|
||||
message: snapshot.error.toString(),
|
||||
onRetry: () => retryCount.value++,
|
||||
)
|
||||
: _ReportDetailContent(
|
||||
detail: snapshot.data!,
|
||||
dataSource: dataSource,
|
||||
player: player,
|
||||
onStartAudio: onStartAudio,
|
||||
onToggleAudio: onToggleAudio,
|
||||
onSeekAudio: onSeekAudio,
|
||||
onSpeed: onSpeed,
|
||||
registry: registry,
|
||||
),
|
||||
? ErrorState(
|
||||
message: snapshot.error.toString(),
|
||||
onRetry: () => retryCount.value++,
|
||||
)
|
||||
: _ReportDetailContent(
|
||||
detail: snapshot.data!,
|
||||
dataSource: dataSource,
|
||||
player: player,
|
||||
onStartAudio: onStartAudio,
|
||||
onToggleAudio: onToggleAudio,
|
||||
onSeekAudio: onSeekAudio,
|
||||
onSpeed: onSpeed,
|
||||
registry: registry,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -102,10 +106,11 @@ class _ReportDetailContent extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView(
|
||||
padding: const EdgeInsets.all(WiseSpacing.x4),
|
||||
padding: const EdgeInsets.fromLTRB(WiseSpacing.x4, 4, WiseSpacing.x4, 16),
|
||||
children: [
|
||||
AppCard(
|
||||
color: WiseColors.secondary200,
|
||||
color: YantingColors.brandSoft,
|
||||
borderColor: YantingColors.brandSoftBorder,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -120,12 +125,11 @@ class _ReportDetailContent extends StatelessWidget {
|
||||
if (detail.hasAudio)
|
||||
const AppBadge(
|
||||
text: '音频',
|
||||
icon: Icons.graphic_eq,
|
||||
icon: AppIcons.playCircle,
|
||||
kind: BadgeKind.audio,
|
||||
),
|
||||
AppBadge(
|
||||
text: asString(detail.source['source_tier']),
|
||||
icon: Icons.verified_outlined,
|
||||
kind: BadgeKind.tier,
|
||||
),
|
||||
],
|
||||
@@ -135,19 +139,16 @@ class _ReportDetailContent extends StatelessWidget {
|
||||
detail.titleCn,
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Theme.of(context).textTheme.headlineSmall,
|
||||
style: YantingText.sectionTitle.copyWith(fontSize: 21),
|
||||
),
|
||||
if (detail.oneLiner.isNotEmpty) ...[
|
||||
const SizedBox(height: WiseSpacing.x2),
|
||||
Text(
|
||||
detail.oneLiner,
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
Text(detail.oneLiner, style: YantingText.body),
|
||||
],
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
Text(
|
||||
'${detail.institution.nameCn} · ${formatDate(detail.releasedAt)}',
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
style: YantingText.meta,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -188,17 +189,16 @@ class _ActionBar extends StatelessWidget {
|
||||
Expanded(
|
||||
child: AppButton(
|
||||
label: '收藏',
|
||||
icon: Icons.favorite_border,
|
||||
icon: AppIcons.heart,
|
||||
kind: AppButtonKind.ghost,
|
||||
onPressed: () =>
|
||||
showLoginSheet(context, reason: '登录后保存到你的收藏'),
|
||||
onPressed: () => showLoginSheet(context, reason: '登录后保存到你的收藏'),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: WiseSpacing.x2),
|
||||
Expanded(
|
||||
child: AppButton(
|
||||
label: '原文',
|
||||
icon: Icons.open_in_new,
|
||||
icon: AppIcons.externalLink,
|
||||
kind: AppButtonKind.ghost,
|
||||
onPressed: () => showOutboundSheet(context, title: detail.titleCn),
|
||||
),
|
||||
|
||||
@@ -9,6 +9,7 @@ import '../../routing/app_routes.dart';
|
||||
import '../../theme/wise_tokens.dart';
|
||||
import '../../widgets/badges.dart';
|
||||
import '../../widgets/mini_player.dart';
|
||||
import '../../widgets/page_header.dart';
|
||||
import '../../widgets/states.dart';
|
||||
import '../shared/report_card_widget.dart';
|
||||
|
||||
@@ -27,7 +28,13 @@ class FeedPage extends HookConsumerWidget {
|
||||
final ReportDataSource dataSource;
|
||||
final void Function(AudioItem item) onPlay;
|
||||
final PlayerStateModel player;
|
||||
final void Function(String audioId, String reportId, String title, int durationSec)? onStartModuleAudio;
|
||||
final void Function(
|
||||
String audioId,
|
||||
String reportId,
|
||||
String title,
|
||||
int durationSec,
|
||||
)?
|
||||
onStartModuleAudio;
|
||||
final VoidCallback? onToggleAudio;
|
||||
final void Function(int delta)? onSeekAudio;
|
||||
final VoidCallback? onSpeed;
|
||||
@@ -45,19 +52,27 @@ class FeedPage extends HookConsumerWidget {
|
||||
),
|
||||
data: (items) {
|
||||
final currentTopic = topic.value;
|
||||
final topics = ['全部', ...{for (final item in items) ...item.topics}];
|
||||
final topics = [
|
||||
'全部',
|
||||
...{for (final item in items) ...item.topics},
|
||||
];
|
||||
final visible = currentTopic == '全部'
|
||||
? items
|
||||
: items.where((item) => item.topics.contains(currentTopic)).toList();
|
||||
: items
|
||||
.where((item) => item.topics.contains(currentTopic))
|
||||
.toList();
|
||||
if (items.isEmpty) {
|
||||
return const EmptyState(
|
||||
title: '暂无可推荐的研报解读',
|
||||
message: '稍后再来看看最新内容',
|
||||
);
|
||||
return const EmptyState(title: '暂无可推荐的研报解读', message: '稍后再来看看最新内容');
|
||||
}
|
||||
return ListView(
|
||||
padding: const EdgeInsets.all(WiseSpacing.x4),
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
WiseSpacing.x4,
|
||||
4,
|
||||
WiseSpacing.x4,
|
||||
16,
|
||||
),
|
||||
children: [
|
||||
const PageHeader(title: '研听', subtitle: '全球机构研报中文解读'),
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Row(
|
||||
@@ -98,8 +113,7 @@ class FeedPage extends HookConsumerWidget {
|
||||
onPlayTap: () => _playFromReport(onPlay, visible.first),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x5),
|
||||
Text('最新解读', style: Theme.of(context).textTheme.titleMedium),
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
const SectionTitle(title: '最新解读', icon: Icons.chevron_right),
|
||||
for (final report in visible.skip(1)) ...[
|
||||
ReportCardWidget(
|
||||
report: report,
|
||||
|
||||
@@ -5,12 +5,16 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import '../../data/api/report_data_source.dart';
|
||||
import '../../data/models/models.dart';
|
||||
import '../../routing/app_routes.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';
|
||||
import '../../widgets/sheets.dart';
|
||||
import '../../widgets/states.dart';
|
||||
import '../../widgets/institution_card.dart';
|
||||
import '../shared/report_card_widget.dart';
|
||||
|
||||
class InstitutionDetailPage extends HookConsumerWidget {
|
||||
@@ -37,14 +41,14 @@ class InstitutionDetailPage extends HookConsumerWidget {
|
||||
body: snapshot.connectionState != ConnectionState.done
|
||||
? const LoadingState()
|
||||
: snapshot.hasError
|
||||
? ErrorState(
|
||||
message: snapshot.error.toString(),
|
||||
onRetry: () => retryCount.value++,
|
||||
)
|
||||
: _InstitutionDetailContent(
|
||||
item: snapshot.data!,
|
||||
dataSource: dataSource,
|
||||
),
|
||||
? ErrorState(
|
||||
message: snapshot.error.toString(),
|
||||
onRetry: () => retryCount.value++,
|
||||
)
|
||||
: _InstitutionDetailContent(
|
||||
item: snapshot.data!,
|
||||
dataSource: dataSource,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -61,26 +65,47 @@ class _InstitutionDetailContent extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView(
|
||||
padding: const EdgeInsets.all(WiseSpacing.x4),
|
||||
padding: const EdgeInsets.fromLTRB(WiseSpacing.x4, 4, WiseSpacing.x4, 16),
|
||||
children: [
|
||||
AppCard(
|
||||
color: WiseColors.secondary200,
|
||||
color: YantingColors.brandSoft,
|
||||
borderColor: YantingColors.brandSoftBorder,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(item.nameCn, style: Theme.of(context).textTheme.headlineSmall),
|
||||
if (item.nameEn.isNotEmpty)
|
||||
Text(item.nameEn, style: Theme.of(context).textTheme.bodyMedium),
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
Wrap(
|
||||
spacing: WiseSpacing.x2,
|
||||
runSpacing: WiseSpacing.x2,
|
||||
Row(
|
||||
children: [
|
||||
AppBadge(
|
||||
text: item.sourceTier,
|
||||
icon: Icons.verified_outlined,
|
||||
kind: BadgeKind.tier,
|
||||
InstitutionLogo(
|
||||
logoUrl: item.logoUrl,
|
||||
initials: item.nameCn.isEmpty
|
||||
? '研'
|
||||
: item.nameCn.characters.take(2).toString(),
|
||||
size: 48,
|
||||
),
|
||||
const SizedBox(width: 14),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
item.nameCn,
|
||||
style: YantingText.sectionTitle.copyWith(
|
||||
fontSize: 21,
|
||||
),
|
||||
),
|
||||
if (item.nameEn.isNotEmpty)
|
||||
Text(item.nameEn, style: YantingText.meta),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
Wrap(
|
||||
spacing: 8,
|
||||
runSpacing: 8,
|
||||
children: [
|
||||
AppBadge(text: item.sourceTier, kind: BadgeKind.tier),
|
||||
AppBadge(
|
||||
text: '${item.reportCount} 份研报',
|
||||
kind: BadgeKind.brand,
|
||||
@@ -93,28 +118,23 @@ class _InstitutionDetailContent extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
if (item.introCn.isNotEmpty)
|
||||
AppCard(
|
||||
child: Text(item.introCn, style: Theme.of(context).textTheme.bodyMedium),
|
||||
),
|
||||
AppCard(child: Text(item.introCn, style: YantingText.body)),
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
if (item.credibilityNote.isNotEmpty)
|
||||
AppCard(
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Icon(Icons.verified_user_outlined, color: WiseColors.positive),
|
||||
const Icon(AppIcons.shield, color: YantingColors.chart2),
|
||||
const SizedBox(width: WiseSpacing.x2),
|
||||
Expanded(
|
||||
child: Text(
|
||||
item.credibilityNote,
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
child: Text(item.credibilityNote, style: YantingText.body),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x5),
|
||||
Text('最新研报', style: Theme.of(context).textTheme.titleMedium),
|
||||
Text('最新研报', style: YantingText.sectionTitle.copyWith(fontSize: 21)),
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
if (item.recentReports.isEmpty)
|
||||
const EmptyState(
|
||||
@@ -132,7 +152,7 @@ class _InstitutionDetailContent extends StatelessWidget {
|
||||
],
|
||||
AppButton(
|
||||
label: '了解相关服务',
|
||||
icon: Icons.open_in_new,
|
||||
icon: AppIcons.externalLink,
|
||||
kind: AppButtonKind.ghost,
|
||||
expand: true,
|
||||
onPressed: () => showOutboundSheet(context, title: item.nameCn),
|
||||
|
||||
@@ -3,11 +3,10 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
|
||||
import '../../data/api/report_data_source.dart';
|
||||
import '../../data/content_providers.dart';
|
||||
import '../../data/models/models.dart';
|
||||
import '../../routing/app_routes.dart';
|
||||
import '../../theme/wise_tokens.dart';
|
||||
import '../../widgets/app_card.dart';
|
||||
import '../../widgets/badges.dart';
|
||||
import '../../widgets/institution_card.dart';
|
||||
import '../../widgets/page_header.dart';
|
||||
import '../../widgets/states.dart';
|
||||
|
||||
class InstitutionsPage extends HookConsumerWidget {
|
||||
@@ -35,18 +34,19 @@ class InstitutionsPage extends HookConsumerWidget {
|
||||
);
|
||||
}
|
||||
return ListView(
|
||||
padding: const EdgeInsets.all(WiseSpacing.x4),
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
WiseSpacing.x4,
|
||||
4,
|
||||
WiseSpacing.x4,
|
||||
16,
|
||||
),
|
||||
children: [
|
||||
Text('研报来源机构', style: Theme.of(context).textTheme.titleLarge),
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
const PageHeader(title: '机构', subtitle: '可获取研报的机构'),
|
||||
for (final item in sorted) ...[
|
||||
InstitutionCard(
|
||||
institution: item,
|
||||
onTap: () => openInstitutionDetail(
|
||||
context,
|
||||
dataSource,
|
||||
item.id,
|
||||
),
|
||||
onTap: () =>
|
||||
openInstitutionDetail(context, dataSource, item.id),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
],
|
||||
@@ -56,76 +56,3 @@ class InstitutionsPage extends HookConsumerWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class InstitutionCard extends StatelessWidget {
|
||||
const InstitutionCard({required this.institution, required this.onTap, super.key});
|
||||
|
||||
final Institution institution;
|
||||
final VoidCallback onTap;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final initials = institution.nameCn.isEmpty
|
||||
? '研'
|
||||
: institution.nameCn.characters.take(2).toString();
|
||||
return AppCard(
|
||||
onTap: onTap,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 25,
|
||||
backgroundColor: WiseColors.secondary200,
|
||||
foregroundColor: WiseColors.primary,
|
||||
child: Text(
|
||||
initials,
|
||||
style: const TextStyle(fontWeight: FontWeight.w800),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: WiseSpacing.x3),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
institution.nameCn,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
if (institution.nameEn.isNotEmpty)
|
||||
Text(
|
||||
institution.nameEn,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x2),
|
||||
Wrap(
|
||||
spacing: WiseSpacing.x2,
|
||||
runSpacing: WiseSpacing.x2,
|
||||
children: [
|
||||
if (institution.institutionType.isNotEmpty)
|
||||
AppBadge(text: institution.institutionType),
|
||||
for (final topic in institution.coveredTopics.take(3))
|
||||
AppBadge(text: topic, kind: BadgeKind.brand),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: WiseSpacing.x2),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
'${institution.reportCount}',
|
||||
style: Theme.of(context).textTheme.titleMedium?.copyWith(
|
||||
color: WiseColors.primary,
|
||||
),
|
||||
),
|
||||
Text('份研报', style: Theme.of(context).textTheme.bodySmall),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,13 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import '../../data/api/report_data_source.dart';
|
||||
import '../../data/content_providers.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_card.dart';
|
||||
import '../../widgets/badges.dart';
|
||||
import '../../widgets/page_header.dart';
|
||||
import '../../widgets/states.dart';
|
||||
|
||||
class ListenPage extends HookConsumerWidget {
|
||||
@@ -31,57 +36,24 @@ class ListenPage extends HookConsumerWidget {
|
||||
icon: Icons.headphones_outlined,
|
||||
);
|
||||
}
|
||||
final current = items.first;
|
||||
return ListView(
|
||||
padding: const EdgeInsets.all(WiseSpacing.x4),
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
WiseSpacing.x4,
|
||||
4,
|
||||
WiseSpacing.x4,
|
||||
16,
|
||||
),
|
||||
children: [
|
||||
Text('全站音频解读', style: Theme.of(context).textTheme.titleLarge),
|
||||
const SizedBox(height: WiseSpacing.x2),
|
||||
Text(
|
||||
'游客可完整收听;真实音频流待后端接入。',
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
const PageHeader(title: '听单', subtitle: '已转音频的研报解读'),
|
||||
const SectionTitle(title: '继续收听'),
|
||||
_ContinueListeningCard(
|
||||
item: current,
|
||||
onPlay: () => onPlay(current),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x4),
|
||||
for (final item in items) ...[
|
||||
AppCard(
|
||||
onTap: () => onPlay(item),
|
||||
child: Row(
|
||||
children: [
|
||||
IconButton.filled(
|
||||
onPressed: () => onPlay(item),
|
||||
icon: const Icon(Icons.play_arrow),
|
||||
style: IconButton.styleFrom(
|
||||
backgroundColor: WiseColors.primary,
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: WiseSpacing.x3),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
item.reportTitleCn,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
Text(
|
||||
'${item.institution.nameCn} · ${formatDuration(item.durationSec)}',
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x2),
|
||||
LinearProgressIndicator(
|
||||
value: 0,
|
||||
minHeight: 4,
|
||||
color: WiseColors.accent,
|
||||
backgroundColor: WiseColors.border,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SectionTitle(title: '全部音频', icon: AppIcons.arrowRight),
|
||||
for (final item in items.skip(1)) ...[
|
||||
_AudioListCard(item: item, onPlay: () => onPlay(item)),
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
],
|
||||
],
|
||||
@@ -90,3 +62,159 @@ class ListenPage extends HookConsumerWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _ContinueListeningCard extends StatelessWidget {
|
||||
const _ContinueListeningCard({required this.item, required this.onPlay});
|
||||
|
||||
final AudioItem item;
|
||||
final VoidCallback onPlay;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppCard(
|
||||
onTap: onPlay,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Wrap(
|
||||
spacing: 8,
|
||||
runSpacing: 8,
|
||||
children: [
|
||||
AppBadge(text: '研报解读', kind: BadgeKind.brand),
|
||||
AppBadge(text: '音频', kind: BadgeKind.audio),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
Text(
|
||||
item.reportTitleCn,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: YantingText.cardTitle,
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
Wrap(
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
spacing: 8,
|
||||
children: [
|
||||
Text(
|
||||
item.institution.nameCn,
|
||||
style: YantingText.meta.copyWith(
|
||||
color: YantingColors.foreground,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Text('·', style: YantingText.meta),
|
||||
Text(
|
||||
'全长 ${formatDuration(item.durationSec)}',
|
||||
style: YantingText.meta,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Row(
|
||||
children: [
|
||||
IconButton.filled(
|
||||
onPressed: onPlay,
|
||||
icon: const Icon(AppIcons.play),
|
||||
style: IconButton.styleFrom(
|
||||
backgroundColor: YantingColors.primary,
|
||||
foregroundColor: YantingColors.primaryForeground,
|
||||
fixedSize: const Size(48, 48),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 13),
|
||||
Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
LinearProgressIndicator(
|
||||
value: 0.42,
|
||||
minHeight: 5,
|
||||
borderRadius: BorderRadius.circular(YantingRadius.pill),
|
||||
backgroundColor: YantingColors.border,
|
||||
color: YantingColors.primary,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'06:01',
|
||||
style: YantingText.meta.copyWith(fontSize: 12),
|
||||
),
|
||||
Text(
|
||||
'-08:19',
|
||||
style: YantingText.meta.copyWith(fontSize: 12),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _AudioListCard extends StatelessWidget {
|
||||
const _AudioListCard({required this.item, required this.onPlay});
|
||||
|
||||
final AudioItem item;
|
||||
final VoidCallback onPlay;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppCard(
|
||||
padding: const EdgeInsets.all(14),
|
||||
onTap: onPlay,
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 56,
|
||||
height: 56,
|
||||
decoration: BoxDecoration(
|
||||
color: YantingColors.secondary,
|
||||
borderRadius: BorderRadius.circular(YantingRadius.xl),
|
||||
),
|
||||
child: const Icon(
|
||||
AppIcons.music,
|
||||
color: YantingColors.mutedForeground,
|
||||
size: 24,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 14),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
item.reportTitleCn,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: YantingText.listTitle,
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Text(
|
||||
'${item.institution.nameCn} · ${formatDuration(item.durationSec)}',
|
||||
style: YantingText.meta,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
IconButton.filled(
|
||||
onPressed: onPlay,
|
||||
icon: const Icon(AppIcons.play),
|
||||
style: IconButton.styleFrom(
|
||||
backgroundColor: YantingColors.primary,
|
||||
foregroundColor: YantingColors.primaryForeground,
|
||||
fixedSize: const Size(44, 44),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../data/api/report_data_source.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/page_header.dart';
|
||||
import '../../widgets/sheets.dart';
|
||||
import '../../widgets/states.dart';
|
||||
|
||||
@@ -15,63 +19,176 @@ class ProfilePage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView(
|
||||
padding: const EdgeInsets.all(WiseSpacing.x4),
|
||||
padding: const EdgeInsets.fromLTRB(WiseSpacing.x4, 4, WiseSpacing.x4, 16),
|
||||
children: [
|
||||
const PageHeader(title: '我的'),
|
||||
AppCard(
|
||||
color: WiseColors.secondary200,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
color: YantingColors.secondary,
|
||||
child: Row(
|
||||
children: [
|
||||
Text('游客', style: Theme.of(context).textTheme.headlineSmall),
|
||||
const SizedBox(height: WiseSpacing.x2),
|
||||
Text('浏览、阅读和完整收听不需要登录。收藏、历史同步和保存听单等待 auth 接口接入。', style: Theme.of(context).textTheme.bodyMedium),
|
||||
const SizedBox(height: WiseSpacing.x4),
|
||||
AppButton(
|
||||
label: '登录后保存个人状态',
|
||||
icon: Icons.login,
|
||||
onPressed: () => showLoginSheet(context),
|
||||
CircleAvatar(
|
||||
radius: 27,
|
||||
backgroundColor: YantingColors.background,
|
||||
foregroundColor: YantingColors.mutedForeground,
|
||||
child: const Icon(AppIcons.user, size: 28),
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'未登录',
|
||||
style: YantingText.cardTitle.copyWith(fontSize: 18),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
'登录后同步收藏、历史和听单',
|
||||
style: YantingText.meta.copyWith(height: 1.5),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x4),
|
||||
_ProfileRow(icon: Icons.favorite_border, title: '收藏研报', subtitle: '登录后同步收藏', onTap: () => showLoginSheet(context, reason: '登录后保存到你的收藏')),
|
||||
_ProfileRow(icon: Icons.history, title: '浏览历史', subtitle: '本地历史占位,服务端同步待接入', onTap: () => showAppToast(context, '历史同步接口待接入')),
|
||||
_ProfileRow(icon: Icons.playlist_add_check, title: '保存听单', subtitle: '登录后保存到你的听单', onTap: () => showLoginSheet(context, reason: '登录后保存到你的听单')),
|
||||
_ProfileRow(icon: Icons.open_in_new, title: '了解研值相关服务', subtitle: '外跳前提示风险边界', onTap: () => showOutboundSheet(context, title: '研值相关服务')),
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
AppButton(
|
||||
label: '登录 / 注册',
|
||||
expand: true,
|
||||
onPressed: () => showLoginSheet(context),
|
||||
),
|
||||
const SizedBox(height: 18),
|
||||
_MenuGroup(
|
||||
children: [
|
||||
_MenuRow(
|
||||
icon: AppIcons.history,
|
||||
title: '本地浏览记录',
|
||||
trailing: '0 条 · 本地临时',
|
||||
onTap: () => showAppToast(context, '历史同步接口待接入'),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
_MenuGroup(
|
||||
children: [
|
||||
_MenuRow(
|
||||
icon: AppIcons.settings,
|
||||
title: '设置',
|
||||
onTap: () => showAppToast(context, '设置待接入'),
|
||||
),
|
||||
_MenuRow(
|
||||
icon: AppIcons.fileList,
|
||||
title: '用户协议',
|
||||
onTap: () => showOutboundSheet(context, title: '用户协议'),
|
||||
),
|
||||
_MenuRow(
|
||||
icon: AppIcons.shield,
|
||||
title: '隐私政策',
|
||||
onTap: () => showOutboundSheet(context, title: '隐私政策'),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
AppCard(
|
||||
color: YantingColors.secondary,
|
||||
onTap: () => showOutboundSheet(context, title: '相关服务'),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'了解相关服务',
|
||||
style: YantingText.body.copyWith(
|
||||
color: YantingColors.foreground,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 3),
|
||||
const Icon(AppIcons.arrowRight, size: 18),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Text(
|
||||
'与你关注主题相关的延伸服务,内容不构成投资建议。',
|
||||
style: YantingText.meta.copyWith(height: 1.5),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 22),
|
||||
Text(
|
||||
'研听 · 全球机构研报中文解读\n登录不阻断游客完整收听第一期 · 内容不构成投资建议',
|
||||
textAlign: TextAlign.center,
|
||||
style: YantingText.meta.copyWith(fontSize: 12, height: 1.7),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _ProfileRow extends StatelessWidget {
|
||||
const _ProfileRow({required this.icon, required this.title, required this.subtitle, required this.onTap});
|
||||
class _MenuGroup extends StatelessWidget {
|
||||
const _MenuGroup({required this.children});
|
||||
|
||||
final List<Widget> children;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppCard(
|
||||
padding: EdgeInsets.zero,
|
||||
child: Column(children: children),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _MenuRow extends StatelessWidget {
|
||||
const _MenuRow({
|
||||
required this.icon,
|
||||
required this.title,
|
||||
required this.onTap,
|
||||
this.trailing,
|
||||
});
|
||||
|
||||
final IconData icon;
|
||||
final String title;
|
||||
final String subtitle;
|
||||
final String? trailing;
|
||||
final VoidCallback onTap;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: WiseSpacing.x3),
|
||||
child: AppCard(
|
||||
onTap: onTap,
|
||||
return InkWell(
|
||||
onTap: onTap,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 15),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(icon, color: WiseColors.primary),
|
||||
const SizedBox(width: WiseSpacing.x3),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(title, style: Theme.of(context).textTheme.titleMedium),
|
||||
Text(subtitle, style: Theme.of(context).textTheme.bodySmall),
|
||||
],
|
||||
Icon(icon, size: 20, color: YantingColors.foreground),
|
||||
const SizedBox(width: 13),
|
||||
Expanded(child: Text(title, style: YantingText.body)),
|
||||
if (trailing != null)
|
||||
DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: YantingColors.secondary,
|
||||
borderRadius: BorderRadius.circular(YantingRadius.pill),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 3,
|
||||
),
|
||||
child: Text(
|
||||
trailing!,
|
||||
style: YantingText.meta.copyWith(fontSize: 11.5),
|
||||
),
|
||||
),
|
||||
)
|
||||
else
|
||||
const Icon(
|
||||
AppIcons.arrowRight,
|
||||
color: YantingColors.mutedForeground,
|
||||
size: 20,
|
||||
),
|
||||
),
|
||||
const Icon(Icons.chevron_right, color: WiseColors.textTertiary),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -6,10 +6,14 @@ import '../../data/api/report_data_source.dart';
|
||||
import '../../data/content_providers.dart';
|
||||
import '../../data/models/models.dart';
|
||||
import '../../routing/app_routes.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/badges.dart';
|
||||
import '../../widgets/mini_player.dart';
|
||||
import '../../widgets/page_header.dart';
|
||||
import '../../widgets/states.dart';
|
||||
import '../shared/report_card_widget.dart';
|
||||
|
||||
@@ -28,7 +32,12 @@ class ReportsPage extends HookConsumerWidget {
|
||||
final ReportDataSource dataSource;
|
||||
final void Function(AudioItem item) onPlay;
|
||||
final PlayerStateModel player;
|
||||
final void Function(String audioId, String reportId, String title, int durationSec)?
|
||||
final void Function(
|
||||
String audioId,
|
||||
String reportId,
|
||||
String title,
|
||||
int durationSec,
|
||||
)?
|
||||
onStartModuleAudio;
|
||||
final VoidCallback? onToggleAudio;
|
||||
final void Function(int delta)? onSeekAudio;
|
||||
@@ -59,23 +68,27 @@ class ReportsPage extends HookConsumerWidget {
|
||||
);
|
||||
|
||||
return ListView(
|
||||
padding: const EdgeInsets.all(WiseSpacing.x4),
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
WiseSpacing.x4,
|
||||
4,
|
||||
WiseSpacing.x4,
|
||||
16,
|
||||
),
|
||||
children: [
|
||||
const PageHeader(title: '研报', subtitle: '全部已发布研报解读'),
|
||||
TextField(
|
||||
decoration: InputDecoration(
|
||||
hintText: '搜索标题、机构或主题',
|
||||
prefixIcon: const Icon(Icons.search),
|
||||
prefixIcon: const Icon(AppIcons.search),
|
||||
suffixIcon: currentQuery.isEmpty
|
||||
? null
|
||||
: IconButton(
|
||||
onPressed: () => query.value = '',
|
||||
icon: const Icon(Icons.close),
|
||||
),
|
||||
filled: true,
|
||||
fillColor: WiseColors.surface,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(WiseRadius.pill),
|
||||
borderSide: BorderSide.none,
|
||||
borderRadius: BorderRadius.circular(YantingRadius.md),
|
||||
borderSide: const BorderSide(color: YantingColors.input),
|
||||
),
|
||||
),
|
||||
onChanged: (value) => query.value = value.trim(),
|
||||
@@ -85,30 +98,34 @@ class ReportsPage extends HookConsumerWidget {
|
||||
children: [
|
||||
AppButton(
|
||||
label: '筛选',
|
||||
icon: Icons.tune,
|
||||
icon: AppIcons.filter,
|
||||
kind: AppButtonKind.ghost,
|
||||
onPressed: items.isEmpty
|
||||
? null
|
||||
: () => _openFilterSheet(
|
||||
context,
|
||||
items: items,
|
||||
topic: topic,
|
||||
),
|
||||
context,
|
||||
items: items,
|
||||
topic: topic,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: WiseSpacing.x2),
|
||||
AppButton(
|
||||
label: '最新',
|
||||
icon: AppIcons.sort,
|
||||
kind: AppButtonKind.ghost,
|
||||
onPressed: () {},
|
||||
),
|
||||
const SizedBox(width: WiseSpacing.x2),
|
||||
AppChip(
|
||||
label: '有音频',
|
||||
label: '音频',
|
||||
selected: currentHasAudio,
|
||||
onTap: () => hasAudio.value = !currentHasAudio,
|
||||
),
|
||||
const Spacer(),
|
||||
Text('共 ${filtered.length} 篇', style: YantingText.meta),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
Text(
|
||||
'共 ${filtered.length} 篇研报解读${currentQuery.isNotEmpty || currentTopic.isNotEmpty || currentHasAudio ? '(已筛选)' : ''}',
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
if (filtered.isEmpty)
|
||||
EmptyState(
|
||||
title: currentQuery.isNotEmpty ? '未找到相关研报' : '当前筛选下暂无研报',
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
|
||||
import '../routing/app_routes.dart';
|
||||
import '../data/providers.dart';
|
||||
import '../theme/app_icons.dart';
|
||||
import '../theme/wise_tokens.dart';
|
||||
import '../widgets/bottom_tab_bar.dart';
|
||||
import '../widgets/mini_player.dart';
|
||||
|
||||
class ShellPage extends ConsumerWidget {
|
||||
@@ -39,7 +39,7 @@ class ShellPage extends ConsumerWidget {
|
||||
),
|
||||
),
|
||||
body: ColoredBox(
|
||||
color: WiseColors.canvas,
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
child: Stack(children: [Positioned.fill(child: child)]),
|
||||
),
|
||||
bottomNavigationBar: SafeArea(
|
||||
@@ -48,54 +48,10 @@ class ShellPage extends ConsumerWidget {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
MiniPlayer(player: player, onToggle: controller.toggleAudio),
|
||||
Container(
|
||||
height: 64,
|
||||
padding: const EdgeInsets.fromLTRB(12, 8, 12, 8),
|
||||
decoration: const BoxDecoration(
|
||||
color: WiseColors.canvas,
|
||||
border: Border(
|
||||
top: BorderSide(color: Color(0x11000000), width: 0.5),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
children: List.generate(_tabs.length, (index) {
|
||||
final tab = _tabs[index];
|
||||
final active = index == safeIndex;
|
||||
return Expanded(
|
||||
child: InkWell(
|
||||
onTap: () => context.go(tab.path),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
tab.icon,
|
||||
size: 20,
|
||||
color: active
|
||||
? WiseColors.ink
|
||||
: WiseColors.textTertiary,
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
tab.label,
|
||||
style:
|
||||
(Theme.of(context).textTheme.labelLarge ??
|
||||
const TextStyle())
|
||||
.copyWith(
|
||||
color: active
|
||||
? WiseColors.ink
|
||||
: WiseColors.textTertiary,
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 12,
|
||||
letterSpacing: 0.72,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
BottomTabBar(
|
||||
items: yantingBottomTabItems,
|
||||
selectedIndex: safeIndex,
|
||||
onSelected: (index) => context.go(_tabs[index].path),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -105,17 +61,15 @@ class ShellPage extends ConsumerWidget {
|
||||
}
|
||||
|
||||
class _TabItem {
|
||||
const _TabItem({required this.label, required this.path, required this.icon});
|
||||
const _TabItem({required this.path});
|
||||
|
||||
final String label;
|
||||
final String path;
|
||||
final IconData icon;
|
||||
}
|
||||
|
||||
const List<_TabItem> _tabs = [
|
||||
_TabItem(label: '推荐', path: AppRoutes.home, icon: AppIcons.sparkle),
|
||||
_TabItem(label: '研报', path: AppRoutes.reports, icon: AppIcons.article),
|
||||
_TabItem(label: '机构', path: AppRoutes.institutions, icon: AppIcons.bank),
|
||||
_TabItem(label: '听单', path: AppRoutes.listen, icon: AppIcons.headphones),
|
||||
_TabItem(label: '我的', path: AppRoutes.profile, icon: AppIcons.user),
|
||||
_TabItem(path: AppRoutes.home),
|
||||
_TabItem(path: AppRoutes.reports),
|
||||
_TabItem(path: AppRoutes.institutions),
|
||||
_TabItem(path: AppRoutes.listen),
|
||||
_TabItem(path: AppRoutes.profile),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user