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

@@ -2,10 +2,10 @@ import 'dart:typed_data';
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';
@@ -81,7 +81,7 @@ class _RegisterPageState extends State<RegisterPage> {
return Scaffold(
backgroundColor: colorScheme.background,
appBar: AppBar(
backgroundColor: Colors.transparent,
backgroundColor: AppColorScheme.darkBackground.withValues(alpha: 0),
elevation: 0,
leading: IconButton(
icon: Icon(LucideIcons.chevronLeft, color: colorScheme.onSurface),
@@ -124,7 +124,7 @@ class _RegisterPageState extends State<RegisterPage> {
height: 2,
color: _currentStep > 0
? AppColorScheme.up
: colorScheme.outlineVariant.withOpacity(0.2),
: colorScheme.outlineVariant.withValues(alpha: 0.2),
),
),
_buildStepCircle(
@@ -150,10 +150,10 @@ class _RegisterPageState extends State<RegisterPage> {
if (isComplete) {
circleColor = AppColorScheme.up;
textColor = Colors.white;
textColor = AppColorScheme.darkOnPrimary;
} else if (isActive) {
circleColor = colorScheme.primary;
textColor = Colors.white;
textColor = AppColorScheme.darkOnPrimary;
} else {
circleColor = colorScheme.surfaceContainerHigh;
textColor = colorScheme.onSurfaceVariant;
@@ -173,19 +173,17 @@ class _RegisterPageState extends State<RegisterPage> {
? Icon(LucideIcons.check, size: 16, color: textColor)
: Text(
number,
style: TextStyle(
fontSize: 14,
style: AppTextStyles.headlineMedium(context).copyWith(
fontWeight: FontWeight.bold,
color: textColor,
),
),
),
),
SizedBox(height: 4),
SizedBox(height: AppSpacing.xs),
Text(
label,
style: TextStyle(
fontSize: 11,
style: AppTextStyles.bodySmall(context).copyWith(
color: colorScheme.onSurfaceVariant,
),
),
@@ -204,14 +202,13 @@ class _RegisterPageState extends State<RegisterPage> {
Center(
child: Text(
'创建账号',
style: GoogleFonts.spaceGrotesk(
fontSize: 18,
style: AppTextStyles.displaySmall(context).copyWith(
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
),
),
),
SizedBox(height: 48),
SizedBox(height: AppSpacing.xxl),
// 用户名
TextFormField(
@@ -228,7 +225,7 @@ class _RegisterPageState extends State<RegisterPage> {
return null;
},
),
SizedBox(height: 16),
SizedBox(height: AppSpacing.md),
// 密码
TextFormField(
@@ -252,7 +249,7 @@ class _RegisterPageState extends State<RegisterPage> {
return null;
},
),
SizedBox(height: 16),
SizedBox(height: AppSpacing.md),
// 确认密码
TextFormField(
@@ -276,7 +273,7 @@ class _RegisterPageState extends State<RegisterPage> {
return null;
},
),
SizedBox(height: 16),
SizedBox(height: AppSpacing.md),
// 推广码(可选)
TextFormField(
@@ -287,7 +284,7 @@ class _RegisterPageState extends State<RegisterPage> {
prefixIcon: Icon(Icons.card_giftcard, color: colorScheme.onSurfaceVariant),
),
),
SizedBox(height: 32),
SizedBox(height: AppSpacing.xl),
// 下一步按钮
SizedBox(
@@ -304,13 +301,13 @@ class _RegisterPageState extends State<RegisterPage> {
showGlow: true,
),
),
SizedBox(height: 16),
SizedBox(height: AppSpacing.md),
// 登录链接
Center(
child: TextButton(
onPressed: () => Navigator.pop(context),
child: const Text('已有账号?立即登录', style: TextStyle(fontSize: 14)),
child: Text('已有账号?立即登录', style: AppTextStyles.headlineMedium(context)),
),
),
],
@@ -334,7 +331,7 @@ class _RegisterPageState extends State<RegisterPage> {
Container(
padding: EdgeInsets.all(AppSpacing.sm),
decoration: BoxDecoration(
color: colorScheme.primary.withOpacity(0.1),
color: colorScheme.primary.withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(AppRadius.md),
),
child: Icon(
@@ -349,17 +346,15 @@ class _RegisterPageState extends State<RegisterPage> {
children: [
Text(
'身份验证',
style: GoogleFonts.spaceGrotesk(
fontSize: 16,
style: AppTextStyles.headlineLarge(context).copyWith(
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
),
),
SizedBox(height: 2),
SizedBox(height: AppSpacing.xs),
Text(
'上传身份证正反面完成注册',
style: TextStyle(
fontSize: 12,
style: AppTextStyles.bodyMedium(context).copyWith(
color: colorScheme.onSurfaceVariant,
),
),
@@ -372,8 +367,7 @@ class _RegisterPageState extends State<RegisterPage> {
// 身份证正面
Text(
'身份证正面(人像面)',
style: TextStyle(
fontSize: 13,
style: AppTextStyles.bodyLarge(context).copyWith(
fontWeight: FontWeight.w600,
color: colorScheme.onSurface,
),
@@ -391,8 +385,7 @@ class _RegisterPageState extends State<RegisterPage> {
// 身份证反面
Text(
'身份证反面(国徽面)',
style: TextStyle(
fontSize: 13,
style: AppTextStyles.bodyLarge(context).copyWith(
fontWeight: FontWeight.w600,
color: colorScheme.onSurface,
),
@@ -431,9 +424,9 @@ class _RegisterPageState extends State<RegisterPage> {
Container(
padding: EdgeInsets.all(AppSpacing.md),
decoration: BoxDecoration(
color: AppColorScheme.up.withOpacity(0.06),
borderRadius: BorderRadius.circular(AppRadius.lg),
border: Border.all(color: AppColorScheme.up.withOpacity(0.12)),
color: AppColorScheme.up.withValues(alpha: 0.06),
borderRadius: AppRadius.radiusLg,
border: Border.all(color: AppColorScheme.up.withValues(alpha: 0.12)),
),
child: Row(
children: [
@@ -442,9 +435,8 @@ class _RegisterPageState extends State<RegisterPage> {
Expanded(
child: Text(
'您的身份信息将被加密存储,仅用于身份验证',
style: TextStyle(
fontSize: 11,
color: AppColorScheme.up.withOpacity(0.8),
style: AppTextStyles.bodySmall(context).copyWith(
color: AppColorScheme.up.withValues(alpha: 0.8),
),
),
),
@@ -472,16 +464,16 @@ class _RegisterPageState extends State<RegisterPage> {
height: 140,
decoration: BoxDecoration(
color: hasImage
? AppColorScheme.up.withOpacity(0.06)
: colorScheme.surfaceContainerHigh.withOpacity(0.3),
borderRadius: BorderRadius.circular(AppRadius.xl),
? AppColorScheme.up.withValues(alpha: 0.06)
: colorScheme.surfaceContainerHigh.withValues(alpha: 0.3),
borderRadius: AppRadius.radiusXl,
border: Border.all(
color: hasImage ? AppColorScheme.up.withOpacity(0.3) : Colors.transparent,
color: hasImage ? AppColorScheme.up.withValues(alpha: 0.3) : AppColorScheme.darkBackground.withValues(alpha: 0),
),
),
child: hasImage
? ClipRRect(
borderRadius: BorderRadius.circular(AppRadius.xl),
borderRadius: AppRadius.radiusXl,
child: Stack(
fit: StackFit.passthrough,
children: [
@@ -499,7 +491,7 @@ class _RegisterPageState extends State<RegisterPage> {
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [Colors.transparent, Colors.black54],
colors: [AppColorScheme.darkBackground.withValues(alpha: 0), AppColorScheme.darkSurfaceLowest.withValues(alpha: 0.6)],
),
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(AppRadius.xl),
@@ -511,10 +503,9 @@ class _RegisterPageState extends State<RegisterPage> {
children: [
Text(
'$label已选择',
style: TextStyle(
fontSize: 12,
style: AppTextStyles.bodyMedium(context).copyWith(
fontWeight: FontWeight.w600,
color: Colors.white,
color: AppColorScheme.darkOnPrimary,
),
),
GestureDetector(
@@ -530,12 +521,12 @@ class _RegisterPageState extends State<RegisterPage> {
});
},
child: Container(
padding: EdgeInsets.all(4),
padding: EdgeInsets.all(AppSpacing.xs),
decoration: BoxDecoration(
color: Colors.white24,
color: AppColorScheme.darkOnPrimary.withValues(alpha: 0.15),
shape: BoxShape.circle,
),
child: Icon(LucideIcons.x, size: 14, color: Colors.white),
child: Icon(LucideIcons.x, size: 14, color: AppColorScheme.darkOnPrimary),
),
),
],
@@ -547,7 +538,7 @@ class _RegisterPageState extends State<RegisterPage> {
)
: CustomPaint(
painter: _DashedBorderPainter(
color: colorScheme.onSurfaceVariant.withOpacity(0.2),
color: colorScheme.onSurfaceVariant.withValues(alpha: 0.2),
borderRadius: AppRadius.xl,
),
child: Column(
@@ -556,22 +547,20 @@ class _RegisterPageState extends State<RegisterPage> {
Icon(
LucideIcons.camera,
size: 28,
color: colorScheme.onSurfaceVariant.withOpacity(0.5),
color: colorScheme.onSurfaceVariant.withValues(alpha: 0.5),
),
SizedBox(height: AppSpacing.sm),
Text(
'点击上传$label',
style: TextStyle(
fontSize: 13,
color: colorScheme.onSurfaceVariant.withOpacity(0.6),
style: AppTextStyles.bodyLarge(context).copyWith(
color: colorScheme.onSurfaceVariant.withValues(alpha: 0.6),
),
),
SizedBox(height: 4),
SizedBox(height: AppSpacing.xs),
Text(
'支持 JPG、PNG 格式',
style: TextStyle(
fontSize: 11,
color: colorScheme.onSurfaceVariant.withOpacity(0.4),
style: AppTextStyles.bodySmall(context).copyWith(
color: colorScheme.onSurfaceVariant.withValues(alpha: 0.4),
),
),
],