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,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:lucide_icons_flutter/lucide_icons.dart';
import '../../../../core/theme/app_spacing.dart';
import '../../../../core/theme/app_theme.dart';
import 'avatar_circle.dart';
/// 用户资料卡片 - 头像 + 用户名 + 徽章 + chevron
@@ -42,11 +42,7 @@ class ProfileCard extends StatelessWidget {
children: [
Text(
user?.username ?? '未登录',
style: GoogleFonts.inter(
fontSize: 16,
fontWeight: FontWeight.w600,
color: colorScheme.onSurface,
),
style: AppTextStyles.headlineLarge(context),
),
const SizedBox(height: 4),
Text(

View File

@@ -3,10 +3,10 @@ import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter/material.dart';
import 'package:shadcn_ui/shadcn_ui.dart';
import 'package:provider/provider.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:image_picker/image_picker.dart';
import '../../../core/theme/app_color_scheme.dart';
import '../../../core/theme/app_spacing.dart';
import '../../../core/theme/app_theme.dart';
import '../../../providers/auth_provider.dart';
import '../../components/glass_panel.dart';
import '../../components/neon_glow.dart';
@@ -61,14 +61,11 @@ class _KycPageState extends State<KycPage> {
return Scaffold(
backgroundColor: colorScheme.background,
appBar: AppBar(
backgroundColor: Colors.transparent,
backgroundColor: colorScheme.surface.withOpacity(0.0),
elevation: 0,
title: Text(
'实名认证',
style: GoogleFonts.spaceGrotesk(
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
),
style: AppTextStyles.headlineLarge(context),
),
leading: IconButton(
icon: Icon(LucideIcons.chevronLeft, color: colorScheme.onSurface),
@@ -111,19 +108,12 @@ class _KycPageState extends State<KycPage> {
children: [
Text(
'身份验证',
style: GoogleFonts.spaceGrotesk(
fontSize: 16,
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
),
style: AppTextStyles.headlineLarge(context),
),
SizedBox(height: 2),
Text(
'上传身份证正反面完成实名认证',
style: TextStyle(
fontSize: 12,
color: colorScheme.onSurfaceVariant,
),
style: AppTextStyles.bodyMedium(context),
),
],
),
@@ -134,11 +124,7 @@ class _KycPageState extends State<KycPage> {
// 身份证正面上传区
Text(
'身份证正面(人像面)',
style: TextStyle(
fontSize: 13,
fontWeight: FontWeight.w600,
color: colorScheme.onSurface,
),
style: AppTextStyles.headlineSmall(context),
),
SizedBox(height: AppSpacing.sm),
_buildUploadZone(
@@ -153,11 +139,7 @@ class _KycPageState extends State<KycPage> {
// 身份证反面上传区
Text(
'身份证反面(国徽面)',
style: TextStyle(
fontSize: 13,
fontWeight: FontWeight.w600,
color: colorScheme.onSurface,
),
style: AppTextStyles.headlineSmall(context),
),
SizedBox(height: AppSpacing.sm),
_buildUploadZone(
@@ -206,8 +188,7 @@ class _KycPageState extends State<KycPage> {
Expanded(
child: Text(
'您的身份信息将被加密存储,仅用于身份验证',
style: TextStyle(
fontSize: 11,
style: AppTextStyles.bodySmall(context).copyWith(
color: AppColorScheme.up.withOpacity(0.8),
),
),
@@ -266,10 +247,10 @@ class _KycPageState extends State<KycPage> {
if (isDone || isComplete) {
circleColor = AppColorScheme.up;
textColor = Colors.white;
textColor = colorScheme.onPrimary;
} else if (isActive) {
circleColor = colorScheme.primary;
textColor = Colors.white;
textColor = colorScheme.onPrimary;
} else {
circleColor = colorScheme.surfaceContainerHigh;
textColor = colorScheme.onSurfaceVariant;
@@ -289,9 +270,7 @@ class _KycPageState extends State<KycPage> {
? Icon(LucideIcons.check, size: 16, color: textColor)
: Text(
number,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
style: AppTextStyles.headlineMedium(context).copyWith(
color: textColor,
),
),
@@ -300,10 +279,7 @@ class _KycPageState extends State<KycPage> {
SizedBox(height: 4),
Text(
label,
style: TextStyle(
fontSize: 11,
color: colorScheme.onSurfaceVariant,
),
style: AppTextStyles.bodySmall(context),
),
],
);
@@ -332,7 +308,7 @@ class _KycPageState extends State<KycPage> {
border: Border.all(
color: hasImage
? AppColorScheme.up.withOpacity(0.3)
: Colors.transparent,
: colorScheme.surface.withOpacity(0.0),
),
),
child: hasImage
@@ -359,8 +335,8 @@ class _KycPageState extends State<KycPage> {
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Colors.transparent,
Colors.black54,
const Color(0x00000000),
const Color(0x8A000000),
],
),
borderRadius: BorderRadius.only(
@@ -373,10 +349,8 @@ class _KycPageState extends State<KycPage> {
children: [
Text(
'$label已选择',
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Colors.white,
style: AppTextStyles.labelLarge(context).copyWith(
color: colorScheme.onPrimary,
),
),
GestureDetector(
@@ -394,13 +368,13 @@ class _KycPageState extends State<KycPage> {
child: Container(
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Colors.white24,
color: colorScheme.onSurface.withOpacity(0.24),
shape: BoxShape.circle,
),
child: Icon(
LucideIcons.x,
size: 14,
color: Colors.white,
color: colorScheme.onSurface,
),
),
),
@@ -427,16 +401,14 @@ class _KycPageState extends State<KycPage> {
SizedBox(height: AppSpacing.sm),
Text(
'点击上传$label',
style: TextStyle(
fontSize: 13,
style: AppTextStyles.bodyLarge(context).copyWith(
color: colorScheme.onSurfaceVariant.withOpacity(0.6),
),
),
SizedBox(height: 4),
Text(
'支持 JPG、PNG 格式',
style: TextStyle(
fontSize: 11,
style: AppTextStyles.bodySmall(context).copyWith(
color: colorScheme.onSurfaceVariant.withOpacity(0.4),
),
),

View File

@@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
import 'package:shadcn_ui/shadcn_ui.dart';
import 'package:provider/provider.dart';
import 'package:google_fonts/google_fonts.dart';
import '../../../core/theme/app_color_scheme.dart';
import '../../../core/theme/app_spacing.dart';
import '../../../core/theme/app_theme.dart';
import '../../../providers/auth_provider.dart';
import '../auth/login_page.dart';
import 'components/about_dialog_helpers.dart';
@@ -57,9 +57,7 @@ class _MinePageState extends State<MinePage>
SizedBox(height: AppSpacing.md),
Text(
'System Build v1.0.0',
style: GoogleFonts.inter(
fontSize: 11,
fontWeight: FontWeight.normal,
style: AppTextStyles.bodySmall(context).copyWith(
color: colorScheme.onSurfaceVariant.withOpacity(0.5),
),
),

View File

@@ -2,9 +2,9 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:shadcn_ui/shadcn_ui.dart';
import 'package:provider/provider.dart';
import 'package:google_fonts/google_fonts.dart';
import '../../../core/theme/app_color_scheme.dart';
import '../../../core/theme/app_spacing.dart';
import '../../../core/theme/app_theme.dart';
import '../../../core/utils/toast_utils.dart';
import '../../../core/event/app_event_bus.dart';
import '../../../data/services/bonus_service.dart';
@@ -63,35 +63,19 @@ class _WelfareCenterPageState extends State<WelfareCenterPage> {
/// 文字静默色 ($text-muted)
Color get _textMuted =>
_isDark ? const Color(0xFF64748B) : const Color(0xFF94A3B8);
_isDark ? AppColorScheme.darkOnSurfaceMuted : AppColorScheme.lightOnSurfaceMuted;
/// 第三级背景色 ($bg-tertiary)
Color get _bgTertiary =>
_isDark ? AppColorScheme.darkSurfaceContainerHigh : const Color(0xFFF1F5F9);
_isDark ? AppColorScheme.darkSurfaceContainerHigh : AppColorScheme.lightSurfaceContainer;
/// 卡片表面色 ($surface-card)
Color get _surfaceCard =>
_isDark ? AppColorScheme.darkSurfaceContainer : Colors.white;
_isDark ? AppColorScheme.darkSurfaceContainer : AppColorScheme.lightSurfaceLowest;
/// 反色文字 ($text-inverse)
Color get _textInverse =>
_isDark ? const Color(0xFF0F172A) : Colors.white;
// ============================================
// 文本样式辅助
// ============================================
TextStyle _inter({
required double fontSize,
required FontWeight fontWeight,
required Color color,
}) {
return GoogleFonts.inter(
fontSize: fontSize,
fontWeight: fontWeight,
color: color,
);
}
_isDark ? AppColorScheme.darkInverseSurface : AppColorScheme.lightSurfaceLowest;
// ============================================
// 容器样式辅助
@@ -138,7 +122,7 @@ class _WelfareCenterPageState extends State<WelfareCenterPage> {
),
child: Text(
text,
style: _inter(fontSize: 11, fontWeight: FontWeight.w600, color: textColor),
style: AppTextStyles.labelSmall(context).copyWith(color: textColor),
),
);
}
@@ -169,7 +153,10 @@ class _WelfareCenterPageState extends State<WelfareCenterPage> {
),
child: Text(
text,
style: _inter(fontSize: 14, fontWeight: FontWeight.w700, color: foregroundColor),
style: AppTextStyles.headlineMedium(context).copyWith(
fontWeight: FontWeight.w700,
color: foregroundColor,
),
),
),
);
@@ -182,22 +169,18 @@ class _WelfareCenterPageState extends State<WelfareCenterPage> {
return Scaffold(
backgroundColor: _isDark
? AppColorScheme.darkBackground
: const Color(0xFFF8FAFC),
: AppColorScheme.lightBackground,
appBar: AppBar(
backgroundColor: _isDark
? AppColorScheme.darkBackground
: Colors.white,
: AppColorScheme.lightSurfaceLowest,
elevation: 0,
scrolledUnderElevation: 0,
centerTitle: false,
titleSpacing: 0,
title: Text(
'福利中心',
style: _inter(
fontSize: 17,
fontWeight: FontWeight.w600,
color: colorScheme.onSurface,
),
style: AppTextStyles.headlineLarge(context),
),
leading: IconButton(
icon: Icon(LucideIcons.arrowLeft, color: colorScheme.onSurface, size: 24),
@@ -256,10 +239,8 @@ class _WelfareCenterPageState extends State<WelfareCenterPage> {
const SizedBox(width: 10),
Text(
'我的邀请码',
style: _inter(
fontSize: 16,
style: AppTextStyles.headlineLarge(context).copyWith(
fontWeight: FontWeight.w700,
color: colorScheme.onSurface,
),
),
],
@@ -267,11 +248,11 @@ class _WelfareCenterPageState extends State<WelfareCenterPage> {
const SizedBox(height: 16),
Text(
referralCode.isEmpty ? '暂无邀请码' : referralCode,
style: _inter(
fontSize: 24,
style: AppTextStyles.displayMedium(context).copyWith(
fontWeight: FontWeight.w800,
color: _goldAccent,
).copyWith(letterSpacing: 2),
letterSpacing: 2,
),
),
const SizedBox(height: 16),
SizedBox(
@@ -295,7 +276,7 @@ class _WelfareCenterPageState extends State<WelfareCenterPage> {
),
child: Text(
'复制邀请码',
style: _inter(fontSize: 14, fontWeight: FontWeight.w600, color: _textInverse),
style: AppTextStyles.headlineMedium(context).copyWith(color: _textInverse),
),
),
),
@@ -355,10 +336,8 @@ class _WelfareCenterPageState extends State<WelfareCenterPage> {
children: [
Text(
'新人福利',
style: _inter(
fontSize: 16,
style: AppTextStyles.headlineLarge(context).copyWith(
fontWeight: FontWeight.w700,
color: colorScheme.onSurface,
),
),
if (showAvailableBadge)
@@ -368,8 +347,7 @@ class _WelfareCenterPageState extends State<WelfareCenterPage> {
const SizedBox(height: 12),
Text(
'+100 USDT',
style: _inter(
fontSize: 28,
style: AppTextStyles.displayLarge(context).copyWith(
fontWeight: FontWeight.w800,
color: claimed ? colorScheme.onSurfaceVariant : _profitGreen,
),
@@ -377,9 +355,7 @@ class _WelfareCenterPageState extends State<WelfareCenterPage> {
const SizedBox(height: 8),
Text(
description,
style: _inter(
fontSize: 13,
fontWeight: FontWeight.normal,
style: AppTextStyles.bodyLarge(context).copyWith(
color: colorScheme.onSurfaceVariant,
),
),
@@ -387,7 +363,7 @@ class _WelfareCenterPageState extends State<WelfareCenterPage> {
_fullWidthButton(
text: buttonText,
backgroundColor: _profitGreen,
foregroundColor: Colors.white,
foregroundColor: colorScheme.onPrimary,
onPressed: canClaim ? () => _claimNewUserBonus() : null,
),
],
@@ -410,18 +386,12 @@ class _WelfareCenterPageState extends State<WelfareCenterPage> {
// Section Header
Text(
'推广奖励',
style: _inter(
fontSize: 16,
fontWeight: FontWeight.w600,
color: colorScheme.onSurface,
),
style: AppTextStyles.headlineLarge(context),
),
const SizedBox(height: 4),
Text(
'每邀请一位好友充值达标奖励100 USDT',
style: _inter(
fontSize: 11,
fontWeight: FontWeight.normal,
style: AppTextStyles.bodySmall(context).copyWith(
color: _textMuted,
),
),
@@ -454,9 +424,7 @@ class _WelfareCenterPageState extends State<WelfareCenterPage> {
const SizedBox(height: 8),
Text(
'暂无推广用户',
style: _inter(
fontSize: 13,
fontWeight: FontWeight.normal,
style: AppTextStyles.bodyLarge(context).copyWith(
color: colorScheme.onSurfaceVariant,
),
),
@@ -505,12 +473,12 @@ class _WelfareCenterPageState extends State<WelfareCenterPage> {
const SizedBox(width: 10),
Text(
username,
style: _inter(fontSize: 13, fontWeight: FontWeight.w500, color: colorScheme.onSurface),
style: AppTextStyles.headlineSmall(context),
),
const SizedBox(width: 10),
Text(
'充值: \u00A5$totalDeposit',
style: _inter(fontSize: 11, fontWeight: FontWeight.normal, color: colorScheme.onSurfaceVariant),
style: AppTextStyles.bodySmall(context),
),
],
),
@@ -557,9 +525,7 @@ class _WelfareCenterPageState extends State<WelfareCenterPage> {
child: Center(
child: Text(
username.isNotEmpty ? username[0].toUpperCase() : '?',
style: _inter(
fontSize: 13,
fontWeight: FontWeight.w500,
style: AppTextStyles.headlineSmall(context).copyWith(
color: colorScheme.onSurfaceVariant,
),
),
@@ -612,7 +578,7 @@ class _WelfareCenterPageState extends State<WelfareCenterPage> {
}
return Text(
'待达标',
style: _inter(fontSize: 12, fontWeight: FontWeight.w500, color: _textMuted),
style: AppTextStyles.labelLarge(context).copyWith(color: _textMuted),
);
}
@@ -635,11 +601,7 @@ class _WelfareCenterPageState extends State<WelfareCenterPage> {
children: [
Text(
'奖励规则',
style: _inter(
fontSize: 13,
fontWeight: FontWeight.w600,
color: colorScheme.onSurface,
),
style: AppTextStyles.headlineSmall(context),
),
const SizedBox(height: 8),
_buildRuleItem('新用户注册完成实名认证奖励 100 USDT'),
@@ -658,9 +620,7 @@ class _WelfareCenterPageState extends State<WelfareCenterPage> {
padding: const EdgeInsets.symmetric(vertical: 3),
child: Text(
'\u2022 $text',
style: _inter(
fontSize: 12,
fontWeight: FontWeight.normal,
style: AppTextStyles.bodyMedium(context).copyWith(
color: ruleTextColor,
),
),