refactor: 优化字号主题体系,参考成熟交易平台标准

- 重构主题字号体系 (h1-h4, body, amount等)
- 修复16个页面文件中的硬编码字号
- 新字号层级参考币安/OKX标准
- Display: 22/20/18px (总资产、价格)
- Headline: 15/14/13px (标题、副标题)
- Body: 13/12/11px (正文、辅助文字)
- Label: 11/10/9px (标签)
- Number: 22/16/13px (数字)
This commit is contained in:
2026-04-01 12:49:17 +08:00
parent 3f4d2d8b9a
commit ed25bb2da4
14 changed files with 126 additions and 118 deletions

View File

@@ -104,7 +104,7 @@ class AssetCard extends StatelessWidget {
style: theme.textTheme.h1.copyWith(
fontWeight: FontWeight.bold,
color: primaryTextColor,
fontSize: 32,
fontSize: 20,
),
),
// 盈亏信息

View File

@@ -51,7 +51,7 @@ class CoinCard extends StatelessWidget {
child: Text(
icon ?? code.substring(0, 1),
style: TextStyle(
fontSize: 20,
fontSize: 16,
color: theme.colorScheme.primary,
fontWeight: FontWeight.bold,
),

View File

@@ -121,7 +121,7 @@ class _AssetCard extends StatelessWidget {
Text(
'\$${overview?.totalAsset ?? '0.00'}',
style: GoogleFonts.spaceGrotesk(
fontSize: 36,
fontSize: 22,
fontWeight: FontWeight.bold,
color: Colors.white,
),
@@ -284,7 +284,7 @@ class _FundAccountCard extends StatelessWidget {
Text(
displayBalance,
style: GoogleFonts.spaceGrotesk(
fontSize: 28,
fontSize: 20,
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
),
@@ -413,7 +413,7 @@ class _TradeAccountCard extends StatelessWidget {
Text(
totalValue.toStringAsFixed(2),
style: GoogleFonts.spaceGrotesk(
fontSize: 28,
fontSize: 20,
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
),
@@ -592,7 +592,7 @@ void _showDepositDialog(BuildContext context) {
Text(
'Deposit (充值)',
style: GoogleFonts.spaceGrotesk(
fontSize: 24,
fontSize: 16,
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
),
@@ -708,7 +708,7 @@ void _showDepositResultDialog(BuildContext context, Map<String, dynamic> data) {
Text(
'充值申请成功',
style: GoogleFonts.spaceGrotesk(
fontSize: 20,
fontSize: 16,
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
),
@@ -938,7 +938,7 @@ void _showWithdrawDialog(BuildContext context, String? balance) {
Text(
'提现 (Withdraw)',
style: GoogleFonts.spaceGrotesk(
fontSize: 20,
fontSize: 16,
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
),
@@ -1117,7 +1117,7 @@ void _showResultDialog(BuildContext context, String title, String? message) {
children: [
Text(title,
style: GoogleFonts.spaceGrotesk(
fontSize: 20,
fontSize: 16,
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
)),
@@ -1174,7 +1174,7 @@ void _showKycRequiredDialog(BuildContext context) {
Text(
'需要实名认证',
style: GoogleFonts.spaceGrotesk(
fontSize: 20,
fontSize: 16,
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
),

View File

@@ -152,7 +152,7 @@ class _TransferPageState extends State<TransferPage> {
title: Text(
'资金划转',
style: GoogleFonts.spaceGrotesk(
fontSize: 18,
fontSize: 14,
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
),
@@ -411,14 +411,14 @@ class _TransferPageState extends State<TransferPage> {
FilteringTextInputFormatter.allow(RegExp(r'^\d*\.?\d{0,8}')),
],
style: GoogleFonts.spaceGrotesk(
fontSize: 32,
fontSize: 18,
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
),
decoration: InputDecoration(
hintText: '0.00',
hintStyle: GoogleFonts.spaceGrotesk(
fontSize: 32,
fontSize: 18,
fontWeight: FontWeight.bold,
color: colorScheme.onSurfaceVariant.withOpacity(0.3),
),

View File

@@ -54,7 +54,7 @@ class _RegisterPageState extends State<RegisterPage> {
child: Text(
'\u20BF',
style: TextStyle(
fontSize: 48,
fontSize: 18,
color: AppColorScheme.darkPrimary,
),
),
@@ -64,7 +64,7 @@ class _RegisterPageState extends State<RegisterPage> {
child: Text(
'注册账号',
style: TextStyle(
fontSize: 24,
fontSize: 18,
fontWeight: FontWeight.bold,
color: AppColorScheme.darkOnSurface,
),

View File

@@ -132,7 +132,7 @@ class _HomePageState extends State<HomePage>
Text(
'充值',
style: GoogleFonts.spaceGrotesk(
fontSize: 24,
fontSize: 16,
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
),
@@ -251,7 +251,7 @@ class _HomePageState extends State<HomePage>
Text(
'充值申请成功',
style: GoogleFonts.spaceGrotesk(
fontSize: 20,
fontSize: 16,
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
),
@@ -350,7 +350,7 @@ class _HomePageState extends State<HomePage>
children: [
Text(title,
style: GoogleFonts.spaceGrotesk(
fontSize: 20,
fontSize: 16,
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
)),
@@ -469,7 +469,7 @@ class _GreetingSection extends StatelessWidget {
style: TextStyle(
color: colorScheme.onSurface,
fontWeight: FontWeight.bold,
fontSize: 24,
fontSize: 18,
),
),
],
@@ -644,7 +644,7 @@ class _AssetCardState extends State<_AssetCard> {
Text(
displayAsset,
style: GoogleFonts.spaceGrotesk(
fontSize: 32,
fontSize: 22,
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
),
@@ -1103,7 +1103,7 @@ class _HoldingsSection extends StatelessWidget {
style: TextStyle(
color: colorScheme.onSurface,
fontWeight: FontWeight.bold,
fontSize: 18,
fontSize: 16,
),
),
TextButton(
@@ -1116,7 +1116,7 @@ class _HoldingsSection extends StatelessWidget {
children: [
Text('资产详情',
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 14)),
fontWeight: FontWeight.bold, fontSize: 13)),
const SizedBox(width: 4),
Icon(LucideIcons.chevronRight,
size: 16, color: colorScheme.primary),
@@ -1157,7 +1157,7 @@ class _EmptyHoldings extends StatelessWidget {
style: TextStyle(
color: colorScheme.onSurface,
fontWeight: FontWeight.w600,
fontSize: 16,
fontSize: 14,
),
),
SizedBox(height: AppSpacing.sm),
@@ -1165,7 +1165,7 @@ class _EmptyHoldings extends StatelessWidget {
'快去交易吧~',
style: TextStyle(
color: colorScheme.onSurfaceVariant,
fontSize: 14,
fontSize: 13,
),
),
],
@@ -1245,7 +1245,7 @@ class _HoldingItem extends StatelessWidget {
style: TextStyle(
color: colorScheme.onSurface,
fontWeight: FontWeight.bold,
fontSize: 16,
fontSize: 14,
)),
Text(holding.quantity,
style: TextStyle(
@@ -1263,7 +1263,7 @@ class _HoldingItem extends StatelessWidget {
style: TextStyle(
color: colorScheme.onSurface,
fontWeight: FontWeight.w500,
fontSize: 14,
fontSize: 13,
)),
Text(holding.formattedProfitRate,
style: TextStyle(
@@ -1439,7 +1439,7 @@ class _ProfitStatCard extends StatelessWidget {
? '${isProfit ? '+' : ''}${value!.toStringAsFixed(2)}'
: '--',
style: GoogleFonts.spaceGrotesk(
fontSize: 15,
fontSize: 14,
fontWeight: FontWeight.bold,
color: color,
),

View File

@@ -189,7 +189,7 @@ class _FeaturedCard extends StatelessWidget {
child: Text(
coin.displayIcon,
style: TextStyle(
fontSize: 22,
fontSize: 18,
fontWeight: FontWeight.bold,
color: colorScheme.primary,
),
@@ -214,7 +214,7 @@ class _FeaturedCard extends StatelessWidget {
Text(
'\$${coin.formattedPrice}',
style: GoogleFonts.spaceGrotesk(
fontSize: 24,
fontSize: 18,
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
),

View File

@@ -112,7 +112,7 @@ class _KycPageState extends State<KycPage> {
Text(
'身份验证',
style: GoogleFonts.spaceGrotesk(
fontSize: 20,
fontSize: 16,
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
),

View File

@@ -109,7 +109,7 @@ class _MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin
builder: (context) => ShadDialog(
title: Row(
children: [
_AppLogo(radius: 20, fontSize: 20),
_AppLogo(radius: 20, fontSize: 16),
SizedBox(width: AppSpacing.sm + AppSpacing.xs),
const Text('模拟所'),
],
@@ -196,7 +196,7 @@ class _UserCard extends StatelessWidget {
),
],
),
child: _AppLogo(radius: 36, fontSize: 28, text: user?.avatarText),
child: _AppLogo(radius: 36, fontSize: 20, text: user?.avatarText),
),
// 验证徽章
Positioned(
@@ -229,7 +229,7 @@ class _UserCard extends StatelessWidget {
Text(
user?.username ?? '未登录',
style: GoogleFonts.spaceGrotesk(
fontSize: 24,
fontSize: 16,
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
),

View File

@@ -242,7 +242,7 @@ class _OnboardingPageState extends State<OnboardingPage> {
Text(
item.title,
style: TextStyle(
fontSize: 28,
fontSize: 18,
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
letterSpacing: -0.5,
@@ -254,7 +254,7 @@ class _OnboardingPageState extends State<OnboardingPage> {
item.description,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16,
fontSize: 14,
color: colorScheme.onSurfaceVariant,
height: 1.6,
),

View File

@@ -200,7 +200,7 @@ class _FundOrdersPageState extends State<FundOrdersPage> {
Text(
'${isDeposit ? '+' : '-'}${order.amount} USDT',
style: TextStyle(
fontSize: 20,
fontSize: 16,
fontWeight: FontWeight.bold,
color: isDeposit ? upColor : downColor,
),

View File

@@ -331,7 +331,7 @@ class _ConfirmDialog extends StatelessWidget {
child: Text(
'确认${isBuy ? '买入' : '卖出'}',
style: GoogleFonts.spaceGrotesk(
fontSize: 20,
fontSize: 16,
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
),
@@ -486,7 +486,7 @@ class _CoinSelector extends StatelessWidget {
children: [
Text('选择币种',
style: GoogleFonts.spaceGrotesk(
fontSize: 20,
fontSize: 16,
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
)),
@@ -679,7 +679,7 @@ class _PriceCard extends StatelessWidget {
Text(
'\$${coin.formattedPrice}',
style: GoogleFonts.spaceGrotesk(
fontSize: 30,
fontSize: 20,
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
),
@@ -1138,7 +1138,7 @@ class _AmountInputState extends State<_AmountInput> {
keyboardType: const TextInputType.numberWithOptions(decimal: true),
onChanged: (_) => _checkLimit(),
style: GoogleFonts.spaceGrotesk(
fontSize: 22,
fontSize: 18,
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
),