fix:按照shadcn_ui对着demo_shadcn对齐
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
|
||||
import '../../data/api/report_data_source.dart';
|
||||
import '../../data/models/models.dart';
|
||||
@@ -8,7 +9,6 @@ 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';
|
||||
@@ -35,9 +35,23 @@ class InstitutionDetailPage extends HookConsumerWidget {
|
||||
[dataSource, institutionId, retryCount.value],
|
||||
);
|
||||
final snapshot = useFuture(future);
|
||||
final theme = ShadTheme.of(context);
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text('机构主页')),
|
||||
backgroundColor: theme.colorScheme.background,
|
||||
appBar: AppBar(
|
||||
backgroundColor: theme.colorScheme.background,
|
||||
surfaceTintColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
title: const Text('机构主页'),
|
||||
bottom: PreferredSize(
|
||||
preferredSize: const Size.fromHeight(1),
|
||||
child: ColoredBox(
|
||||
color: theme.colorScheme.border,
|
||||
child: const SizedBox(height: 1, width: double.infinity),
|
||||
),
|
||||
),
|
||||
),
|
||||
body: snapshot.connectionState != ConnectionState.done
|
||||
? const LoadingState()
|
||||
: snapshot.hasError
|
||||
@@ -65,7 +79,12 @@ class _InstitutionDetailContent extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView(
|
||||
padding: const EdgeInsets.fromLTRB(WiseSpacing.x4, 4, WiseSpacing.x4, 16),
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
YantingSpacing.x4,
|
||||
4,
|
||||
YantingSpacing.x4,
|
||||
16,
|
||||
),
|
||||
children: [
|
||||
AppCard(
|
||||
color: YantingColors.brandSoft,
|
||||
@@ -116,26 +135,26 @@ class _InstitutionDetailContent extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
const SizedBox(height: YantingSpacing.x3),
|
||||
if (item.introCn.isNotEmpty)
|
||||
AppCard(child: Text(item.introCn, style: YantingText.body)),
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
const SizedBox(height: YantingSpacing.x3),
|
||||
if (item.credibilityNote.isNotEmpty)
|
||||
AppCard(
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Icon(AppIcons.shield, color: YantingColors.chart2),
|
||||
const SizedBox(width: WiseSpacing.x2),
|
||||
const SizedBox(width: YantingSpacing.x2),
|
||||
Expanded(
|
||||
child: Text(item.credibilityNote, style: YantingText.body),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x5),
|
||||
const SizedBox(height: YantingSpacing.x6),
|
||||
Text('最新研报', style: YantingText.sectionTitle.copyWith(fontSize: 21)),
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
const SizedBox(height: YantingSpacing.x3),
|
||||
if (item.recentReports.isEmpty)
|
||||
const EmptyState(
|
||||
title: '机构暂无研报',
|
||||
@@ -148,7 +167,7 @@ class _InstitutionDetailContent extends StatelessWidget {
|
||||
report: report,
|
||||
onTap: () => openReportDetail(context, dataSource, report),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
const SizedBox(height: YantingSpacing.x3),
|
||||
],
|
||||
AppButton(
|
||||
label: '了解相关服务',
|
||||
|
||||
Reference in New Issue
Block a user