- @doc/color.md 가이드라인에 따른 색상 시스템 전면 개편 - 딥 블루(#2563EB), 스카이 블루(#60A5FA) 메인 컬러로 변경 - 모든 화면과 위젯에 글래스모피즘 효과 일관성 있게 적용 - darkNavy, navyGray 등 새로운 텍스트 색상 체계 도입 - 공통 스낵바 및 다이얼로그 컴포넌트 추가 - Claude AI 프로젝트 컨텍스트 파일(CLAUDE.md) 추가 영향받은 컴포넌트: - 10개 스크린 (main, settings, detail, splash 등) - 30개 이상 위젯 (buttons, cards, forms 등) - 테마 시스템 (AppColors, AppTheme) 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
84 lines
2.5 KiB
Dart
84 lines
2.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:fl_chart/fl_chart.dart';
|
|
import '../../models/subscription_model.dart';
|
|
import '../../services/currency_util.dart';
|
|
import '../../theme/app_colors.dart';
|
|
|
|
/// 파이 차트에서 선택된 섹션에 표시되는 배지 위젯
|
|
class AnalysisBadge extends StatelessWidget {
|
|
final double size;
|
|
final Color borderColor;
|
|
final SubscriptionModel subscription;
|
|
|
|
const AnalysisBadge({
|
|
super.key,
|
|
required this.size,
|
|
required this.borderColor,
|
|
required this.subscription,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AnimatedContainer(
|
|
duration: PieChart.defaultDuration,
|
|
width: size,
|
|
height: size,
|
|
decoration: BoxDecoration(
|
|
color: AppColors.pureWhite,
|
|
shape: BoxShape.circle,
|
|
border: Border.all(
|
|
color: borderColor,
|
|
width: 2,
|
|
),
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: AppColors.shadowBlack,
|
|
blurRadius: 10,
|
|
spreadRadius: 2,
|
|
),
|
|
],
|
|
),
|
|
child: Center(
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Text(
|
|
subscription.serviceName.length > 5
|
|
? '${subscription.serviceName.substring(0, 5)}...'
|
|
: subscription.serviceName,
|
|
style: const TextStyle(
|
|
fontSize: 8,
|
|
fontWeight: FontWeight.bold,
|
|
color: AppColors.darkNavy,
|
|
),
|
|
),
|
|
const SizedBox(height: 2),
|
|
FutureBuilder<String>(
|
|
future: CurrencyUtil.formatAmount(
|
|
subscription.monthlyCost,
|
|
subscription.currency,
|
|
),
|
|
builder: (context, snapshot) {
|
|
if (snapshot.hasData) {
|
|
final amountText = snapshot.data!;
|
|
// 금액이 너무 길면 축약
|
|
final displayText = amountText.length > 8
|
|
? amountText.replaceAll('원', '').trim()
|
|
: amountText;
|
|
return Text(
|
|
displayText,
|
|
style: const TextStyle(
|
|
fontSize: 7,
|
|
color: AppColors.navyGray,
|
|
),
|
|
);
|
|
}
|
|
return const SizedBox();
|
|
},
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
} |