Files
monisuo/flutter_monisuo/lib/ui/pages/trade/components/price_card.dart
sion 951d597057 fix(ui): 对齐所有页面样式到 Pencil 设计规范
transfer_page.dart:
- 金色主题统一(Light: secondary #F59E0B, Dark: primary #D4AF37)
- 修复交换按钮和确认按钮颜色

home_page.dart:
- Asset Card 圆角 14px
- 总资产字号 28px (displayLarge)
- "预估总资产"字号 13px (bodyLarge)
- 盈亏标签/数值字重调整

quick_actions_row.dart:
- padding 统一为 16px

welfare_center_page.dart:
- _statusBadge padding [6, 14]

trade_form_card.dart / price_card.dart:
- 样式细节对齐
2026-04-06 03:57:00 +08:00

74 lines
2.4 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'package:flutter/material.dart';
import '../../../../core/theme/app_spacing.dart';
import '../../../../core/theme/app_theme.dart';
import '../../../../core/theme/app_theme_extension.dart';
import '../../../../data/models/coin.dart';
/// 价格卡片组件
///
/// 显示当前币种价格和 24h 涨跌幅。
/// 布局:大号价格(32px bold) + 涨跌幅徽章(圆角sm涨绿背景) + "24h 变化" 副标题。
class PriceCard extends StatelessWidget {
final Coin coin;
const PriceCard({super.key, required this.coin});
@override
Widget build(BuildContext context) {
final isUp = coin.isUp;
final changeColor =
isUp ? context.appColors.up : context.appColors.down;
final changeBgColor = isUp
? context.appColors.upBackground
: context.appColors.downBackground;
return Container(
width: double.infinity,
padding: const EdgeInsets.all(20), // 24px → 20px
decoration: BoxDecoration(
color: context.appColors.surfaceCard,
borderRadius: BorderRadius.circular(AppRadius.lg),
border: Border.all(
color: context.appColors.ghostBorder,
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// 价格行:大号价格 + 涨跌幅徽章
Row(
children: [
Text(
coin.formattedPrice,
style: AppTextStyles.numberLarge(context).copyWith(fontSize: 32),
),
const SizedBox(width: AppSpacing.sm),
// 涨跌幅徽章 - 圆角sm涨绿背景
Container(
padding: const EdgeInsets.symmetric(
horizontal: 8, vertical: 4), // 调整 padding
decoration: BoxDecoration(
color: changeBgColor,
borderRadius: BorderRadius.circular(AppRadius.sm),
),
child: Text(
coin.formattedChange,
style: AppTextStyles.numberSmall(context).copyWith(
color: changeColor,
fontWeight: FontWeight.w600,
),
),
),
],
),
const SizedBox(height: AppSpacing.sm),
// 副标题
Text(
'24h 变化',
style: AppTextStyles.bodySmall(context),
),
],
),
);
}
}