fix:对比原型增加功能交互
This commit is contained in:
@@ -5,6 +5,8 @@ import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
|
||||
import '../../data/api/report_data_source.dart';
|
||||
import '../../data/models/models.dart';
|
||||
import '../../data/providers.dart';
|
||||
import '../../data/state/app_interaction_state.dart';
|
||||
import '../../routing/app_routes.dart';
|
||||
import '../../theme/app_icons.dart';
|
||||
import '../../theme/yanting_text.dart';
|
||||
@@ -67,7 +69,7 @@ class InstitutionDetailPage extends HookConsumerWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _InstitutionDetailContent extends StatelessWidget {
|
||||
class _InstitutionDetailContent extends ConsumerWidget {
|
||||
const _InstitutionDetailContent({
|
||||
required this.item,
|
||||
required this.dataSource,
|
||||
@@ -77,7 +79,7 @@ class _InstitutionDetailContent extends StatelessWidget {
|
||||
final ReportDataSource dataSource;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return ListView(
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
YantingSpacing.x4,
|
||||
@@ -165,7 +167,12 @@ class _InstitutionDetailContent extends StatelessWidget {
|
||||
for (final report in item.recentReports) ...[
|
||||
ReportCardWidget(
|
||||
report: report,
|
||||
onTap: () => openReportDetail(context, dataSource, report),
|
||||
onTap: () {
|
||||
ref
|
||||
.read(profileControllerProvider.notifier)
|
||||
.addHistory(report.id);
|
||||
openReportDetail(context, dataSource, report);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: YantingSpacing.x3),
|
||||
],
|
||||
@@ -174,7 +181,19 @@ class _InstitutionDetailContent extends StatelessWidget {
|
||||
icon: AppIcons.externalLink,
|
||||
kind: AppButtonKind.ghost,
|
||||
expand: true,
|
||||
onPressed: () => showOutboundSheet(context, title: item.nameCn),
|
||||
onPressed: () => showOutboundSheet(
|
||||
context,
|
||||
title: item.nameCn,
|
||||
onConfirm: () => ref
|
||||
.read(outboundRepositoryProvider)
|
||||
.recordOutbound(
|
||||
OutboundEvent(
|
||||
scene: 'institution_service',
|
||||
refId: item.id,
|
||||
targetUrl: item.websiteUrl.isEmpty ? null : item.websiteUrl,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user