fix:UI对齐demo

This commit is contained in:
jingyun
2026-06-18 18:08:29 +08:00
parent f42ad566e0
commit 2d7523f901
14 changed files with 1613 additions and 355 deletions
+28 -13
View File
@@ -27,11 +27,15 @@ class NewsPage extends ConsumerWidget {
children: [
const Text(
'资讯',
style: TextStyle(fontSize: 17, fontWeight: FontWeight.w600),
style: TextStyle(
fontSize: 17,
fontWeight: FontWeight.w600,
),
),
const Spacer(),
IconButton(
onPressed: () => ref.read(newsControllerProvider.notifier).refresh(),
onPressed: () =>
ref.read(newsControllerProvider.notifier).refresh(),
icon: const Icon(Icons.refresh, size: 19),
color: const Color(0xFF9A968D),
padding: EdgeInsets.zero,
@@ -42,26 +46,27 @@ class NewsPage extends ConsumerWidget {
),
],
),
const SizedBox(height: 2),
Text(
'信息整理 · 非投资建议',
style: TextStyle(fontSize: 13, color: cs.mutedForeground),
),
const SizedBox(height: 10),
for (final item in news.items) ...[
PrototypeCard(
margin: const EdgeInsets.only(bottom: 10),
child: InkWell(
onTap: () => context.push('${AppRoutes.newsDetail}?id=${item.id}'),
onTap: () =>
context.push('${AppRoutes.newsDetail}?id=${item.id}'),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
padding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 3,
),
decoration: BoxDecoration(
color: item.metal.color.withValues(alpha: 0.12),
color: item.metal.color.withValues(
alpha: 0.12,
),
borderRadius: BorderRadius.circular(999),
),
child: Text(
@@ -76,16 +81,26 @@ class NewsPage extends ConsumerWidget {
const SizedBox(width: 8),
Text(
'${item.source} · ${_timeLabel(item.publishedAt)}',
style: TextStyle(fontSize: 12, color: cs.mutedForeground),
style: TextStyle(
fontSize: 12,
color: cs.mutedForeground,
),
),
const Spacer(),
Icon(Icons.chevron_right, size: 16, color: cs.mutedForeground),
Icon(
Icons.chevron_right,
size: 16,
color: cs.mutedForeground,
),
],
),
const SizedBox(height: 10),
Text(
item.title,
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w700),
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w700,
),
),
const SizedBox(height: 8),
Text(