refactor: remove unreferenced widgets/utilities and backup file in lib
This commit is contained in:
@@ -42,315 +42,321 @@ class MainScreenSummaryCard extends StatelessWidget {
|
||||
CurvedAnimation(parent: fadeController, curve: Curves.easeIn)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 23, 16, 12),
|
||||
child: GlassmorphismCard(
|
||||
borderRadius: 16,
|
||||
blur: 15,
|
||||
backgroundColor: AppColors.glassCard,
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: AppColors.mainGradient
|
||||
.map((color) => color.withValues(alpha: 0.2))
|
||||
.toList(),
|
||||
),
|
||||
border: Border.all(
|
||||
color: AppColors.glassBorder,
|
||||
width: 1,
|
||||
),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
constraints: BoxConstraints(
|
||||
minHeight: 180,
|
||||
maxHeight: activeEvents > 0 ? 300 : 240,
|
||||
child: RepaintBoundary(
|
||||
child: GlassmorphismCard(
|
||||
borderRadius: 16,
|
||||
blur: 15,
|
||||
backgroundColor: AppColors.glassCard,
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: AppColors.mainGradient
|
||||
.map((color) => color.withValues(alpha: 0.2))
|
||||
.toList(),
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
color: Colors.transparent,
|
||||
border: Border.all(
|
||||
color: AppColors.glassBorder,
|
||||
width: 1,
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
child: Stack(
|
||||
children: [
|
||||
// 애니메이션 웨이브 배경
|
||||
Positioned.fill(
|
||||
child: AnimatedWaveBackground(
|
||||
controller: waveController,
|
||||
pulseController: pulseController,
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
constraints: BoxConstraints(
|
||||
minHeight: 180,
|
||||
maxHeight: activeEvents > 0 ? 300 : 240,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
color: Colors.transparent,
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
child: Stack(
|
||||
children: [
|
||||
// 애니메이션 웨이브 배경
|
||||
Positioned.fill(
|
||||
child: AnimatedWaveBackground(
|
||||
controller: waveController,
|
||||
pulseController: pulseController,
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context)
|
||||
.monthlyTotalSubscriptionCost,
|
||||
style: const TextStyle(
|
||||
color: AppColors
|
||||
.darkNavy, // color.md 가이드: 밝은 배경 위 어두운 텍스트
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w500,
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context)
|
||||
.monthlyTotalSubscriptionCost,
|
||||
style: const TextStyle(
|
||||
color: AppColors
|
||||
.darkNavy, // color.md 가이드: 밝은 배경 위 어두운 텍스트
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
// 환율 정보 표시 (영어 사용자는 표시 안함)
|
||||
if (locale != 'en')
|
||||
FutureBuilder<String>(
|
||||
future:
|
||||
CurrencyUtil.getExchangeRateInfoForLocale(
|
||||
locale),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasData &&
|
||||
snapshot.data!.isNotEmpty) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 4,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFE5F2FF),
|
||||
borderRadius:
|
||||
BorderRadius.circular(4),
|
||||
border: Border.all(
|
||||
color: const Color(0xFFBFDBFE),
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
AppLocalizations.of(context)
|
||||
.exchangeRateDisplay
|
||||
.replaceAll('@', snapshot.data!),
|
||||
style: const TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Color(0xFF3B82F6),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return const SizedBox.shrink();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
// 월별 총 비용 표시 (언어별 기본 통화)
|
||||
FutureBuilder<double>(
|
||||
future: CurrencyUtil
|
||||
.calculateTotalMonthlyExpenseInDefaultCurrency(
|
||||
provider.subscriptions,
|
||||
locale,
|
||||
),
|
||||
// 환율 정보 표시 (영어 사용자는 표시 안함)
|
||||
if (locale != 'en')
|
||||
FutureBuilder<String>(
|
||||
future:
|
||||
CurrencyUtil.getExchangeRateInfoForLocale(
|
||||
locale),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasData &&
|
||||
snapshot.data!.isNotEmpty) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 4,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFE5F2FF),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
border: Border.all(
|
||||
color: const Color(0xFFBFDBFE),
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
AppLocalizations.of(context)
|
||||
.exchangeRateDisplay
|
||||
.replaceAll('@', snapshot.data!),
|
||||
style: const TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Color(0xFF3B82F6),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return const SizedBox.shrink();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
// 월별 총 비용 표시 (언어별 기본 통화)
|
||||
FutureBuilder<double>(
|
||||
future: CurrencyUtil
|
||||
.calculateTotalMonthlyExpenseInDefaultCurrency(
|
||||
provider.subscriptions,
|
||||
locale,
|
||||
),
|
||||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData) {
|
||||
return const CircularProgressIndicator();
|
||||
}
|
||||
final monthlyCost = snapshot.data!;
|
||||
final decimals = (defaultCurrency == 'KRW' ||
|
||||
defaultCurrency == 'JPY')
|
||||
? 0
|
||||
: 2;
|
||||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData) {
|
||||
return const CircularProgressIndicator();
|
||||
}
|
||||
final monthlyCost = snapshot.data!;
|
||||
final decimals = (defaultCurrency == 'KRW' ||
|
||||
defaultCurrency == 'JPY')
|
||||
? 0
|
||||
: 2;
|
||||
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.baseline,
|
||||
textBaseline: TextBaseline.alphabetic,
|
||||
children: [
|
||||
Text(
|
||||
NumberFormat.currency(
|
||||
locale: defaultCurrency == 'KRW'
|
||||
? 'ko_KR'
|
||||
: defaultCurrency == 'JPY'
|
||||
? 'ja_JP'
|
||||
: defaultCurrency == 'CNY'
|
||||
? 'zh_CN'
|
||||
: 'en_US',
|
||||
symbol: '',
|
||||
decimalDigits: decimals,
|
||||
).format(monthlyCost),
|
||||
style: const TextStyle(
|
||||
color: AppColors.darkNavy,
|
||||
fontSize: 32,
|
||||
fontWeight: FontWeight.bold,
|
||||
letterSpacing: -1,
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.baseline,
|
||||
textBaseline: TextBaseline.alphabetic,
|
||||
children: [
|
||||
Text(
|
||||
NumberFormat.currency(
|
||||
locale: defaultCurrency == 'KRW'
|
||||
? 'ko_KR'
|
||||
: defaultCurrency == 'JPY'
|
||||
? 'ja_JP'
|
||||
: defaultCurrency == 'CNY'
|
||||
? 'zh_CN'
|
||||
: 'en_US',
|
||||
symbol: '',
|
||||
decimalDigits: decimals,
|
||||
).format(monthlyCost),
|
||||
style: const TextStyle(
|
||||
color: AppColors.darkNavy,
|
||||
fontSize: 32,
|
||||
fontWeight: FontWeight.bold,
|
||||
letterSpacing: -1,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
currencySymbol,
|
||||
style: const TextStyle(
|
||||
color: AppColors.darkNavy,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
currencySymbol,
|
||||
style: const TextStyle(
|
||||
color: AppColors.darkNavy,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
// 연간 비용 및 총 구독 수 표시
|
||||
FutureBuilder<double>(
|
||||
future: CurrencyUtil
|
||||
.calculateTotalMonthlyExpenseInDefaultCurrency(
|
||||
provider.subscriptions,
|
||||
locale,
|
||||
),
|
||||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData) {
|
||||
return const SizedBox();
|
||||
}
|
||||
final monthlyCost = snapshot.data!;
|
||||
final yearlyCost = monthlyCost * 12;
|
||||
final decimals = (defaultCurrency == 'KRW' ||
|
||||
defaultCurrency == 'JPY')
|
||||
? 0
|
||||
: 2;
|
||||
|
||||
return Row(
|
||||
children: [
|
||||
_buildInfoBox(
|
||||
context,
|
||||
title: AppLocalizations.of(context)
|
||||
.estimatedAnnualCost,
|
||||
value: NumberFormat.currency(
|
||||
locale: defaultCurrency == 'KRW'
|
||||
? 'ko_KR'
|
||||
: defaultCurrency == 'JPY'
|
||||
? 'ja_JP'
|
||||
: defaultCurrency == 'CNY'
|
||||
? 'zh_CN'
|
||||
: 'en_US',
|
||||
symbol: currencySymbol,
|
||||
decimalDigits: decimals,
|
||||
).format(yearlyCost),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
_buildInfoBox(
|
||||
context,
|
||||
title: AppLocalizations.of(context)
|
||||
.totalSubscriptionServices,
|
||||
value:
|
||||
'$totalSubscriptions${AppLocalizations.of(context).servicesUnit}',
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
// 이벤트 절약액 표시
|
||||
if (activeEvents > 0) ...[
|
||||
const SizedBox(height: 12),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 10, horizontal: 14),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
Colors.white.withValues(alpha: 0.2),
|
||||
Colors.white.withValues(alpha: 0.15),
|
||||
],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(
|
||||
color: AppColors.primaryColor
|
||||
.withValues(alpha: 0.3),
|
||||
width: 1,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
// 연간 비용 및 총 구독 수 표시
|
||||
FutureBuilder<double>(
|
||||
future: CurrencyUtil
|
||||
.calculateTotalMonthlyExpenseInDefaultCurrency(
|
||||
provider.subscriptions,
|
||||
locale,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(6),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withValues(alpha: 0.25),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.local_offer_rounded,
|
||||
size: 14,
|
||||
color: AppColors
|
||||
.primaryColor, // color.md 가이드: 밝은 배경 위 딥 블루 아이콘
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context)
|
||||
.eventDiscountActive,
|
||||
style: const TextStyle(
|
||||
color: AppColors
|
||||
.darkNavy, // color.md 가이드: 밝은 배경 위 어두운 텍스트
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
// 이벤트 절약액 표시 (언어별 기본 통화)
|
||||
FutureBuilder<double>(
|
||||
future: CurrencyUtil
|
||||
.calculateTotalEventSavingsInDefaultCurrency(
|
||||
provider.subscriptions,
|
||||
locale,
|
||||
),
|
||||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData) {
|
||||
return const SizedBox();
|
||||
}
|
||||
final eventSavings = snapshot.data!;
|
||||
final decimals =
|
||||
(defaultCurrency == 'KRW' ||
|
||||
defaultCurrency == 'JPY')
|
||||
? 0
|
||||
: 2;
|
||||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData) {
|
||||
return const SizedBox();
|
||||
}
|
||||
final monthlyCost = snapshot.data!;
|
||||
final yearlyCost = monthlyCost * 12;
|
||||
final decimals = (defaultCurrency == 'KRW' ||
|
||||
defaultCurrency == 'JPY')
|
||||
? 0
|
||||
: 2;
|
||||
|
||||
return Row(
|
||||
children: [
|
||||
Text(
|
||||
NumberFormat.currency(
|
||||
locale: defaultCurrency == 'KRW'
|
||||
? 'ko_KR'
|
||||
: defaultCurrency == 'JPY'
|
||||
? 'ja_JP'
|
||||
: defaultCurrency ==
|
||||
'CNY'
|
||||
? 'zh_CN'
|
||||
: 'en_US',
|
||||
symbol: currencySymbol,
|
||||
decimalDigits: decimals,
|
||||
).format(eventSavings),
|
||||
style: const TextStyle(
|
||||
color: AppColors.primaryColor,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
' ${AppLocalizations.of(context).saving} ($activeEvents${AppLocalizations.of(context).servicesUnit})',
|
||||
style: const TextStyle(
|
||||
color: AppColors.navyGray,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
return Row(
|
||||
children: [
|
||||
_buildInfoBox(
|
||||
context,
|
||||
title: AppLocalizations.of(context)
|
||||
.estimatedAnnualCost,
|
||||
value: NumberFormat.currency(
|
||||
locale: defaultCurrency == 'KRW'
|
||||
? 'ko_KR'
|
||||
: defaultCurrency == 'JPY'
|
||||
? 'ja_JP'
|
||||
: defaultCurrency == 'CNY'
|
||||
? 'zh_CN'
|
||||
: 'en_US',
|
||||
symbol: currencySymbol,
|
||||
decimalDigits: decimals,
|
||||
).format(yearlyCost),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
_buildInfoBox(
|
||||
context,
|
||||
title: AppLocalizations.of(context)
|
||||
.totalSubscriptionServices,
|
||||
value:
|
||||
'$totalSubscriptions${AppLocalizations.of(context).servicesUnit}',
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
// 이벤트 절약액 표시
|
||||
if (activeEvents > 0) ...[
|
||||
const SizedBox(height: 12),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 10, horizontal: 14),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
Colors.white.withValues(alpha: 0.2),
|
||||
Colors.white.withValues(alpha: 0.15),
|
||||
],
|
||||
),
|
||||
],
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(
|
||||
color: AppColors.primaryColor
|
||||
.withValues(alpha: 0.3),
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(6),
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
Colors.white.withValues(alpha: 0.25),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.local_offer_rounded,
|
||||
size: 14,
|
||||
color: AppColors
|
||||
.primaryColor, // color.md 가이드: 밝은 배경 위 딥 블루 아이콘
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context)
|
||||
.eventDiscountActive,
|
||||
style: const TextStyle(
|
||||
color: AppColors
|
||||
.darkNavy, // color.md 가이드: 밝은 배경 위 어두운 텍스트
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
// 이벤트 절약액 표시 (언어별 기본 통화)
|
||||
FutureBuilder<double>(
|
||||
future: CurrencyUtil
|
||||
.calculateTotalEventSavingsInDefaultCurrency(
|
||||
provider.subscriptions,
|
||||
locale,
|
||||
),
|
||||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData) {
|
||||
return const SizedBox();
|
||||
}
|
||||
final eventSavings = snapshot.data!;
|
||||
final decimals =
|
||||
(defaultCurrency == 'KRW' ||
|
||||
defaultCurrency == 'JPY')
|
||||
? 0
|
||||
: 2;
|
||||
|
||||
return Row(
|
||||
children: [
|
||||
Text(
|
||||
NumberFormat.currency(
|
||||
locale: defaultCurrency ==
|
||||
'KRW'
|
||||
? 'ko_KR'
|
||||
: defaultCurrency == 'JPY'
|
||||
? 'ja_JP'
|
||||
: defaultCurrency ==
|
||||
'CNY'
|
||||
? 'zh_CN'
|
||||
: 'en_US',
|
||||
symbol: currencySymbol,
|
||||
decimalDigits: decimals,
|
||||
).format(eventSavings),
|
||||
style: const TextStyle(
|
||||
color: AppColors.primaryColor,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
' ${AppLocalizations.of(context).saving} ($activeEvents${AppLocalizations.of(context).servicesUnit})',
|
||||
style: const TextStyle(
|
||||
color: AppColors.navyGray,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user