- @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>
228 lines
10 KiB
Dart
228 lines
10 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|
import '../../models/subscription_model.dart';
|
|
import '../../services/currency_util.dart';
|
|
import '../../utils/haptic_feedback_helper.dart';
|
|
import '../../theme/app_colors.dart';
|
|
import '../glassmorphism_card.dart';
|
|
import '../themed_text.dart';
|
|
|
|
/// 총 지출 요약을 보여주는 카드 위젯
|
|
class TotalExpenseSummaryCard extends StatelessWidget {
|
|
final List<SubscriptionModel> subscriptions;
|
|
final double totalExpense;
|
|
final AnimationController animationController;
|
|
|
|
const TotalExpenseSummaryCard({
|
|
super.key,
|
|
required this.subscriptions,
|
|
required this.totalExpense,
|
|
required this.animationController,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return SliverToBoxAdapter(
|
|
child: Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
child: FadeTransition(
|
|
opacity: CurvedAnimation(
|
|
parent: animationController,
|
|
curve: const Interval(0.2, 0.8, 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.2, 0.8, 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,
|
|
),
|
|
),
|
|
IconButton(
|
|
icon: const Icon(Icons.content_copy),
|
|
iconSize: 20,
|
|
padding: EdgeInsets.zero,
|
|
constraints: const BoxConstraints(),
|
|
onPressed: () async {
|
|
final totalExpenseText = CurrencyUtil.formatTotalAmount(totalExpense);
|
|
await Clipboard.setData(
|
|
ClipboardData(text: totalExpenseText));
|
|
HapticFeedbackHelper.lightImpact();
|
|
if (!context.mounted) return;
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
SnackBar(
|
|
content: Text('총 지출액이 복사되었습니다: $totalExpenseText'),
|
|
duration: const Duration(seconds: 2),
|
|
behavior: SnackBarBehavior.floating,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(8),
|
|
),
|
|
backgroundColor: AppColors.glassBackground.withValues(alpha: 0.3),
|
|
margin: const EdgeInsets.symmetric(
|
|
horizontal: 16,
|
|
vertical: 8,
|
|
),
|
|
),
|
|
);
|
|
},
|
|
),
|
|
],
|
|
),
|
|
const SizedBox(height: 8),
|
|
ThemedText.subtitle(
|
|
text: '월 단위 총액',
|
|
style: const TextStyle(
|
|
fontSize: 14,
|
|
),
|
|
),
|
|
const SizedBox(height: 16),
|
|
Row(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
ThemedText.caption(
|
|
text: '총 지출',
|
|
style: const TextStyle(
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
const SizedBox(height: 4),
|
|
ThemedText(
|
|
CurrencyUtil.formatTotalAmount(totalExpense),
|
|
style: const TextStyle(
|
|
fontSize: 26,
|
|
fontWeight: FontWeight.bold,
|
|
letterSpacing: -0.5,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
const SizedBox(width: 16),
|
|
Expanded(
|
|
child: Column(
|
|
children: [
|
|
Row(
|
|
children: [
|
|
Container(
|
|
padding: const EdgeInsets.all(8),
|
|
decoration: BoxDecoration(
|
|
color: AppColors.glassBackground.withValues(alpha: 0.3),
|
|
borderRadius: BorderRadius.circular(8),
|
|
border: Border.all(
|
|
color: AppColors.glassBorder.withValues(alpha: 0.2),
|
|
),
|
|
),
|
|
child: const FaIcon(
|
|
FontAwesomeIcons.listCheck,
|
|
size: 16,
|
|
color: AppColors.primaryColor,
|
|
),
|
|
),
|
|
const SizedBox(width: 12),
|
|
Column(
|
|
crossAxisAlignment:
|
|
CrossAxisAlignment.start,
|
|
children: [
|
|
ThemedText.caption(
|
|
text: '총 서비스',
|
|
style: const TextStyle(
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
const SizedBox(height: 2),
|
|
ThemedText(
|
|
'${subscriptions.length}개',
|
|
style: const TextStyle(
|
|
fontSize: 18,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
const SizedBox(height: 12),
|
|
Row(
|
|
children: [
|
|
Container(
|
|
padding: const EdgeInsets.all(8),
|
|
decoration: BoxDecoration(
|
|
color: AppColors.glassBackground.withValues(alpha: 0.3),
|
|
borderRadius: BorderRadius.circular(8),
|
|
border: Border.all(
|
|
color: AppColors.glassBorder.withValues(alpha: 0.2),
|
|
),
|
|
),
|
|
child: const FaIcon(
|
|
FontAwesomeIcons.chartLine,
|
|
size: 16,
|
|
color: AppColors.successColor,
|
|
),
|
|
),
|
|
const SizedBox(width: 12),
|
|
Column(
|
|
crossAxisAlignment:
|
|
CrossAxisAlignment.start,
|
|
children: [
|
|
ThemedText.caption(
|
|
text: '평균 요금',
|
|
style: const TextStyle(
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
const SizedBox(height: 2),
|
|
ThemedText(
|
|
CurrencyUtil.formatTotalAmount(
|
|
subscriptions.isEmpty
|
|
? 0
|
|
: totalExpense / subscriptions.length),
|
|
style: const TextStyle(
|
|
fontSize: 18,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
} |