feat: 首页和资产页面使用 CoinIcon 显示币种图标
✨ 修改内容: - 首页 (home_page.dart): 持仓列表使用 CoinIcon 替换 CircleAvatar - 资产持仓 (holdings_section.dart): 使用 CoinIcon 替换文字显示 🎨 效果: - 首页:持仓卡片显示真实的币种图标 - 资产页面:持仓列表显示真实的币种图标 - 未找到图标时自动显示币种代码(兜底方案) - ✅ Flutter Web 构建成功 (23.7s)
This commit is contained in:
@@ -4,6 +4,7 @@ import '../../../../core/theme/app_theme_extension.dart';
|
||||
import '../../../../core/theme/app_spacing.dart';
|
||||
import '../../../../data/models/account_models.dart';
|
||||
import '../../../components/glass_panel.dart';
|
||||
import '../../../components/coin_icon.dart';
|
||||
|
||||
/// 持倉區域
|
||||
/// Header: "我的資產" + "查看全部 >"
|
||||
@@ -128,17 +129,10 @@ class HoldingRow extends StatelessWidget {
|
||||
Container(
|
||||
width: 36,
|
||||
height: 36,
|
||||
decoration: BoxDecoration(
|
||||
color: accentBgColor,
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
coinCode.substring(0, 1),
|
||||
style: AppTextStyles.headlineMedium(context).copyWith(
|
||||
fontWeight: FontWeight.w700,
|
||||
color: accentColor,
|
||||
),
|
||||
child: CoinIcon(
|
||||
symbol: coinCode,
|
||||
size: 36,
|
||||
isCircle: false,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
|
||||
@@ -14,6 +14,7 @@ import '../../components/glass_panel.dart';
|
||||
import '../mine/welfare_center_page.dart';
|
||||
import '../asset/transfer_page.dart';
|
||||
import '../asset/components/asset_dialogs.dart';
|
||||
import '../../components/coin_icon.dart';
|
||||
import 'header_bar.dart';
|
||||
import 'quick_actions_row.dart';
|
||||
import 'hot_coins_section.dart';
|
||||
@@ -569,16 +570,10 @@ class _HoldingItem extends StatelessWidget {
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 18,
|
||||
backgroundColor: context.colors.primary.withValues(alpha: 0.1),
|
||||
child: Text(
|
||||
holding.coinCode.substring(0, 1),
|
||||
style: AppTextStyles.headlineMedium(context).copyWith(
|
||||
color: context.colors.primary,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
CoinIcon(
|
||||
symbol: holding.coinCode,
|
||||
size: 36,
|
||||
isCircle: false,
|
||||
),
|
||||
SizedBox(width: AppSpacing.sm + AppSpacing.xs),
|
||||
Column(
|
||||
|
||||
Reference in New Issue
Block a user