- @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>
273 lines
14 KiB
Dart
273 lines
14 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|
import 'package:provider/provider.dart';
|
|
import '../../providers/subscription_provider.dart';
|
|
import '../../services/currency_util.dart';
|
|
import '../../theme/app_colors.dart';
|
|
import '../glassmorphism_card.dart';
|
|
import '../themed_text.dart';
|
|
|
|
/// 이벤트 할인 현황을 보여주는 카드 위젯
|
|
class EventAnalysisCard extends StatelessWidget {
|
|
final AnimationController animationController;
|
|
|
|
const EventAnalysisCard({
|
|
super.key,
|
|
required this.animationController,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return SliverToBoxAdapter(
|
|
child: Consumer<SubscriptionProvider>(
|
|
builder: (context, provider, child) {
|
|
return Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
child: provider.activeEventSubscriptions.isNotEmpty
|
|
? FadeTransition(
|
|
opacity: CurvedAnimation(
|
|
parent: animationController,
|
|
curve: const Interval(0.6, 1.0, curve: Curves.easeOut),
|
|
),
|
|
child: SlideTransition(
|
|
position: Tween<Offset>(
|
|
begin: const Offset(0, 0.2),
|
|
end: Offset.zero,
|
|
).animate(CurvedAnimation(
|
|
parent: animationController,
|
|
curve: const Interval(0.6, 1.0, curve: Curves.easeOut),
|
|
)),
|
|
child: GlassmorphismCard(
|
|
blur: 10,
|
|
opacity: 0.1,
|
|
borderRadius: 16,
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(16),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
ThemedText.headline(
|
|
text: '이벤트 할인 현황',
|
|
style: const TextStyle(
|
|
fontSize: 18,
|
|
),
|
|
),
|
|
Container(
|
|
padding: const EdgeInsets.symmetric(
|
|
horizontal: 8,
|
|
vertical: 4,
|
|
),
|
|
decoration: BoxDecoration(
|
|
gradient: const LinearGradient(
|
|
colors: [
|
|
Color(0xFFFF6B6B),
|
|
Color(0xFFFE7E7E),
|
|
],
|
|
),
|
|
borderRadius: BorderRadius.circular(4),
|
|
),
|
|
child: Row(
|
|
children: [
|
|
const FaIcon(
|
|
FontAwesomeIcons.fire,
|
|
size: 12,
|
|
color: AppColors.pureWhite,
|
|
),
|
|
const SizedBox(width: 4),
|
|
Text(
|
|
'${provider.activeEventSubscriptions.length}개 진행중',
|
|
style: const TextStyle(
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.bold,
|
|
color: AppColors.pureWhite,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
const SizedBox(height: 16),
|
|
Container(
|
|
padding: const EdgeInsets.all(12),
|
|
decoration: BoxDecoration(
|
|
gradient: LinearGradient(
|
|
colors: [
|
|
const Color(0xFFFF6B6B).withValues(alpha: 0.1),
|
|
const Color(0xFFFF8787).withValues(alpha: 0.1),
|
|
],
|
|
begin: Alignment.topLeft,
|
|
end: Alignment.bottomRight,
|
|
),
|
|
borderRadius: BorderRadius.circular(8),
|
|
border: Border.all(
|
|
color: const Color(0xFFFF6B6B).withValues(alpha: 0.3),
|
|
),
|
|
),
|
|
child: Row(
|
|
children: [
|
|
const Icon(
|
|
Icons.savings,
|
|
color: Color(0xFFFF6B6B),
|
|
size: 32,
|
|
),
|
|
const SizedBox(width: 12),
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
const ThemedText(
|
|
'월간 절약 금액',
|
|
style: TextStyle(
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.w500,
|
|
),
|
|
),
|
|
const SizedBox(height: 4),
|
|
ThemedText(
|
|
CurrencyUtil.formatTotalAmount(
|
|
provider.calculateTotalSavings(),
|
|
),
|
|
style: const TextStyle(
|
|
fontSize: 20,
|
|
fontWeight: FontWeight.bold,
|
|
color: Color(0xFFFF6B6B),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
const SizedBox(height: 16),
|
|
const ThemedText(
|
|
'진행중인 이벤트',
|
|
style: TextStyle(
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
const SizedBox(height: 12),
|
|
...provider.activeEventSubscriptions.map((sub) {
|
|
final savings = sub.originalPrice - (sub.eventPrice ?? sub.originalPrice);
|
|
final discountRate =
|
|
((savings / sub.originalPrice) * 100).round();
|
|
return Container(
|
|
margin: const EdgeInsets.only(bottom: 8),
|
|
padding: const EdgeInsets.all(12),
|
|
decoration: BoxDecoration(
|
|
color: AppColors.darkNavy.withValues(alpha: 0.05),
|
|
borderRadius: BorderRadius.circular(8),
|
|
border: Border.all(
|
|
color: AppColors.darkNavy.withValues(alpha: 0.1),
|
|
),
|
|
),
|
|
child: Row(
|
|
children: [
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
ThemedText(
|
|
sub.serviceName,
|
|
style: const TextStyle(
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
const SizedBox(height: 4),
|
|
Row(
|
|
children: [
|
|
FutureBuilder<String>(
|
|
future: CurrencyUtil
|
|
.formatAmount(
|
|
sub.originalPrice,
|
|
sub.currency),
|
|
builder: (context, snapshot) {
|
|
if (snapshot.hasData) {
|
|
return ThemedText(
|
|
snapshot.data!,
|
|
style: const TextStyle(
|
|
fontSize: 12,
|
|
decoration: TextDecoration
|
|
.lineThrough,
|
|
color: AppColors.navyGray,
|
|
),
|
|
);
|
|
}
|
|
return const SizedBox();
|
|
},
|
|
),
|
|
const SizedBox(width: 8),
|
|
const Icon(
|
|
Icons.arrow_forward,
|
|
size: 12,
|
|
color: AppColors.navyGray,
|
|
),
|
|
const SizedBox(width: 8),
|
|
FutureBuilder<String>(
|
|
future: CurrencyUtil
|
|
.formatAmount(
|
|
sub.eventPrice ?? sub.originalPrice,
|
|
sub.currency),
|
|
builder: (context, snapshot) {
|
|
if (snapshot.hasData) {
|
|
return ThemedText(
|
|
snapshot.data!,
|
|
style: const TextStyle(
|
|
fontSize: 12,
|
|
fontWeight:
|
|
FontWeight.bold,
|
|
color:
|
|
Color(0xFF10B981),
|
|
),
|
|
);
|
|
}
|
|
return const SizedBox();
|
|
},
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Container(
|
|
padding: const EdgeInsets.symmetric(
|
|
horizontal: 8,
|
|
vertical: 4,
|
|
),
|
|
decoration: BoxDecoration(
|
|
color: const Color(0xFFFF6B6B)
|
|
.withValues(alpha: 0.2),
|
|
borderRadius: BorderRadius.circular(4),
|
|
),
|
|
child: Text(
|
|
'$discountRate% 할인',
|
|
style: const TextStyle(
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.bold,
|
|
color: Color(0xFFFF6B6B),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}).toList(),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
)
|
|
: const SizedBox.shrink(),
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
} |