- billing_cycle_selector, category_selector, currency_selector 컴포넌트 분리 - 구독 카드 클릭 이슈 해결을 위한 리팩토링 - SMS 스캔 화면 UI/UX 개선 및 기능 강화 - 상세 화면 컨트롤러 로직 개선 - 알림 서비스 및 구독 URL 매칭 기능 추가 - CLAUDE.md 프로젝트 가이드라인 대폭 확장 - 전반적인 코드 구조 개선 및 타입 안정성 강화 🤖 Generated with [Claude Code](https://claude.ai/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: 0),
|
|
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();
|
|
},
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
} |