docs(theme): update documentation and clean up deprecated color scheme definitions

Removed outdated compatibility aliases and deprecated methods from AppColorScheme,
and updated CLAUDE.md to reflect new theme system requirements with centralized
color management and no hard-coded values in UI components.
This commit is contained in:
2026-04-05 23:37:27 +08:00
parent 189609f337
commit f5ac578892
39 changed files with 20289 additions and 1260 deletions

View File

@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import '../../../../core/theme/app_theme.dart';
import '../../../../core/theme/app_spacing.dart';
/// 账户标签切换器 — .pen node UE6xC
@@ -67,12 +67,12 @@ class AccountTabSwitcher extends StatelessWidget {
decoration: BoxDecoration(
color: isSelected
? colorScheme.surface
: Colors.transparent,
: const Color(0x00000000),
borderRadius: BorderRadius.circular(AppRadius.sm),
boxShadow: isSelected
? [
BoxShadow(
color: Colors.black.withValues(alpha: 0.05),
color: colorScheme.shadow.withValues(alpha: 0.05),
blurRadius: 3,
offset: const Offset(0, 1),
),
@@ -82,11 +82,12 @@ class AccountTabSwitcher extends StatelessWidget {
alignment: Alignment.center,
child: Text(
label,
style: GoogleFonts.inter(
fontSize: 14,
fontWeight: isSelected ? FontWeight.w600 : FontWeight.w500,
color: isSelected ? colorScheme.onSurface : colorScheme.onSurfaceVariant,
),
style: isSelected
? AppTextStyles.headlineMedium(context)
: AppTextStyles.headlineMedium(context).copyWith(
fontWeight: FontWeight.w500,
color: colorScheme.onSurfaceVariant,
),
),
),
),

View File

@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:lucide_icons_flutter/lucide_icons.dart';
import '../../../../core/theme/app_theme.dart';
/// 操作按钮行 — .pen node pIpHe
/// gap: 12, three buttons evenly distributed
@@ -35,7 +35,7 @@ class ActionButtonsRow extends StatelessWidget {
bgColor: bgColor,
onTap: onDeposit,
),
const SizedBox(width: 12),
const SizedBox(width: AppSpacing.sm + AppSpacing.xs),
ActionButton(
icon: LucideIcons.arrowDownLeft,
label: '提现',
@@ -43,7 +43,7 @@ class ActionButtonsRow extends StatelessWidget {
bgColor: bgColor,
onTap: onWithdraw,
),
const SizedBox(width: 12),
const SizedBox(width: AppSpacing.sm + AppSpacing.xs),
ActionButton(
icon: LucideIcons.repeat,
label: '划转',
@@ -96,12 +96,10 @@ class ActionButton extends StatelessWidget {
color: accentColor,
),
),
const SizedBox(height: 6),
const SizedBox(height: AppSpacing.xs + 2),
Text(
label,
style: GoogleFonts.inter(
fontSize: 12,
fontWeight: FontWeight.w500,
style: AppTextStyles.labelLarge(context).copyWith(
color: colorScheme.onSurfaceVariant,
),
),

View File

@@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:shadcn_ui/shadcn_ui.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:lucide_icons_flutter/lucide_icons.dart';
import 'package:provider/provider.dart';
import '../../../../core/theme/app_theme.dart';
import '../../../../core/theme/app_color_scheme.dart';
import '../../../../core/theme/app_spacing.dart';
import '../../../../core/utils/toast_utils.dart';
@@ -38,17 +38,14 @@ class InfoRow extends StatelessWidget {
children: [
Text(
label,
style: GoogleFonts.inter(
fontSize: 12,
style: AppTextStyles.bodyMedium(context).copyWith(
color: colorScheme.onSurfaceVariant,
),
),
Text(
value,
style: GoogleFonts.inter(
fontSize: 12,
fontWeight: isBold ? FontWeight.bold : FontWeight.normal,
color: colorScheme.onSurface,
style: AppTextStyles.bodyMedium(context).copyWith(
fontWeight: isBold ? FontWeight.bold : FontWeight.w400,
),
),
],
@@ -88,9 +85,8 @@ class WalletAddressCard extends StatelessWidget {
Expanded(
child: Text(
address,
style: const TextStyle(
style: AppTextStyles.bodyMedium(context).copyWith(
fontFamily: 'monospace',
fontSize: 12,
),
),
),
@@ -117,10 +113,7 @@ class WalletAddressCard extends StatelessWidget {
const SizedBox(height: AppSpacing.sm),
Text(
'网络: $network',
style: GoogleFonts.inter(
fontSize: 11,
color: colorScheme.onSurfaceVariant,
),
style: AppTextStyles.bodySmall(context),
),
],
),
@@ -141,7 +134,7 @@ void showDepositDialog(BuildContext context) {
showShadDialog(
context: context,
builder: (ctx) => Dialog(
backgroundColor: Colors.transparent,
backgroundColor: const Color(0x00000000),
child: GlassPanel(
borderRadius: BorderRadius.circular(AppRadius.lg),
padding: const EdgeInsets.all(AppSpacing.lg),
@@ -157,17 +150,14 @@ void showDepositDialog(BuildContext context) {
children: [
Text(
'充值',
style: GoogleFonts.inter(
fontSize: 16,
style: AppTextStyles.headlineLarge(context).copyWith(
fontWeight: FontWeight.w700,
color: colorScheme.onSurface,
),
),
const SizedBox(height: AppSpacing.xs),
Text(
'Asset: USDT',
style: GoogleFonts.inter(
fontSize: 12,
style: AppTextStyles.bodyMedium(context).copyWith(
color: colorScheme.onSurfaceVariant,
),
),
@@ -261,7 +251,7 @@ void showDepositResultDialog(BuildContext context, Map<String, dynamic> data) {
showShadDialog(
context: context,
builder: (ctx) => Dialog(
backgroundColor: Colors.transparent,
backgroundColor: const Color(0x00000000),
child: GlassPanel(
borderRadius: BorderRadius.circular(AppRadius.lg),
padding: const EdgeInsets.all(AppSpacing.lg),
@@ -279,10 +269,8 @@ void showDepositResultDialog(BuildContext context, Map<String, dynamic> data) {
const SizedBox(width: AppSpacing.sm),
Text(
'充值申请成功',
style: GoogleFonts.inter(
fontSize: 16,
style: AppTextStyles.headlineLarge(context).copyWith(
fontWeight: FontWeight.w700,
color: colorScheme.onSurface,
),
),
],
@@ -294,8 +282,7 @@ void showDepositResultDialog(BuildContext context, Map<String, dynamic> data) {
const SizedBox(height: AppSpacing.lg),
Text(
'请向以下地址转账:',
style: GoogleFonts.inter(
fontSize: 12,
style: AppTextStyles.bodyMedium(context).copyWith(
color: colorScheme.onSurfaceVariant,
),
),
@@ -318,7 +305,9 @@ void showDepositResultDialog(BuildContext context, Map<String, dynamic> data) {
Expanded(
child: Text(
'转账完成后请点击"已打款"按钮确认',
style: GoogleFonts.inter(fontSize: 12, color: AppColorScheme.warning),
style: AppTextStyles.bodyMedium(context).copyWith(
color: AppColorScheme.warning,
),
),
),
],
@@ -372,11 +361,12 @@ void showWithdrawDialog(BuildContext context, String? balance) {
final contactController = TextEditingController();
final formKey = GlobalKey<ShadFormState>();
final colorScheme = Theme.of(context).colorScheme;
final isDark = Theme.of(context).brightness == Brightness.dark;
showShadDialog(
context: context,
builder: (ctx) => Dialog(
backgroundColor: Colors.transparent,
backgroundColor: const Color(0x00000000),
child: GlassPanel(
borderRadius: BorderRadius.circular(AppRadius.lg),
padding: const EdgeInsets.all(AppSpacing.lg),
@@ -401,10 +391,8 @@ void showWithdrawDialog(BuildContext context, String? balance) {
const SizedBox(width: AppSpacing.sm),
Text(
'提现',
style: GoogleFonts.inter(
fontSize: 16,
style: AppTextStyles.headlineLarge(context).copyWith(
fontWeight: FontWeight.w700,
color: colorScheme.onSurface,
),
),
],
@@ -412,8 +400,7 @@ void showWithdrawDialog(BuildContext context, String? balance) {
const SizedBox(height: AppSpacing.xs),
Text(
'安全地将您的资产转移到外部钱包地址',
style: GoogleFonts.inter(
fontSize: 12,
style: AppTextStyles.bodyMedium(context).copyWith(
color: colorScheme.onSurfaceVariant,
),
),
@@ -425,10 +412,10 @@ void showWithdrawDialog(BuildContext context, String? balance) {
vertical: AppSpacing.sm,
),
decoration: BoxDecoration(
color: AppColorScheme.up.withValues(alpha: 0.1),
color: AppColorScheme.getUpBackgroundColor(isDark),
borderRadius: BorderRadius.circular(AppRadius.full),
border: Border.all(
color: AppColorScheme.up.withValues(alpha: 0.2),
color: AppColorScheme.getUpColor(isDark).withValues(alpha: 0.2),
),
),
child: Row(
@@ -436,17 +423,15 @@ void showWithdrawDialog(BuildContext context, String? balance) {
children: [
Text(
'可用余额: ',
style: GoogleFonts.inter(
fontSize: 10,
style: AppTextStyles.bodySmall(context).copyWith(
color: colorScheme.onSurfaceVariant,
),
),
Text(
'$balance USDT',
style: GoogleFonts.inter(
fontSize: 12,
style: AppTextStyles.labelLarge(context).copyWith(
fontWeight: FontWeight.bold,
color: AppColorScheme.up,
color: AppColorScheme.getUpColor(isDark),
),
),
],
@@ -538,7 +523,7 @@ void showWithdrawDialog(BuildContext context, String? balance) {
const SizedBox(width: AppSpacing.xs),
Text(
'End-to-End Encrypted Transaction',
style: GoogleFonts.inter(
style: AppTextStyles.bodySmall(context).copyWith(
fontSize: 10,
color: colorScheme.onSurfaceVariant.withValues(alpha: 0.5),
),
@@ -560,7 +545,7 @@ void showResultDialog(BuildContext context, String title, String? message) {
showShadDialog(
context: context,
builder: (ctx) => Dialog(
backgroundColor: Colors.transparent,
backgroundColor: const Color(0x00000000),
child: GlassPanel(
borderRadius: BorderRadius.circular(AppRadius.lg),
padding: const EdgeInsets.all(AppSpacing.lg),
@@ -569,17 +554,17 @@ void showResultDialog(BuildContext context, String title, String? message) {
children: [
Text(
title,
style: GoogleFonts.inter(
fontSize: 16,
style: AppTextStyles.headlineLarge(context).copyWith(
fontWeight: FontWeight.w700,
color: colorScheme.onSurface,
),
),
if (message != null) ...[
const SizedBox(height: AppSpacing.sm),
Text(
message,
style: GoogleFonts.inter(color: colorScheme.onSurfaceVariant),
style: AppTextStyles.bodyLarge(context).copyWith(
color: colorScheme.onSurfaceVariant,
),
textAlign: TextAlign.center,
),
],

View File

@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import '../../../../core/theme/app_theme.dart';
import '../../../../core/theme/app_color_scheme.dart';
import '../../../../core/theme/app_spacing.dart';
import '../../../../providers/asset_provider.dart';
@@ -37,28 +37,22 @@ class BalanceCard extends StatelessWidget {
children: [
Text(
'USDT 余额',
style: GoogleFonts.inter(
fontSize: 12,
fontWeight: FontWeight.normal,
style: AppTextStyles.bodyMedium(context).copyWith(
color: colorScheme.onSurfaceVariant,
fontWeight: FontWeight.w400,
),
),
const SizedBox(height: 12),
Text(
_formatBalance(displayBalance),
style: GoogleFonts.inter(
fontSize: 28,
fontWeight: FontWeight.w700,
color: colorScheme.onSurface,
),
style: AppTextStyles.numberLarge(context),
),
const SizedBox(height: 12),
Text(
'\u2248 \$${_formatBalance(displayBalance)} USD',
style: GoogleFonts.inter(
fontSize: 12,
fontWeight: FontWeight.normal,
style: AppTextStyles.bodyMedium(context).copyWith(
color: isDark ? AppColorScheme.darkOnSurfaceMuted : colorScheme.onSurfaceVariant,
fontWeight: FontWeight.w400,
),
),
],

View File

@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import '../../../../core/theme/app_theme.dart';
import '../../../../core/theme/app_color_scheme.dart';
import '../../../../core/theme/app_spacing.dart';
import '../../../../data/models/account_models.dart';
@@ -27,18 +27,13 @@ class HoldingsSection extends StatelessWidget {
children: [
Text(
'交易账户持仓',
style: GoogleFonts.inter(
fontSize: 16,
fontWeight: FontWeight.w600,
color: colorScheme.onSurface,
),
style: AppTextStyles.headlineLarge(context),
),
Text(
'查看全部 >',
style: GoogleFonts.inter(
fontSize: 12,
fontWeight: FontWeight.normal,
style: AppTextStyles.bodyMedium(context).copyWith(
color: colorScheme.onSurfaceVariant,
fontWeight: FontWeight.w400,
),
),
],
@@ -50,8 +45,7 @@ class HoldingsSection extends StatelessWidget {
padding: const EdgeInsets.all(AppSpacing.xl),
child: Text(
'暂无持仓',
style: GoogleFonts.inter(
fontSize: 13,
style: AppTextStyles.bodyLarge(context).copyWith(
color: colorScheme.onSurfaceVariant,
),
),
@@ -143,8 +137,7 @@ class HoldingRow extends StatelessWidget {
alignment: Alignment.center,
child: Text(
coinCode.substring(0, 1),
style: GoogleFonts.inter(
fontSize: 14,
style: AppTextStyles.headlineMedium(context).copyWith(
fontWeight: FontWeight.w700,
color: accentColor,
),
@@ -159,18 +152,13 @@ class HoldingRow extends StatelessWidget {
children: [
Text(
coinCode,
style: GoogleFonts.inter(
fontSize: 14,
fontWeight: FontWeight.w600,
color: colorScheme.onSurface,
),
style: AppTextStyles.headlineMedium(context),
),
const SizedBox(height: 2),
Text(
quantity,
style: GoogleFonts.inter(
fontSize: 12,
fontWeight: FontWeight.normal,
style: AppTextStyles.bodyMedium(context).copyWith(
fontWeight: FontWeight.w400,
color: colorScheme.onSurfaceVariant,
),
),
@@ -184,18 +172,14 @@ class HoldingRow extends StatelessWidget {
children: [
Text(
value,
style: GoogleFonts.inter(
style: AppTextStyles.numberMedium(context).copyWith(
fontSize: 13,
fontWeight: FontWeight.w500,
color: colorScheme.onSurface,
),
),
const SizedBox(height: 2),
Text(
profitRate,
style: GoogleFonts.inter(
fontSize: 12,
fontWeight: FontWeight.w500,
style: AppTextStyles.numberSmall(context).copyWith(
color: profitColor,
),
),

View File

@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:lucide_icons_flutter/lucide_icons.dart';
import '../../../../core/theme/app_theme.dart';
import '../../../../core/theme/app_color_scheme.dart';
import '../../../../core/theme/app_spacing.dart';
import '../../../components/glass_panel.dart';
@@ -30,10 +30,8 @@ class RecordsLinkRow extends StatelessWidget {
children: [
Text(
'充提记录',
style: GoogleFonts.inter(
fontSize: 14,
style: AppTextStyles.headlineMedium(context).copyWith(
fontWeight: FontWeight.w500,
color: colorScheme.onSurface,
),
),
Icon(