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.
33 lines
976 B
Dart
33 lines
976 B
Dart
import 'package:flutter/material.dart';
|
|
import '../../../../core/theme/app_spacing.dart';
|
|
import '../../../../core/theme/app_theme.dart';
|
|
|
|
/// 币种头像组件
|
|
///
|
|
/// 显示币种图标或首字母的圆形头像,带主题色边框和背景。
|
|
class CoinAvatar extends StatelessWidget {
|
|
final String? icon;
|
|
const CoinAvatar({super.key, this.icon});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final colorScheme = Theme.of(context).colorScheme;
|
|
return Container(
|
|
width: 44,
|
|
height: 44,
|
|
decoration: BoxDecoration(
|
|
color: colorScheme.primary.withOpacity(0.1),
|
|
borderRadius: BorderRadius.circular(AppRadius.md),
|
|
border: Border.all(color: colorScheme.primary.withOpacity(0.2)),
|
|
),
|
|
child: Center(
|
|
child: Text(icon ?? '?',
|
|
style: AppTextStyles.displaySmall(context).copyWith(
|
|
fontSize: 20,
|
|
color: colorScheme.primary,
|
|
)),
|
|
),
|
|
);
|
|
}
|
|
}
|