style: apply dart format across project
This commit is contained in:
@@ -41,18 +41,18 @@ class _SubscriptionCardState extends State<SubscriptionCard>
|
||||
);
|
||||
_loadDisplayName();
|
||||
}
|
||||
|
||||
|
||||
Future<void> _loadDisplayName() async {
|
||||
if (!mounted) return;
|
||||
|
||||
|
||||
final localeProvider = context.read<LocaleProvider>();
|
||||
final locale = localeProvider.locale.languageCode;
|
||||
|
||||
|
||||
final displayName = await SubscriptionUrlMatcher.getServiceDisplayName(
|
||||
serviceName: widget.subscription.serviceName,
|
||||
locale: locale,
|
||||
);
|
||||
|
||||
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_displayName = displayName;
|
||||
@@ -60,7 +60,6 @@ class _SubscriptionCardState extends State<SubscriptionCard>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
void didUpdateWidget(SubscriptionCard oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
@@ -203,7 +202,8 @@ class _SubscriptionCardState extends State<SubscriptionCard>
|
||||
daysUntilNext = 7; // 다음 주 같은 요일
|
||||
}
|
||||
|
||||
if (daysUntilNext == 0) return AppLocalizations.of(context).paymentDueToday;
|
||||
if (daysUntilNext == 0)
|
||||
return AppLocalizations.of(context).paymentDueToday;
|
||||
return AppLocalizations.of(context).paymentDueInDays(daysUntilNext);
|
||||
}
|
||||
|
||||
@@ -232,18 +232,18 @@ class _SubscriptionCardState extends State<SubscriptionCard>
|
||||
if (widget.subscription.categoryId == null) {
|
||||
return AppColors.blueGradient;
|
||||
}
|
||||
|
||||
|
||||
final categoryProvider = context.watch<CategoryProvider>();
|
||||
final category = categoryProvider.getCategoryById(widget.subscription.categoryId!);
|
||||
|
||||
final category =
|
||||
categoryProvider.getCategoryById(widget.subscription.categoryId!);
|
||||
|
||||
if (category == null) {
|
||||
return AppColors.blueGradient;
|
||||
}
|
||||
|
||||
final categoryColor = Color(
|
||||
int.parse(category.color.replaceAll('#', '0xFF'))
|
||||
);
|
||||
|
||||
|
||||
final categoryColor =
|
||||
Color(int.parse(category.color.replaceAll('#', '0xFF')));
|
||||
|
||||
return [
|
||||
categoryColor,
|
||||
categoryColor.withValues(alpha: 0.8),
|
||||
@@ -283,12 +283,12 @@ class _SubscriptionCardState extends State<SubscriptionCard>
|
||||
Widget build(BuildContext context) {
|
||||
// LocaleProvider를 watch하여 언어 변경시 자동 업데이트
|
||||
final localeProvider = context.watch<LocaleProvider>();
|
||||
|
||||
|
||||
// 언어가 변경되면 displayName 다시 로드
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_loadDisplayName();
|
||||
});
|
||||
|
||||
|
||||
final isNearBilling = _isNearBilling();
|
||||
|
||||
return Hero(
|
||||
@@ -300,11 +300,13 @@ class _SubscriptionCardState extends State<SubscriptionCard>
|
||||
padding: EdgeInsets.zero,
|
||||
borderRadius: 16,
|
||||
blur: _isHovering ? 15 : 10,
|
||||
width: double.infinity, // 전체 너비를 차지하도록 설정
|
||||
onTap: widget.onTap ?? () async {
|
||||
print('[SubscriptionCard] AnimatedGlassmorphismCard onTap 호출됨 - ${widget.subscription.serviceName}');
|
||||
await AppNavigator.toDetail(context, widget.subscription);
|
||||
},
|
||||
width: double.infinity, // 전체 너비를 차지하도록 설정
|
||||
onTap: widget.onTap ??
|
||||
() async {
|
||||
print(
|
||||
'[SubscriptionCard] AnimatedGlassmorphismCard onTap 호출됨 - ${widget.subscription.serviceName}');
|
||||
await AppNavigator.toDetail(context, widget.subscription);
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
// 그라데이션 상단 바 효과
|
||||
@@ -330,281 +332,290 @@ class _SubscriptionCardState extends State<SubscriptionCard>
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// 서비스 아이콘
|
||||
WebsiteIcon(
|
||||
key: ValueKey(
|
||||
'subscription_icon_${widget.subscription.id}'),
|
||||
url: widget.subscription.websiteUrl,
|
||||
serviceName: widget.subscription.serviceName,
|
||||
size: 48,
|
||||
isHovered: _isHovering,
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
|
||||
// 서비스 정보
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
// 서비스 아이콘
|
||||
WebsiteIcon(
|
||||
key: ValueKey(
|
||||
'subscription_icon_${widget.subscription.id}'),
|
||||
url: widget.subscription.websiteUrl,
|
||||
serviceName: widget.subscription.serviceName,
|
||||
size: 48,
|
||||
isHovered: _isHovering,
|
||||
// 서비스명
|
||||
Flexible(
|
||||
child: Text(
|
||||
_displayName ??
|
||||
widget.subscription.serviceName,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 18,
|
||||
color: AppColors
|
||||
.darkNavy, // color.md 가이드: 메인 텍스트
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
|
||||
// 서비스 정보
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
// 서비스명
|
||||
Flexible(
|
||||
child: Text(
|
||||
_displayName ?? widget.subscription.serviceName,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 18,
|
||||
color: AppColors.darkNavy, // color.md 가이드: 메인 텍스트
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
|
||||
// 배지들
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
// 이벤트 배지
|
||||
if (widget.subscription.isCurrentlyInEvent) ...[
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 3,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFFFF6B6B),
|
||||
Color(0xFFFF8787),
|
||||
],
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(12),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.local_offer_rounded,
|
||||
size: 11,
|
||||
color: AppColors.pureWhite,
|
||||
),
|
||||
const SizedBox(width: 3),
|
||||
Text(
|
||||
AppLocalizations.of(context).event,
|
||||
style: const TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.pureWhite,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
],
|
||||
|
||||
// 결제 주기 배지
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 3,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.surfaceColorAlt,
|
||||
borderRadius:
|
||||
BorderRadius.circular(12),
|
||||
border: Border.all(
|
||||
color: AppColors.borderColor,
|
||||
width: 0.5,
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).getBillingCycleName(widget.subscription.billingCycle),
|
||||
style: const TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.navyGray, // color.md 가이드: 서브 텍스트
|
||||
),
|
||||
),
|
||||
),
|
||||
// 배지들
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
// 이벤트 배지
|
||||
if (widget
|
||||
.subscription.isCurrentlyInEvent) ...[
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 3,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFFFF6B6B),
|
||||
Color(0xFFFF8787),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
const SizedBox(height: 6),
|
||||
|
||||
// 가격 정보
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
// 가격 표시 (이벤트 가격 반영)
|
||||
// 가격 표시 (언어별 통화)
|
||||
FutureBuilder<String>(
|
||||
future: _getFormattedPrice(),
|
||||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData) {
|
||||
return const SizedBox();
|
||||
}
|
||||
|
||||
if (widget.subscription.isCurrentlyInEvent && snapshot.data!.contains('|')) {
|
||||
final prices = snapshot.data!.split('|');
|
||||
return Row(
|
||||
children: [
|
||||
Text(
|
||||
prices[0],
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.navyGray,
|
||||
decoration: TextDecoration.lineThrough,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
prices[1],
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: Color(0xFFFF6B6B),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return Text(
|
||||
snapshot.data!,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: widget.subscription.isCurrentlyInEvent
|
||||
? const Color(0xFFFF6B6B)
|
||||
: AppColors.primaryColor,
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
|
||||
// 결제 예정일 정보
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 3,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: isNearBilling
|
||||
? AppColors.warningColor
|
||||
.withValues(alpha: 0.1)
|
||||
: AppColors.successColor
|
||||
.withValues(alpha: 0.1),
|
||||
borderRadius:
|
||||
BorderRadius.circular(12),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(
|
||||
isNearBilling
|
||||
? Icons
|
||||
.access_time_filled_rounded
|
||||
: Icons
|
||||
.check_circle_rounded,
|
||||
size: 12,
|
||||
color: isNearBilling
|
||||
? AppColors.warningColor
|
||||
: AppColors.successColor,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
_getNextBillingText(),
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: isNearBilling
|
||||
? AppColors.warningColor
|
||||
: AppColors.successColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
// 이벤트 절약액 표시
|
||||
if (widget.subscription.isCurrentlyInEvent &&
|
||||
widget.subscription.eventSavings > 0) ...[
|
||||
const SizedBox(height: 4),
|
||||
Row(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 6,
|
||||
vertical: 2,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFFF6B6B).withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.savings_rounded,
|
||||
size: 14,
|
||||
color: Color(0xFFFF6B6B),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
// 이벤트 절약액 표시 (언어별 통화)
|
||||
FutureBuilder<String>(
|
||||
future: CurrencyUtil.formatEventSavingsWithLocale(
|
||||
widget.subscription,
|
||||
localeProvider.locale.languageCode,
|
||||
),
|
||||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData) {
|
||||
return const SizedBox();
|
||||
}
|
||||
return Text(
|
||||
'${snapshot.data!} ${AppLocalizations.of(context).saving}',
|
||||
style: const TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Color(0xFFFF6B6B),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
const Icon(
|
||||
Icons.local_offer_rounded,
|
||||
size: 11,
|
||||
color: AppColors.pureWhite,
|
||||
),
|
||||
const SizedBox(width: 3),
|
||||
Text(
|
||||
AppLocalizations.of(context).event,
|
||||
style: const TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.pureWhite,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
// 이벤트 종료일까지 남은 일수
|
||||
if (widget.subscription.eventEndDate != null) ...[
|
||||
Text(
|
||||
AppLocalizations.of(context).daysRemaining(widget.subscription.eventEndDate!.difference(DateTime.now()).inDays),
|
||||
style: const TextStyle(
|
||||
fontSize: 11,
|
||||
color: AppColors.navyGray, // color.md 가이드: 서브 텍스트
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
],
|
||||
|
||||
// 결제 주기 배지
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 3,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.surfaceColorAlt,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(
|
||||
color: AppColors.borderColor,
|
||||
width: 0.5,
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
AppLocalizations.of(context)
|
||||
.getBillingCycleName(
|
||||
widget.subscription.billingCycle),
|
||||
style: const TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors
|
||||
.navyGray, // color.md 가이드: 서브 텍스트
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
const SizedBox(height: 6),
|
||||
|
||||
// 가격 정보
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
// 가격 표시 (이벤트 가격 반영)
|
||||
// 가격 표시 (언어별 통화)
|
||||
FutureBuilder<String>(
|
||||
future: _getFormattedPrice(),
|
||||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData) {
|
||||
return const SizedBox();
|
||||
}
|
||||
|
||||
if (widget.subscription.isCurrentlyInEvent &&
|
||||
snapshot.data!.contains('|')) {
|
||||
final prices = snapshot.data!.split('|');
|
||||
return Row(
|
||||
children: [
|
||||
Text(
|
||||
prices[0],
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.navyGray,
|
||||
decoration:
|
||||
TextDecoration.lineThrough,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
prices[1],
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: Color(0xFFFF6B6B),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return Text(
|
||||
snapshot.data!,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: widget
|
||||
.subscription.isCurrentlyInEvent
|
||||
? const Color(0xFFFF6B6B)
|
||||
: AppColors.primaryColor,
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
|
||||
// 결제 예정일 정보
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 3,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: isNearBilling
|
||||
? AppColors.warningColor
|
||||
.withValues(alpha: 0.1)
|
||||
: AppColors.successColor
|
||||
.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(
|
||||
isNearBilling
|
||||
? Icons.access_time_filled_rounded
|
||||
: Icons.check_circle_rounded,
|
||||
size: 12,
|
||||
color: isNearBilling
|
||||
? AppColors.warningColor
|
||||
: AppColors.successColor,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
_getNextBillingText(),
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: isNearBilling
|
||||
? AppColors.warningColor
|
||||
: AppColors.successColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
// 이벤트 절약액 표시
|
||||
if (widget.subscription.isCurrentlyInEvent &&
|
||||
widget.subscription.eventSavings > 0) ...[
|
||||
const SizedBox(height: 4),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 6,
|
||||
vertical: 2,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFFF6B6B)
|
||||
.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.savings_rounded,
|
||||
size: 14,
|
||||
color: Color(0xFFFF6B6B),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
// 이벤트 절약액 표시 (언어별 통화)
|
||||
FutureBuilder<String>(
|
||||
future: CurrencyUtil
|
||||
.formatEventSavingsWithLocale(
|
||||
widget.subscription,
|
||||
localeProvider.locale.languageCode,
|
||||
),
|
||||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData) {
|
||||
return const SizedBox();
|
||||
}
|
||||
return Text(
|
||||
'${snapshot.data!} ${AppLocalizations.of(context).saving}',
|
||||
style: const TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Color(0xFFFF6B6B),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
// 이벤트 종료일까지 남은 일수
|
||||
if (widget.subscription.eventEndDate !=
|
||||
null) ...[
|
||||
Text(
|
||||
AppLocalizations.of(context).daysRemaining(
|
||||
widget.subscription.eventEndDate!
|
||||
.difference(DateTime.now())
|
||||
.inDays),
|
||||
style: const TextStyle(
|
||||
fontSize: 11,
|
||||
color: AppColors
|
||||
.navyGray, // color.md 가이드: 서브 텍스트
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user