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,
|
|
)),
|
|
),
|
|
);
|
|
}
|
|
}
|