style: apply dart format across project

This commit is contained in:
JiWoong Sul
2025-09-07 19:33:11 +09:00
parent f812d4b9fd
commit d1a6cb9fe3
101 changed files with 3123 additions and 2574 deletions

View File

@@ -47,5 +47,8 @@
<true/> <true/>
<key>NSMessageUsageDescription</key> <key>NSMessageUsageDescription</key>
<string>구독 결제 정보를 자동으로 추가하기 위해 SMS 접근이 필요합니다.</string> <string>구독 결제 정보를 자동으로 추가하기 위해 SMS 접근이 필요합니다.</string>
<!-- Google AdMob App ID -->
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-6691216385521068~6638409932</string>
</dict> </dict>
</plist> </plist>

View File

@@ -158,12 +158,14 @@ class AddSubscriptionController {
serviceNameController.text = serviceInfo.serviceName; serviceNameController.text = serviceInfo.serviceName;
// 카테고리 자동 선택 // 카테고리 자동 선택
final categoryProvider = Provider.of<CategoryProvider>(context, listen: false); final categoryProvider =
Provider.of<CategoryProvider>(context, listen: false);
final categories = categoryProvider.categories; final categories = categoryProvider.categories;
// 카테고리 ID로 매칭 // 카테고리 ID로 매칭
final matchedCategory = categories.firstWhere( final matchedCategory = categories.firstWhere(
(cat) => cat.name == serviceInfo.categoryNameKr || (cat) =>
cat.name == serviceInfo.categoryNameKr ||
cat.name == serviceInfo.categoryNameEn, cat.name == serviceInfo.categoryNameEn,
orElse: () => categories.first, orElse: () => categories.first,
); );
@@ -174,7 +176,8 @@ class AddSubscriptionController {
if (context.mounted) { if (context.mounted) {
AppSnackBar.showSuccess( AppSnackBar.showSuccess(
context: context, context: context,
message: AppLocalizations.of(context).serviceRecognized(serviceInfo.serviceName), message: AppLocalizations.of(context)
.serviceRecognized(serviceInfo.serviceName),
); );
} }
} }
@@ -187,7 +190,8 @@ class AddSubscriptionController {
/// 카테고리 자동 선택 /// 카테고리 자동 선택
void autoSelectCategory() { void autoSelectCategory() {
final categoryProvider = Provider.of<CategoryProvider>(context, listen: false); final categoryProvider =
Provider.of<CategoryProvider>(context, listen: false);
final categories = categoryProvider.categories; final categories = categoryProvider.categories;
final serviceName = serviceNameController.text.toLowerCase(); final serviceName = serviceNameController.text.toLowerCase();
@@ -312,7 +316,8 @@ class AddSubscriptionController {
if (smsContent.isNotEmpty) { if (smsContent.isNotEmpty) {
try { try {
serviceInfo = await SubscriptionUrlMatcher.extractServiceFromSms(smsContent); serviceInfo =
await SubscriptionUrlMatcher.extractServiceFromSms(smsContent);
} catch (e) { } catch (e) {
if (kDebugMode) { if (kDebugMode) {
print('AddSubscriptionController: SMS 서비스 추출 실패 - $e'); print('AddSubscriptionController: SMS 서비스 추출 실패 - $e');
@@ -327,11 +332,13 @@ class AddSubscriptionController {
websiteUrlController.text = serviceInfo.serviceUrl ?? ''; websiteUrlController.text = serviceInfo.serviceUrl ?? '';
// 카테고리 자동 선택 // 카테고리 자동 선택
final categoryProvider = Provider.of<CategoryProvider>(context, listen: false); final categoryProvider =
Provider.of<CategoryProvider>(context, listen: false);
final categories = categoryProvider.categories; final categories = categoryProvider.categories;
final matchedCategory = categories.firstWhere( final matchedCategory = categories.firstWhere(
(cat) => cat.name == serviceInfo!.categoryNameKr || (cat) =>
cat.name == serviceInfo!.categoryNameKr ||
cat.name == serviceInfo.categoryNameEn, cat.name == serviceInfo.categoryNameEn,
orElse: () => categories.first, orElse: () => categories.first,
); );
@@ -396,7 +403,8 @@ class AddSubscriptionController {
if (context.mounted) { if (context.mounted) {
AppSnackBar.showError( AppSnackBar.showError(
context: context, context: context,
message: AppLocalizations.of(context).smsScanErrorWithMessage(e.toString()), message: AppLocalizations.of(context)
.smsScanErrorWithMessage(e.toString()),
); );
} }
} finally { } finally {
@@ -421,9 +429,8 @@ class AddSubscriptionController {
// 이벤트 가격 파싱 // 이벤트 가격 파싱
double? eventPrice; double? eventPrice;
if (isEventActive && eventPriceController.text.isNotEmpty) { if (isEventActive && eventPriceController.text.isNotEmpty) {
eventPrice = double.tryParse( eventPrice =
eventPriceController.text.replaceAll(',', '') double.tryParse(eventPriceController.text.replaceAll(',', ''));
);
} }
await Provider.of<SubscriptionProvider>(context, listen: false) await Provider.of<SubscriptionProvider>(context, listen: false)
@@ -452,7 +459,8 @@ class AddSubscriptionController {
if (context.mounted) { if (context.mounted) {
AppSnackBar.showError( AppSnackBar.showError(
context: context, context: context,
message: AppLocalizations.of(context).saveErrorWithMessage(e.toString()), message:
AppLocalizations.of(context).saveErrorWithMessage(e.toString()),
); );
} }
} }

View File

@@ -140,9 +140,12 @@ class DetailScreenController extends ChangeNotifier {
/// 초기화 /// 초기화
void initialize({required TickerProvider vsync}) { void initialize({required TickerProvider vsync}) {
// Text Controllers 초기화 // Text Controllers 초기화
serviceNameController = TextEditingController(text: subscription.serviceName); serviceNameController =
monthlyCostController = TextEditingController(text: subscription.monthlyCost.toString()); TextEditingController(text: subscription.serviceName);
websiteUrlController = TextEditingController(text: subscription.websiteUrl ?? ''); monthlyCostController =
TextEditingController(text: subscription.monthlyCost.toString());
websiteUrlController =
TextEditingController(text: subscription.websiteUrl ?? '');
eventPriceController = TextEditingController(); eventPriceController = TextEditingController();
// Form State 초기화 // Form State 초기화
@@ -261,10 +264,12 @@ class DetailScreenController extends ChangeNotifier {
if (_currency == 'KRW') { if (_currency == 'KRW') {
// 원화는 소수점 없이 표시 // 원화는 소수점 없이 표시
final intValue = subscription.monthlyCost.toInt(); final intValue = subscription.monthlyCost.toInt();
monthlyCostController.text = NumberFormat.decimalPattern().format(intValue); monthlyCostController.text =
NumberFormat.decimalPattern().format(intValue);
} else { } else {
// 달러는 소수점 2자리까지 표시 // 달러는 소수점 2자리까지 표시
monthlyCostController.text = NumberFormat('#,##0.00').format(subscription.monthlyCost); monthlyCostController.text =
NumberFormat('#,##0.00').format(subscription.monthlyCost);
} }
} }
@@ -275,7 +280,8 @@ class DetailScreenController extends ChangeNotifier {
/// 카테고리 자동 선택 /// 카테고리 자동 선택
void autoSelectCategory() { void autoSelectCategory() {
final categoryProvider = Provider.of<CategoryProvider>(context, listen: false); final categoryProvider =
Provider.of<CategoryProvider>(context, listen: false);
final categories = categoryProvider.categories; final categories = categoryProvider.categories;
final serviceName = serviceNameController.text.toLowerCase(); final serviceName = serviceNameController.text.toLowerCase();
@@ -377,7 +383,8 @@ class DetailScreenController extends ChangeNotifier {
// 웹사이트 URL이 비어있는 경우 자동 매칭 다시 시도 // 웹사이트 URL이 비어있는 경우 자동 매칭 다시 시도
String? websiteUrl = websiteUrlController.text; String? websiteUrl = websiteUrlController.text;
if (websiteUrl.isEmpty) { if (websiteUrl.isEmpty) {
websiteUrl = SubscriptionUrlMatcher.suggestUrl(serviceNameController.text); websiteUrl =
SubscriptionUrlMatcher.suggestUrl(serviceNameController.text);
} }
// 구독 정보 업데이트 // 구독 정보 업데이트
@@ -385,7 +392,8 @@ class DetailScreenController extends ChangeNotifier {
// 콤마 제거하고 숫자만 추출 // 콤마 제거하고 숫자만 추출
double monthlyCost = 0.0; double monthlyCost = 0.0;
try { try {
monthlyCost = double.parse(monthlyCostController.text.replaceAll(',', '')); monthlyCost =
double.parse(monthlyCostController.text.replaceAll(',', ''));
} catch (e) { } catch (e) {
// 파싱 오류 발생 시 기본값 사용 // 파싱 오류 발생 시 기본값 사용
monthlyCost = subscription.monthlyCost; monthlyCost = subscription.monthlyCost;
@@ -445,7 +453,8 @@ class DetailScreenController extends ChangeNotifier {
Future<void> deleteSubscription() async { Future<void> deleteSubscription() async {
if (context.mounted) { if (context.mounted) {
// 로케일에 맞는 서비스명 가져오기 // 로케일에 맞는 서비스명 가져오기
final localeProvider = Provider.of<LocaleProvider>(context, listen: false); final localeProvider =
Provider.of<LocaleProvider>(context, listen: false);
final locale = localeProvider.locale.languageCode; final locale = localeProvider.locale.languageCode;
final displayName = await SubscriptionUrlMatcher.getServiceDisplayName( final displayName = await SubscriptionUrlMatcher.getServiceDisplayName(
serviceName: subscription.serviceName, serviceName: subscription.serviceName,
@@ -462,13 +471,15 @@ class DetailScreenController extends ChangeNotifier {
// 사용자가 확인한 경우에만 삭제 진행 // 사용자가 확인한 경우에만 삭제 진행
if (context.mounted) { if (context.mounted) {
final provider = Provider.of<SubscriptionProvider>(context, listen: false); final provider =
Provider.of<SubscriptionProvider>(context, listen: false);
await provider.deleteSubscription(subscription.id); await provider.deleteSubscription(subscription.id);
if (context.mounted) { if (context.mounted) {
AppSnackBar.showError( AppSnackBar.showError(
context: context, context: context,
message: AppLocalizations.of(context).subscriptionDeleted(displayName), message:
AppLocalizations.of(context).subscriptionDeleted(displayName),
icon: Icons.delete_forever_rounded, icon: Icons.delete_forever_rounded,
); );
Navigator.of(context).pop(); Navigator.of(context).pop();
@@ -484,7 +495,8 @@ class DetailScreenController extends ChangeNotifier {
final locale = Localizations.localeOf(context).languageCode; final locale = Localizations.localeOf(context).languageCode;
// 2. 해지 안내 URL 찾기 // 2. 해지 안내 URL 찾기
String? cancellationUrl = await SubscriptionUrlMatcher.findCancellationUrl( String? cancellationUrl =
await SubscriptionUrlMatcher.findCancellationUrl(
serviceName: subscription.serviceName, serviceName: subscription.serviceName,
websiteUrl: subscription.websiteUrl, websiteUrl: subscription.websiteUrl,
locale: locale == 'ko' ? 'kr' : 'en', locale: locale == 'ko' ? 'kr' : 'en',
@@ -492,8 +504,10 @@ class DetailScreenController extends ChangeNotifier {
// 3. 해지 안내 URL이 없으면 구글 검색 // 3. 해지 안내 URL이 없으면 구글 검색
if (cancellationUrl == null) { if (cancellationUrl == null) {
final searchQuery = '${subscription.serviceName} ${locale == 'ko' ? '해지 방법' : 'cancel subscription'}'; final searchQuery =
cancellationUrl = 'https://www.google.com/search?q=${Uri.encodeComponent(searchQuery)}'; '${subscription.serviceName} ${locale == 'ko' ? '해지 방법' : 'cancel subscription'}';
cancellationUrl =
'https://www.google.com/search?q=${Uri.encodeComponent(searchQuery)}';
if (context.mounted) { if (context.mounted) {
AppSnackBar.showInfo( AppSnackBar.showInfo(

View File

@@ -59,11 +59,13 @@ class SmsScanController extends ChangeNotifier {
try { try {
// SMS 스캔 실행 // SMS 스캔 실행
print('SMS 스캔 시작'); print('SMS 스캔 시작');
final scannedSubscriptionModels = await _smsScanner.scanForSubscriptions(); final scannedSubscriptionModels =
await _smsScanner.scanForSubscriptions();
print('스캔된 구독: ${scannedSubscriptionModels.length}'); print('스캔된 구독: ${scannedSubscriptionModels.length}');
if (scannedSubscriptionModels.isNotEmpty) { if (scannedSubscriptionModels.isNotEmpty) {
print('첫 번째 구독: ${scannedSubscriptionModels[0].serviceName}, 반복 횟수: ${scannedSubscriptionModels[0].repeatCount}'); print(
'첫 번째 구독: ${scannedSubscriptionModels[0].serviceName}, 반복 횟수: ${scannedSubscriptionModels[0].repeatCount}');
} }
if (!context.mounted) return; if (!context.mounted) return;
@@ -77,14 +79,17 @@ class SmsScanController extends ChangeNotifier {
} }
// SubscriptionModel을 Subscription으로 변환 // SubscriptionModel을 Subscription으로 변환
final scannedSubscriptions = _converter.convertModelsToSubscriptions(scannedSubscriptionModels); final scannedSubscriptions =
_converter.convertModelsToSubscriptions(scannedSubscriptionModels);
// 2회 이상 반복 결제된 구독만 필터링 // 2회 이상 반복 결제된 구독만 필터링
final repeatSubscriptions = _filter.filterByRepeatCount(scannedSubscriptions, 2); final repeatSubscriptions =
_filter.filterByRepeatCount(scannedSubscriptions, 2);
print('반복 결제된 구독: ${repeatSubscriptions.length}'); print('반복 결제된 구독: ${repeatSubscriptions.length}');
if (repeatSubscriptions.isNotEmpty) { if (repeatSubscriptions.isNotEmpty) {
print('첫 번째 반복 구독: ${repeatSubscriptions[0].serviceName}, 반복 횟수: ${repeatSubscriptions[0].repeatCount}'); print(
'첫 번째 반복 구독: ${repeatSubscriptions[0].serviceName}, 반복 횟수: ${repeatSubscriptions[0].repeatCount}');
} }
if (repeatSubscriptions.isEmpty) { if (repeatSubscriptions.isEmpty) {
@@ -96,16 +101,19 @@ class SmsScanController extends ChangeNotifier {
} }
// 구독 목록 가져오기 // 구독 목록 가져오기
final provider = Provider.of<SubscriptionProvider>(context, listen: false); final provider =
Provider.of<SubscriptionProvider>(context, listen: false);
final existingSubscriptions = provider.subscriptions; final existingSubscriptions = provider.subscriptions;
print('기존 구독: ${existingSubscriptions.length}'); print('기존 구독: ${existingSubscriptions.length}');
// 중복 구독 필터링 // 중복 구독 필터링
final filteredSubscriptions = _filter.filterDuplicates(repeatSubscriptions, existingSubscriptions); final filteredSubscriptions =
_filter.filterDuplicates(repeatSubscriptions, existingSubscriptions);
print('중복 제거 후 구독: ${filteredSubscriptions.length}'); print('중복 제거 후 구독: ${filteredSubscriptions.length}');
if (filteredSubscriptions.isNotEmpty) { if (filteredSubscriptions.isNotEmpty) {
print('첫 번째 필터링된 구독: ${filteredSubscriptions[0].serviceName}, 반복 횟수: ${filteredSubscriptions[0].repeatCount}'); print(
'첫 번째 필터링된 구독: ${filteredSubscriptions[0].serviceName}, 반복 횟수: ${filteredSubscriptions[0].repeatCount}');
} }
// 중복 제거 후 신규 구독이 없는 경우 // 중복 제거 후 신규 구독이 없는 경우
@@ -123,7 +131,8 @@ class SmsScanController extends ChangeNotifier {
} catch (e) { } catch (e) {
print('SMS 스캔 중 오류 발생: $e'); print('SMS 스캔 중 오류 발생: $e');
if (context.mounted) { if (context.mounted) {
_errorMessage = AppLocalizations.of(context).smsScanErrorWithMessage(e.toString()); _errorMessage =
AppLocalizations.of(context).smsScanErrorWithMessage(e.toString());
_isLoading = false; _isLoading = false;
notifyListeners(); notifyListeners();
} }
@@ -136,17 +145,22 @@ class SmsScanController extends ChangeNotifier {
final subscription = _scannedSubscriptions[_currentIndex]; final subscription = _scannedSubscriptions[_currentIndex];
try { try {
final provider = Provider.of<SubscriptionProvider>(context, listen: false); final provider =
final categoryProvider = Provider.of<CategoryProvider>(context, listen: false); Provider.of<SubscriptionProvider>(context, listen: false);
final categoryProvider =
Provider.of<CategoryProvider>(context, listen: false);
final finalCategoryId = _selectedCategoryId ?? subscription.category ?? getDefaultCategoryId(categoryProvider); final finalCategoryId = _selectedCategoryId ??
subscription.category ??
getDefaultCategoryId(categoryProvider);
// websiteUrl 처리 // websiteUrl 처리
final websiteUrl = websiteUrlController.text.trim().isNotEmpty final websiteUrl = websiteUrlController.text.trim().isNotEmpty
? websiteUrlController.text.trim() ? websiteUrlController.text.trim()
: subscription.websiteUrl; : subscription.websiteUrl;
print('구독 추가 시도: ${subscription.serviceName}, 카테고리: $finalCategoryId, URL: $websiteUrl'); print(
'구독 추가 시도: ${subscription.serviceName}, 카테고리: $finalCategoryId, URL: $websiteUrl');
// addSubscription 호출 // addSubscription 호출
await provider.addSubscription( await provider.addSubscription(
@@ -193,7 +207,8 @@ class SmsScanController extends ChangeNotifier {
void navigateToHome(BuildContext context) { void navigateToHome(BuildContext context) {
// NavigationProvider를 사용하여 홈 화면으로 이동 // NavigationProvider를 사용하여 홈 화면으로 이동
final navigationProvider = Provider.of<NavigationProvider>(context, listen: false); final navigationProvider =
Provider.of<NavigationProvider>(context, listen: false);
navigationProvider.updateCurrentIndex(0); navigationProvider.updateCurrentIndex(0);
} }

View File

@@ -14,22 +14,21 @@ class AppLocalizations {
// JSON 파일에서 번역 데이터 로드 // JSON 파일에서 번역 데이터 로드
Future<void> load() async { Future<void> load() async {
String jsonString = String jsonString = await rootBundle.loadString('assets/data/text.json');
await rootBundle.loadString('assets/data/text.json');
Map<String, dynamic> jsonMap = json.decode(jsonString); Map<String, dynamic> jsonMap = json.decode(jsonString);
_localizedStrings = jsonMap[locale.languageCode]; _localizedStrings = jsonMap[locale.languageCode];
} }
String get appTitle => _localizedStrings['appTitle'] ?? 'SubManager'; String get appTitle => _localizedStrings['appTitle'] ?? 'SubManager';
String get appSubtitle => _localizedStrings['appSubtitle'] ?? 'Manage subscriptions easily'; String get appSubtitle =>
_localizedStrings['appSubtitle'] ?? 'Manage subscriptions easily';
String get subscriptionManagement => String get subscriptionManagement =>
_localizedStrings['subscriptionManagement'] ?? 'Subscription Management'; _localizedStrings['subscriptionManagement'] ?? 'Subscription Management';
String get addSubscription => String get addSubscription =>
_localizedStrings['addSubscription'] ?? 'Add Subscription'; _localizedStrings['addSubscription'] ?? 'Add Subscription';
String get subscriptionName => String get subscriptionName =>
_localizedStrings['subscriptionName'] ?? 'Service Name'; _localizedStrings['subscriptionName'] ?? 'Service Name';
String get monthlyCost => String get monthlyCost => _localizedStrings['monthlyCost'] ?? 'Monthly Cost';
_localizedStrings['monthlyCost'] ?? 'Monthly Cost';
String get billingCycle => String get billingCycle =>
_localizedStrings['billingCycle'] ?? 'Billing Cycle'; _localizedStrings['billingCycle'] ?? 'Billing Cycle';
String get nextBillingDate => String get nextBillingDate =>
@@ -55,12 +54,9 @@ class AppLocalizations {
_localizedStrings['categoryManagement'] ?? 'Category Management'; _localizedStrings['categoryManagement'] ?? 'Category Management';
String get categoryName => String get categoryName =>
_localizedStrings['categoryName'] ?? 'Category Name'; _localizedStrings['categoryName'] ?? 'Category Name';
String get selectColor => String get selectColor => _localizedStrings['selectColor'] ?? 'Select Color';
_localizedStrings['selectColor'] ?? 'Select Color'; String get selectIcon => _localizedStrings['selectIcon'] ?? 'Select Icon';
String get selectIcon => String get addCategory => _localizedStrings['addCategory'] ?? 'Add Category';
_localizedStrings['selectIcon'] ?? 'Select Icon';
String get addCategory =>
_localizedStrings['addCategory'] ?? 'Add Category';
String get settings => _localizedStrings['settings'] ?? 'Settings'; String get settings => _localizedStrings['settings'] ?? 'Settings';
String get darkMode => _localizedStrings['darkMode'] ?? 'Dark Mode'; String get darkMode => _localizedStrings['darkMode'] ?? 'Dark Mode';
String get language => _localizedStrings['language'] ?? 'Language'; String get language => _localizedStrings['language'] ?? 'Language';
@@ -71,13 +67,15 @@ class AppLocalizations {
String get notificationPermission => String get notificationPermission =>
_localizedStrings['notificationPermission'] ?? 'Notification Permission'; _localizedStrings['notificationPermission'] ?? 'Notification Permission';
String get notificationPermissionDesc => String get notificationPermissionDesc =>
_localizedStrings['notificationPermissionDesc'] ?? 'Permission is required to receive notifications'; _localizedStrings['notificationPermissionDesc'] ??
'Permission is required to receive notifications';
String get requestPermission => String get requestPermission =>
_localizedStrings['requestPermission'] ?? 'Request Permission'; _localizedStrings['requestPermission'] ?? 'Request Permission';
String get paymentNotification => String get paymentNotification =>
_localizedStrings['paymentNotification'] ?? 'Payment Due Notification'; _localizedStrings['paymentNotification'] ?? 'Payment Due Notification';
String get paymentNotificationDesc => String get paymentNotificationDesc =>
_localizedStrings['paymentNotificationDesc'] ?? 'Receive notification on payment due date'; _localizedStrings['paymentNotificationDesc'] ??
'Receive notification on payment due date';
String get notificationTiming => String get notificationTiming =>
_localizedStrings['notificationTiming'] ?? 'Notification Timing'; _localizedStrings['notificationTiming'] ?? 'Notification Timing';
String get notificationTime => String get notificationTime =>
@@ -85,11 +83,14 @@ class AppLocalizations {
String get dailyReminder => String get dailyReminder =>
_localizedStrings['dailyReminder'] ?? 'Daily Reminder'; _localizedStrings['dailyReminder'] ?? 'Daily Reminder';
String get dailyReminderEnabled => String get dailyReminderEnabled =>
_localizedStrings['dailyReminderEnabled'] ?? 'Receive daily notifications until payment date'; _localizedStrings['dailyReminderEnabled'] ??
'Receive daily notifications until payment date';
String get dailyReminderDisabled => String get dailyReminderDisabled =>
_localizedStrings['dailyReminderDisabled'] ?? 'Receive notification @ day(s) before payment'; _localizedStrings['dailyReminderDisabled'] ??
'Receive notification @ day(s) before payment';
String get notificationPermissionDenied => String get notificationPermissionDenied =>
_localizedStrings['notificationPermissionDenied'] ?? 'Notification permission denied'; _localizedStrings['notificationPermissionDenied'] ??
'Notification permission denied';
// 앱 정보 // 앱 정보
String get appInfo => _localizedStrings['appInfo'] ?? 'App Info'; String get appInfo => _localizedStrings['appInfo'] ?? 'App Info';
String get version => _localizedStrings['version'] ?? 'Version'; String get version => _localizedStrings['version'] ?? 'Version';
@@ -102,7 +103,8 @@ class AppLocalizations {
String get lightTheme => _localizedStrings['lightTheme'] ?? 'Light'; String get lightTheme => _localizedStrings['lightTheme'] ?? 'Light';
String get darkTheme => _localizedStrings['darkTheme'] ?? 'Dark'; String get darkTheme => _localizedStrings['darkTheme'] ?? 'Dark';
String get oledTheme => _localizedStrings['oledTheme'] ?? 'OLED Black'; String get oledTheme => _localizedStrings['oledTheme'] ?? 'OLED Black';
String get systemTheme => _localizedStrings['systemTheme'] ?? 'System Default'; String get systemTheme =>
_localizedStrings['systemTheme'] ?? 'System Default';
// 기타 메시지 // 기타 메시지
String get subscriptionAdded => String get subscriptionAdded =>
_localizedStrings['subscriptionAdded'] ?? 'Subscription added'; _localizedStrings['subscriptionAdded'] ?? 'Subscription added';
@@ -112,72 +114,133 @@ class AppLocalizations {
String get japanese => _localizedStrings['japanese'] ?? '日本語'; String get japanese => _localizedStrings['japanese'] ?? '日本語';
String get chinese => _localizedStrings['chinese'] ?? '中文'; String get chinese => _localizedStrings['chinese'] ?? '中文';
// 날짜 // 날짜
String get oneDayBefore => _localizedStrings['oneDayBefore'] ?? '1 day before'; String get oneDayBefore =>
String get twoDaysBefore => _localizedStrings['twoDaysBefore'] ?? '2 days before'; _localizedStrings['oneDayBefore'] ?? '1 day before';
String get threeDaysBefore => _localizedStrings['threeDaysBefore'] ?? '3 days before'; String get twoDaysBefore =>
_localizedStrings['twoDaysBefore'] ?? '2 days before';
String get threeDaysBefore =>
_localizedStrings['threeDaysBefore'] ?? '3 days before';
// 추가 메시지 // 추가 메시지
String get requiredFieldsError => _localizedStrings['requiredFieldsError'] ?? 'Please fill in all required fields'; String get requiredFieldsError =>
String get subscriptionUpdated => _localizedStrings['subscriptionUpdated'] ?? 'Subscription information has been updated'; _localizedStrings['requiredFieldsError'] ??
String get officialCancelPageNotFound => _localizedStrings['officialCancelPageNotFound'] ?? 'Official cancellation page not found. Redirecting to Google search.'; 'Please fill in all required fields';
String get cannotOpenWebsite => _localizedStrings['cannotOpenWebsite'] ?? 'Cannot open website'; String get subscriptionUpdated =>
String get noWebsiteInfo => _localizedStrings['noWebsiteInfo'] ?? 'No website information available. Please cancel through the website.'; _localizedStrings['subscriptionUpdated'] ??
'Subscription information has been updated';
String get officialCancelPageNotFound =>
_localizedStrings['officialCancelPageNotFound'] ??
'Official cancellation page not found. Redirecting to Google search.';
String get cannotOpenWebsite =>
_localizedStrings['cannotOpenWebsite'] ?? 'Cannot open website';
String get noWebsiteInfo =>
_localizedStrings['noWebsiteInfo'] ??
'No website information available. Please cancel through the website.';
String get editMode => _localizedStrings['editMode'] ?? 'Edit Mode'; String get editMode => _localizedStrings['editMode'] ?? 'Edit Mode';
String get changesAppliedAfterSave => _localizedStrings['changesAppliedAfterSave'] ?? 'Changes will be applied after saving'; String get changesAppliedAfterSave =>
_localizedStrings['changesAppliedAfterSave'] ??
'Changes will be applied after saving';
String get saveChanges => _localizedStrings['saveChanges'] ?? 'Save Changes'; String get saveChanges => _localizedStrings['saveChanges'] ?? 'Save Changes';
String get monthlyExpense => _localizedStrings['monthlyExpense'] ?? 'Monthly Expense'; String get monthlyExpense =>
_localizedStrings['monthlyExpense'] ?? 'Monthly Expense';
String get websiteUrl => _localizedStrings['websiteUrl'] ?? 'Website URL'; String get websiteUrl => _localizedStrings['websiteUrl'] ?? 'Website URL';
String get websiteUrlOptional => _localizedStrings['websiteUrlOptional'] ?? 'Website URL (Optional)'; String get websiteUrlOptional =>
_localizedStrings['websiteUrlOptional'] ?? 'Website URL (Optional)';
String get eventPrice => _localizedStrings['eventPrice'] ?? 'Event Price'; String get eventPrice => _localizedStrings['eventPrice'] ?? 'Event Price';
String get eventPriceHint => _localizedStrings['eventPriceHint'] ?? 'Enter discounted price'; String get eventPriceHint =>
String get eventPriceRequired => _localizedStrings['eventPriceRequired'] ?? 'Please enter event price'; _localizedStrings['eventPriceHint'] ?? 'Enter discounted price';
String get invalidPrice => _localizedStrings['invalidPrice'] ?? 'Please enter a valid price'; String get eventPriceRequired =>
_localizedStrings['eventPriceRequired'] ?? 'Please enter event price';
String get invalidPrice =>
_localizedStrings['invalidPrice'] ?? 'Please enter a valid price';
String get smsScanLabel => _localizedStrings['smsScanLabel'] ?? 'SMS'; String get smsScanLabel => _localizedStrings['smsScanLabel'] ?? 'SMS';
String get home => _localizedStrings['home'] ?? 'Home'; String get home => _localizedStrings['home'] ?? 'Home';
String get analysis => _localizedStrings['analysis'] ?? 'Analysis'; String get analysis => _localizedStrings['analysis'] ?? 'Analysis';
String get back => _localizedStrings['back'] ?? 'Back'; String get back => _localizedStrings['back'] ?? 'Back';
String get exitApp => _localizedStrings['exitApp'] ?? 'Exit App'; String get exitApp => _localizedStrings['exitApp'] ?? 'Exit App';
String get exitAppConfirm => _localizedStrings['exitAppConfirm'] ?? 'Are you sure you want to exit SubManager?'; String get exitAppConfirm =>
_localizedStrings['exitAppConfirm'] ??
'Are you sure you want to exit SubManager?';
String get exit => _localizedStrings['exit'] ?? 'Exit'; String get exit => _localizedStrings['exit'] ?? 'Exit';
String get pageNotFound => _localizedStrings['pageNotFound'] ?? 'Page not found'; String get pageNotFound =>
String get serviceNameExample => _localizedStrings['serviceNameExample'] ?? 'e.g. Netflix, Spotify'; _localizedStrings['pageNotFound'] ?? 'Page not found';
String get urlExample => _localizedStrings['urlExample'] ?? 'https://example.com'; String get serviceNameExample =>
String get appLockDesc => _localizedStrings['appLockDesc'] ?? 'App lock with biometric authentication'; _localizedStrings['serviceNameExample'] ?? 'e.g. Netflix, Spotify';
String get unlockWithBiometric => _localizedStrings['unlockWithBiometric'] ?? 'Unlock with biometric authentication'; String get urlExample =>
String get authenticationFailed => _localizedStrings['authenticationFailed'] ?? 'Authentication failed. Please try again.'; _localizedStrings['urlExample'] ?? 'https://example.com';
String get smsPermissionRequired => _localizedStrings['smsPermissionRequired'] ?? 'SMS permission required'; String get appLockDesc =>
String get noSubscriptionSmsFound => _localizedStrings['noSubscriptionSmsFound'] ?? 'No subscription related SMS found'; _localizedStrings['appLockDesc'] ??
String get smsScanError => _localizedStrings['smsScanError'] ?? 'Error occurred during SMS scan'; 'App lock with biometric authentication';
String get saveError => _localizedStrings['saveError'] ?? 'Error occurred while saving'; String get unlockWithBiometric =>
String get newSubscriptionSmsNotFound => _localizedStrings['newSubscriptionSmsNotFound'] ?? 'No new subscription SMS found'; _localizedStrings['unlockWithBiometric'] ??
String get subscriptionAddError => _localizedStrings['subscriptionAddError'] ?? 'Error adding subscription'; 'Unlock with biometric authentication';
String get allSubscriptionsProcessed => _localizedStrings['allSubscriptionsProcessed'] ?? 'All subscriptions have been processed.'; String get authenticationFailed =>
String get websiteUrlExtracted => _localizedStrings['websiteUrlExtracted'] ?? 'Website URL (Auto-extracted)'; _localizedStrings['authenticationFailed'] ??
'Authentication failed. Please try again.';
String get smsPermissionRequired =>
_localizedStrings['smsPermissionRequired'] ?? 'SMS permission required';
String get noSubscriptionSmsFound =>
_localizedStrings['noSubscriptionSmsFound'] ??
'No subscription related SMS found';
String get smsScanError =>
_localizedStrings['smsScanError'] ?? 'Error occurred during SMS scan';
String get saveError =>
_localizedStrings['saveError'] ?? 'Error occurred while saving';
String get newSubscriptionSmsNotFound =>
_localizedStrings['newSubscriptionSmsNotFound'] ??
'No new subscription SMS found';
String get subscriptionAddError =>
_localizedStrings['subscriptionAddError'] ?? 'Error adding subscription';
String get allSubscriptionsProcessed =>
_localizedStrings['allSubscriptionsProcessed'] ??
'All subscriptions have been processed.';
String get websiteUrlExtracted =>
_localizedStrings['websiteUrlExtracted'] ??
'Website URL (Auto-extracted)';
String get startDate => _localizedStrings['startDate'] ?? 'Start Date'; String get startDate => _localizedStrings['startDate'] ?? 'Start Date';
String get endDate => _localizedStrings['endDate'] ?? 'End Date'; String get endDate => _localizedStrings['endDate'] ?? 'End Date';
// 새로 추가된 항목들 // 새로 추가된 항목들
String get monthlyTotalSubscriptionCost => _localizedStrings['monthlyTotalSubscriptionCost'] ?? 'Total Monthly Subscription Cost'; String get monthlyTotalSubscriptionCost =>
String get todaysExchangeRate => _localizedStrings['todaysExchangeRate'] ?? 'Today\'s Exchange Rate'; _localizedStrings['monthlyTotalSubscriptionCost'] ??
'Total Monthly Subscription Cost';
String get todaysExchangeRate =>
_localizedStrings['todaysExchangeRate'] ?? 'Today\'s Exchange Rate';
String get won => _localizedStrings['won'] ?? 'KRW'; String get won => _localizedStrings['won'] ?? 'KRW';
String get estimatedAnnualCost => _localizedStrings['estimatedAnnualCost'] ?? 'Estimated Annual Cost'; String get estimatedAnnualCost =>
String get totalSubscriptionServices => _localizedStrings['totalSubscriptionServices'] ?? 'Total Subscription Services'; _localizedStrings['estimatedAnnualCost'] ?? 'Estimated Annual Cost';
String get totalSubscriptionServices =>
_localizedStrings['totalSubscriptionServices'] ??
'Total Subscription Services';
String get services => _localizedStrings['services'] ?? 'services'; String get services => _localizedStrings['services'] ?? 'services';
String get eventDiscountActive => _localizedStrings['eventDiscountActive'] ?? 'Event Discount Active'; String get eventDiscountActive =>
_localizedStrings['eventDiscountActive'] ?? 'Event Discount Active';
String get saving => _localizedStrings['saving'] ?? 'Saving'; String get saving => _localizedStrings['saving'] ?? 'Saving';
String get paymentDueToday => _localizedStrings['paymentDueToday'] ?? 'Payment Due Today'; String get paymentDueToday =>
String get paymentInfoNeeded => _localizedStrings['paymentInfoNeeded'] ?? 'Payment Info Needed'; _localizedStrings['paymentDueToday'] ?? 'Payment Due Today';
String get paymentInfoNeeded =>
_localizedStrings['paymentInfoNeeded'] ?? 'Payment Info Needed';
String get event => _localizedStrings['event'] ?? 'Event'; String get event => _localizedStrings['event'] ?? 'Event';
// 카테고리 getter들 // 카테고리 getter들
String get categoryMusic => _localizedStrings['categoryMusic'] ?? 'Music'; String get categoryMusic => _localizedStrings['categoryMusic'] ?? 'Music';
String get categoryOttVideo => _localizedStrings['categoryOttVideo'] ?? 'OTT(Video)'; String get categoryOttVideo =>
String get categoryStorageCloud => _localizedStrings['categoryStorageCloud'] ?? 'Storage/Cloud'; _localizedStrings['categoryOttVideo'] ?? 'OTT(Video)';
String get categoryTelecomInternetTv => _localizedStrings['categoryTelecomInternetTv'] ?? 'Telecom · Internet · TV'; String get categoryStorageCloud =>
String get categoryLifestyle => _localizedStrings['categoryLifestyle'] ?? 'Lifestyle'; _localizedStrings['categoryStorageCloud'] ?? 'Storage/Cloud';
String get categoryShoppingEcommerce => _localizedStrings['categoryShoppingEcommerce'] ?? 'Shopping/E-commerce'; String get categoryTelecomInternetTv =>
String get categoryProgramming => _localizedStrings['categoryProgramming'] ?? 'Programming'; _localizedStrings['categoryTelecomInternetTv'] ??
String get categoryCollaborationOffice => _localizedStrings['categoryCollaborationOffice'] ?? 'Collaboration/Office'; 'Telecom · Internet · TV';
String get categoryAiService => _localizedStrings['categoryAiService'] ?? 'AI Service'; String get categoryLifestyle =>
_localizedStrings['categoryLifestyle'] ?? 'Lifestyle';
String get categoryShoppingEcommerce =>
_localizedStrings['categoryShoppingEcommerce'] ?? 'Shopping/E-commerce';
String get categoryProgramming =>
_localizedStrings['categoryProgramming'] ?? 'Programming';
String get categoryCollaborationOffice =>
_localizedStrings['categoryCollaborationOffice'] ??
'Collaboration/Office';
String get categoryAiService =>
_localizedStrings['categoryAiService'] ?? 'AI Service';
String get categoryOther => _localizedStrings['categoryOther'] ?? 'Other'; String get categoryOther => _localizedStrings['categoryOther'] ?? 'Other';
// 동적 메시지 생성 메서드 // 동적 메시지 생성 메서드
@@ -186,52 +249,62 @@ class AppLocalizations {
} }
String dailyReminderDisabledWithDays(int days) { String dailyReminderDisabledWithDays(int days) {
final template = _localizedStrings['dailyReminderDisabled'] ?? 'Receive notification @ day(s) before payment'; final template = _localizedStrings['dailyReminderDisabled'] ??
'Receive notification @ day(s) before payment';
return template.replaceAll('@', days.toString()); return template.replaceAll('@', days.toString());
} }
String subscriptionAddedWithName(String serviceName) { String subscriptionAddedWithName(String serviceName) {
final template = _localizedStrings['subscriptionAddedTemplate'] ?? '@ 구독이 추가되었습니다.'; final template =
_localizedStrings['subscriptionAddedTemplate'] ?? '@ 구독이 추가되었습니다.';
return template.replaceAll('@', serviceName); return template.replaceAll('@', serviceName);
} }
String subscriptionDeleted(String serviceName) { String subscriptionDeleted(String serviceName) {
final template = _localizedStrings['subscriptionDeleted'] ?? '@ subscription has been deleted'; final template = _localizedStrings['subscriptionDeleted'] ??
'@ subscription has been deleted';
return template.replaceAll('@', serviceName); return template.replaceAll('@', serviceName);
} }
String totalExpenseCopied(String amount) { String totalExpenseCopied(String amount) {
final template = _localizedStrings['totalExpenseCopied'] ?? 'Total expense copied: @'; final template =
_localizedStrings['totalExpenseCopied'] ?? 'Total expense copied: @';
return template.replaceAll('@', amount); return template.replaceAll('@', amount);
} }
String serviceRecognized(String serviceName) { String serviceRecognized(String serviceName) {
final template = _localizedStrings['serviceRecognized'] ?? '@ service has been recognized automatically.'; final template = _localizedStrings['serviceRecognized'] ??
'@ service has been recognized automatically.';
return template.replaceAll('@', serviceName); return template.replaceAll('@', serviceName);
} }
String smsScanErrorWithMessage(String error) { String smsScanErrorWithMessage(String error) {
final template = _localizedStrings['smsScanError'] ?? 'Error occurred during SMS scan: @'; final template = _localizedStrings['smsScanError'] ??
'Error occurred during SMS scan: @';
return template.replaceAll('@', error); return template.replaceAll('@', error);
} }
String saveErrorWithMessage(String error) { String saveErrorWithMessage(String error) {
final template = _localizedStrings['saveError'] ?? 'Error occurred while saving: @'; final template =
_localizedStrings['saveError'] ?? 'Error occurred while saving: @';
return template.replaceAll('@', error); return template.replaceAll('@', error);
} }
String subscriptionAddErrorWithMessage(String error) { String subscriptionAddErrorWithMessage(String error) {
final template = _localizedStrings['subscriptionAddError'] ?? 'Error adding subscription: @'; final template = _localizedStrings['subscriptionAddError'] ??
'Error adding subscription: @';
return template.replaceAll('@', error); return template.replaceAll('@', error);
} }
String subscriptionSkipped(String serviceName) { String subscriptionSkipped(String serviceName) {
final template = _localizedStrings['subscriptionSkipped'] ?? '@ subscription skipped.'; final template =
_localizedStrings['subscriptionSkipped'] ?? '@ subscription skipped.';
return template.replaceAll('@', serviceName); return template.replaceAll('@', serviceName);
} }
// 홈화면 관련 // 홈화면 관련
String get mySubscriptions => _localizedStrings['mySubscriptions'] ?? 'My Subscriptions'; String get mySubscriptions =>
_localizedStrings['mySubscriptions'] ?? 'My Subscriptions';
String subscriptionCount(int count) { String subscriptionCount(int count) {
if (locale.languageCode == 'ko') { if (locale.languageCode == 'ko') {
@@ -246,55 +319,96 @@ class AppLocalizations {
} }
// 분석화면 관련 // 분석화면 관련
String get monthlyExpenseTitle => _localizedStrings['monthlyExpenseTitle'] ?? 'Monthly Expense Status'; String get monthlyExpenseTitle =>
String get recentSixMonthsTrend => _localizedStrings['recentSixMonthsTrend'] ?? 'Recent 6 months trend'; _localizedStrings['monthlyExpenseTitle'] ?? 'Monthly Expense Status';
String get monthlySubscriptionExpense => _localizedStrings['monthlySubscriptionExpense'] ?? 'Monthly subscription expense'; String get recentSixMonthsTrend =>
String get subscriptionServiceRatio => _localizedStrings['subscriptionServiceRatio'] ?? 'Subscription Service Ratio'; _localizedStrings['recentSixMonthsTrend'] ?? 'Recent 6 months trend';
String get monthlyExpenseBasis => _localizedStrings['monthlyExpenseBasis'] ?? 'Based on monthly expense'; String get monthlySubscriptionExpense =>
String get noSubscriptionServices => _localizedStrings['noSubscriptionServices'] ?? 'No subscription services'; _localizedStrings['monthlySubscriptionExpense'] ??
String get totalExpenseSummary => _localizedStrings['totalExpenseSummary'] ?? 'Total Expense Summary'; 'Monthly subscription expense';
String get monthlyTotalAmount => _localizedStrings['monthlyTotalAmount'] ?? 'Monthly Total Amount'; String get subscriptionServiceRatio =>
String get totalExpense => _localizedStrings['totalExpense'] ?? 'Total Expense'; _localizedStrings['subscriptionServiceRatio'] ??
String get totalServices => _localizedStrings['totalServices'] ?? 'Total Services'; 'Subscription Service Ratio';
String get monthlyExpenseBasis =>
_localizedStrings['monthlyExpenseBasis'] ?? 'Based on monthly expense';
String get noSubscriptionServices =>
_localizedStrings['noSubscriptionServices'] ?? 'No subscription services';
String get totalExpenseSummary =>
_localizedStrings['totalExpenseSummary'] ?? 'Total Expense Summary';
String get monthlyTotalAmount =>
_localizedStrings['monthlyTotalAmount'] ?? 'Monthly Total Amount';
String get totalExpense =>
_localizedStrings['totalExpense'] ?? 'Total Expense';
String get totalServices =>
_localizedStrings['totalServices'] ?? 'Total Services';
String get servicesUnit => _localizedStrings['servicesUnit'] ?? 'services'; String get servicesUnit => _localizedStrings['servicesUnit'] ?? 'services';
String get averageCost => _localizedStrings['averageCost'] ?? 'Average Cost'; String get averageCost => _localizedStrings['averageCost'] ?? 'Average Cost';
String get eventDiscountStatus => _localizedStrings['eventDiscountStatus'] ?? 'Event Discount Status'; String get eventDiscountStatus =>
String get inProgressUnit => _localizedStrings['inProgressUnit'] ?? 'in progress'; _localizedStrings['eventDiscountStatus'] ?? 'Event Discount Status';
String get monthlySavingAmount => _localizedStrings['monthlySavingAmount'] ?? 'Monthly Saving Amount'; String get inProgressUnit =>
String get eventsInProgress => _localizedStrings['eventsInProgress'] ?? 'Events in Progress'; _localizedStrings['inProgressUnit'] ?? 'in progress';
String get discountPercent => _localizedStrings['discountPercent'] ?? '% discount'; String get monthlySavingAmount =>
_localizedStrings['monthlySavingAmount'] ?? 'Monthly Saving Amount';
String get eventsInProgress =>
_localizedStrings['eventsInProgress'] ?? 'Events in Progress';
String get discountPercent =>
_localizedStrings['discountPercent'] ?? '% discount';
String get currencyWon => _localizedStrings['currencyWon'] ?? 'KRW'; String get currencyWon => _localizedStrings['currencyWon'] ?? 'KRW';
// SMS 스캔 관련 // SMS 스캔 관련
String get scanningMessages => _localizedStrings['scanningMessages'] ?? 'Scanning SMS messages...'; String get scanningMessages =>
String get findingSubscriptions => _localizedStrings['findingSubscriptions'] ?? 'Finding subscription services'; _localizedStrings['scanningMessages'] ?? 'Scanning SMS messages...';
String get subscriptionNotFound => _localizedStrings['subscriptionNotFound'] ?? 'Subscription information not found.'; String get findingSubscriptions =>
String get repeatSubscriptionNotFound => _localizedStrings['repeatSubscriptionNotFound'] ?? 'No repeated subscription information found.'; _localizedStrings['findingSubscriptions'] ??
String get newSubscriptionNotFound => _localizedStrings['newSubscriptionNotFound'] ?? 'No new subscription SMS found'; 'Finding subscription services';
String get findRepeatSubscriptions => _localizedStrings['findRepeatSubscriptions'] ?? 'Find subscriptions paid 2+ times'; String get subscriptionNotFound =>
String get scanTextMessages => _localizedStrings['scanTextMessages'] ?? 'Scan text messages to automatically find repeatedly paid subscriptions. Service names and amounts can be extracted for easy subscription addition.'; _localizedStrings['subscriptionNotFound'] ??
String get startScanning => _localizedStrings['startScanning'] ?? 'Start Scanning'; 'Subscription information not found.';
String get foundSubscription => _localizedStrings['foundSubscription'] ?? 'Found subscription'; String get repeatSubscriptionNotFound =>
_localizedStrings['repeatSubscriptionNotFound'] ??
'No repeated subscription information found.';
String get newSubscriptionNotFound =>
_localizedStrings['newSubscriptionNotFound'] ??
'No new subscription SMS found';
String get findRepeatSubscriptions =>
_localizedStrings['findRepeatSubscriptions'] ??
'Find subscriptions paid 2+ times';
String get scanTextMessages =>
_localizedStrings['scanTextMessages'] ??
'Scan text messages to automatically find repeatedly paid subscriptions. Service names and amounts can be extracted for easy subscription addition.';
String get startScanning =>
_localizedStrings['startScanning'] ?? 'Start Scanning';
String get foundSubscription =>
_localizedStrings['foundSubscription'] ?? 'Found subscription';
String get serviceName => _localizedStrings['serviceName'] ?? 'Service Name'; String get serviceName => _localizedStrings['serviceName'] ?? 'Service Name';
String get nextBillingDateLabel => _localizedStrings['nextBillingDateLabel'] ?? 'Next Billing Date'; String get nextBillingDateLabel =>
_localizedStrings['nextBillingDateLabel'] ?? 'Next Billing Date';
String get category => _localizedStrings['category'] ?? 'Category'; String get category => _localizedStrings['category'] ?? 'Category';
String get websiteUrlAuto => _localizedStrings['websiteUrlAuto'] ?? 'Website URL (Auto-extracted)'; String get websiteUrlAuto =>
String get websiteUrlHint => _localizedStrings['websiteUrlHint'] ?? 'Edit website URL or leave empty'; _localizedStrings['websiteUrlAuto'] ?? 'Website URL (Auto-extracted)';
String get websiteUrlHint =>
_localizedStrings['websiteUrlHint'] ?? 'Edit website URL or leave empty';
String get skip => _localizedStrings['skip'] ?? 'Skip'; String get skip => _localizedStrings['skip'] ?? 'Skip';
String get add => _localizedStrings['add'] ?? 'Add'; String get add => _localizedStrings['add'] ?? 'Add';
String get nextBillingDateRequired => _localizedStrings['nextBillingDateRequired'] ?? 'Next billing date verification required'; String get nextBillingDateRequired =>
_localizedStrings['nextBillingDateRequired'] ??
'Next billing date verification required';
String nextBillingDateEstimated(String date, int days) { String nextBillingDateEstimated(String date, int days) {
final template = _localizedStrings['nextBillingDateEstimated'] ?? 'Next estimated billing date: @ (# days later)'; final template = _localizedStrings['nextBillingDateEstimated'] ??
'Next estimated billing date: @ (# days later)';
return template.replaceAll('@', date).replaceAll('#', days.toString()); return template.replaceAll('@', date).replaceAll('#', days.toString());
} }
String nextBillingDateInfo(String date, int days) { String nextBillingDateInfo(String date, int days) {
final template = _localizedStrings['nextBillingDateInfo'] ?? 'Next billing date: @ (# days later)'; final template = _localizedStrings['nextBillingDateInfo'] ??
'Next billing date: @ (# days later)';
return template.replaceAll('@', date).replaceAll('#', days.toString()); return template.replaceAll('@', date).replaceAll('#', days.toString());
} }
String get nextBillingDatePastRequired => _localizedStrings['nextBillingDatePastRequired'] ?? 'Next billing date verification required (past date)'; String get nextBillingDatePastRequired =>
_localizedStrings['nextBillingDatePastRequired'] ??
'Next billing date verification required (past date)';
String formatDate(DateTime date) { String formatDate(DateTime date) {
if (locale.languageCode == 'ko') { if (locale.languageCode == 'ko') {
@@ -304,13 +418,27 @@ class AppLocalizations {
} else if (locale.languageCode == 'zh') { } else if (locale.languageCode == 'zh') {
return '${date.year}${date.month}${date.day}'; return '${date.year}${date.month}${date.day}';
} else { } else {
final months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; final months = [
'Jan',
'Feb',
'Mar',
'Apr',
'May',
'Jun',
'Jul',
'Aug',
'Sep',
'Oct',
'Nov',
'Dec'
];
return '${months[date.month - 1]} ${date.day}, ${date.year}'; return '${months[date.month - 1]} ${date.day}, ${date.year}';
} }
} }
String repeatCountDetected(int count) { String repeatCountDetected(int count) {
final template = _localizedStrings['repeatCountDetected'] ?? '@ payment(s) detected'; final template =
_localizedStrings['repeatCountDetected'] ?? '@ payment(s) detected';
return template.replaceAll('@', count.toString()); return template.replaceAll('@', count.toString());
} }
@@ -328,7 +456,8 @@ class AppLocalizations {
// 새로 추가된 동적 메서드들 // 새로 추가된 동적 메서드들
String paymentDueInDays(int days) { String paymentDueInDays(int days) {
final template = _localizedStrings['paymentDueInDays'] ?? 'Payment due in @ days'; final template =
_localizedStrings['paymentDueInDays'] ?? 'Payment due in @ days';
return template.replaceAll('@', days.toString()); return template.replaceAll('@', days.toString());
} }
@@ -338,27 +467,37 @@ class AppLocalizations {
} }
String exchangeRateFormat(String rate) { String exchangeRateFormat(String rate) {
final template = _localizedStrings['exchangeRateFormat'] ?? 'Today\'s rate: @'; final template =
_localizedStrings['exchangeRateFormat'] ?? 'Today\'s rate: @';
return template.replaceAll('@', rate); return template.replaceAll('@', rate);
} }
// 결제 주기 결제 메시지 // 결제 주기 결제 메시지
String get billingCyclePayment => _localizedStrings['billingCyclePayment'] ?? '@ Payment'; String get billingCyclePayment =>
_localizedStrings['billingCyclePayment'] ?? '@ Payment';
// 할인 금액 표시 getter들 // 할인 금액 표시 getter들
String get discountAmountWon => _localizedStrings['discountAmountWon'] ?? 'Save ₩@'; String get discountAmountWon =>
String get discountAmountDollar => _localizedStrings['discountAmountDollar'] ?? 'Save \$@'; _localizedStrings['discountAmountWon'] ?? 'Save @';
String get discountAmountYen => _localizedStrings['discountAmountYen'] ?? 'Save ¥@'; String get discountAmountDollar =>
String get discountAmountYuan => _localizedStrings['discountAmountYuan'] ?? 'Save ¥@'; _localizedStrings['discountAmountDollar'] ?? 'Save \$@';
String get discountAmountYen =>
_localizedStrings['discountAmountYen'] ?? 'Save ¥@';
String get discountAmountYuan =>
_localizedStrings['discountAmountYuan'] ?? 'Save ¥@';
// 결제 주기 관련 getter // 결제 주기 관련 getter
String get monthly => _localizedStrings['monthly'] ?? 'Monthly'; String get monthly => _localizedStrings['monthly'] ?? 'Monthly';
String get weekly => _localizedStrings['weekly'] ?? 'Weekly'; String get weekly => _localizedStrings['weekly'] ?? 'Weekly';
String get yearly => _localizedStrings['yearly'] ?? 'Yearly'; String get yearly => _localizedStrings['yearly'] ?? 'Yearly';
String get billingCycleMonthly => _localizedStrings['billingCycleMonthly'] ?? 'Monthly'; String get billingCycleMonthly =>
String get billingCycleQuarterly => _localizedStrings['billingCycleQuarterly'] ?? 'Quarterly'; _localizedStrings['billingCycleMonthly'] ?? 'Monthly';
String get billingCycleHalfYearly => _localizedStrings['billingCycleHalfYearly'] ?? 'Half-Yearly'; String get billingCycleQuarterly =>
String get billingCycleYearly => _localizedStrings['billingCycleYearly'] ?? 'Yearly'; _localizedStrings['billingCycleQuarterly'] ?? 'Quarterly';
String get billingCycleHalfYearly =>
_localizedStrings['billingCycleHalfYearly'] ?? 'Half-Yearly';
String get billingCycleYearly =>
_localizedStrings['billingCycleYearly'] ?? 'Yearly';
// 색상 관련 getter // 색상 관련 getter
String get colorBlue => _localizedStrings['colorBlue'] ?? 'Blue'; String get colorBlue => _localizedStrings['colorBlue'] ?? 'Blue';
@@ -368,48 +507,75 @@ class AppLocalizations {
String get colorPurple => _localizedStrings['colorPurple'] ?? 'Purple'; String get colorPurple => _localizedStrings['colorPurple'] ?? 'Purple';
// 날짜 형식 관련 getter // 날짜 형식 관련 getter
String get dateFormatFull => _localizedStrings['dateFormatFull'] ?? 'MMM dd, yyyy'; String get dateFormatFull =>
_localizedStrings['dateFormatFull'] ?? 'MMM dd, yyyy';
String get dateFormatShort => _localizedStrings['dateFormatShort'] ?? 'MM/dd'; String get dateFormatShort => _localizedStrings['dateFormatShort'] ?? 'MM/dd';
// USD 환율 표시 형식 // USD 환율 표시 형식
String get exchangeRateDisplay => _localizedStrings['exchangeRateDisplay'] ?? '\$1 = @'; String get exchangeRateDisplay =>
_localizedStrings['exchangeRateDisplay'] ?? '\$1 = @';
// 라벨 및 힌트 텍스트 // 라벨 및 힌트 텍스트
String get labelServiceName => _localizedStrings['labelServiceName'] ?? 'Service Name'; String get labelServiceName =>
String get hintServiceName => _localizedStrings['hintServiceName'] ?? 'e.g. Netflix, Spotify'; _localizedStrings['labelServiceName'] ?? 'Service Name';
String get labelMonthlyExpense => _localizedStrings['labelMonthlyExpense'] ?? 'Monthly Expense'; String get hintServiceName =>
String get labelNextBillingDate => _localizedStrings['labelNextBillingDate'] ?? 'Next Billing Date'; _localizedStrings['hintServiceName'] ?? 'e.g. Netflix, Spotify';
String get labelWebsiteUrl => _localizedStrings['labelWebsiteUrl'] ?? 'Website URL (Optional)'; String get labelMonthlyExpense =>
String get hintWebsiteUrl => _localizedStrings['hintWebsiteUrl'] ?? 'https://example.com'; _localizedStrings['labelMonthlyExpense'] ?? 'Monthly Expense';
String get labelEventPrice => _localizedStrings['labelEventPrice'] ?? 'Event Price'; String get labelNextBillingDate =>
String get hintEventPrice => _localizedStrings['hintEventPrice'] ?? 'Enter discounted price'; _localizedStrings['labelNextBillingDate'] ?? 'Next Billing Date';
String get labelWebsiteUrl =>
_localizedStrings['labelWebsiteUrl'] ?? 'Website URL (Optional)';
String get hintWebsiteUrl =>
_localizedStrings['hintWebsiteUrl'] ?? 'https://example.com';
String get labelEventPrice =>
_localizedStrings['labelEventPrice'] ?? 'Event Price';
String get hintEventPrice =>
_localizedStrings['hintEventPrice'] ?? 'Enter discounted price';
String get labelCategory => _localizedStrings['labelCategory'] ?? 'Category'; String get labelCategory => _localizedStrings['labelCategory'] ?? 'Category';
// 기타 번역 // 기타 번역
String get subscription => _localizedStrings['subscription'] ?? 'Subscription'; String get subscription =>
_localizedStrings['subscription'] ?? 'Subscription';
String get movie => _localizedStrings['movie'] ?? 'Movie'; String get movie => _localizedStrings['movie'] ?? 'Movie';
String get music => _localizedStrings['music'] ?? 'Music'; String get music => _localizedStrings['music'] ?? 'Music';
String get exercise => _localizedStrings['exercise'] ?? 'Exercise'; String get exercise => _localizedStrings['exercise'] ?? 'Exercise';
String get shopping => _localizedStrings['shopping'] ?? 'Shopping'; String get shopping => _localizedStrings['shopping'] ?? 'Shopping';
String get currency => _localizedStrings['currency'] ?? 'Currency'; String get currency => _localizedStrings['currency'] ?? 'Currency';
String get websiteInfo => _localizedStrings['websiteInfo'] ?? 'Website Information'; String get websiteInfo =>
String get cancelGuide => _localizedStrings['cancelGuide'] ?? 'Cancellation Guide'; _localizedStrings['websiteInfo'] ?? 'Website Information';
String get cancelServiceGuide => _localizedStrings['cancelServiceGuide'] ?? 'To cancel this service, please go to the cancellation page through the link below.'; String get cancelGuide =>
String get goToCancelPage => _localizedStrings['goToCancelPage'] ?? 'Go to Cancellation Page'; _localizedStrings['cancelGuide'] ?? 'Cancellation Guide';
String get urlAutoMatchInfo => _localizedStrings['urlAutoMatchInfo'] ?? 'If URL is empty, it will be automatically matched based on the service name'; String get cancelServiceGuide =>
_localizedStrings['cancelServiceGuide'] ??
'To cancel this service, please go to the cancellation page through the link below.';
String get goToCancelPage =>
_localizedStrings['goToCancelPage'] ?? 'Go to Cancellation Page';
String get urlAutoMatchInfo =>
_localizedStrings['urlAutoMatchInfo'] ??
'If URL is empty, it will be automatically matched based on the service name';
String get dateSelect => _localizedStrings['dateSelect'] ?? 'Select'; String get dateSelect => _localizedStrings['dateSelect'] ?? 'Select';
// 새로 추가된 getter들 // 새로 추가된 getter들
String get serviceInfo => _localizedStrings['serviceInfo'] ?? 'Service Information'; String get serviceInfo =>
String get newSubscriptionAdd => _localizedStrings['newSubscriptionAdd'] ?? 'Add New Subscription'; _localizedStrings['serviceInfo'] ?? 'Service Information';
String get enterServiceInfo => _localizedStrings['enterServiceInfo'] ?? 'Enter service information'; String get newSubscriptionAdd =>
String get addSubscriptionButton => _localizedStrings['addSubscriptionButton'] ?? 'Add Subscription'; _localizedStrings['newSubscriptionAdd'] ?? 'Add New Subscription';
String get serviceNameRequired => _localizedStrings['serviceNameRequired'] ?? 'Please enter service name'; String get enterServiceInfo =>
String get amountRequired => _localizedStrings['amountRequired'] ?? 'Please enter amount'; _localizedStrings['enterServiceInfo'] ?? 'Enter service information';
String get subscriptionDetail => _localizedStrings['subscriptionDetail'] ?? 'Subscription Detail'; String get addSubscriptionButton =>
_localizedStrings['addSubscriptionButton'] ?? 'Add Subscription';
String get serviceNameRequired =>
_localizedStrings['serviceNameRequired'] ?? 'Please enter service name';
String get amountRequired =>
_localizedStrings['amountRequired'] ?? 'Please enter amount';
String get subscriptionDetail =>
_localizedStrings['subscriptionDetail'] ?? 'Subscription Detail';
String get enterAmount => _localizedStrings['enterAmount'] ?? 'Enter amount'; String get enterAmount => _localizedStrings['enterAmount'] ?? 'Enter amount';
String get invalidAmount => _localizedStrings['invalidAmount'] ?? 'Please enter a valid amount'; String get invalidAmount =>
String get featureComingSoon => _localizedStrings['featureComingSoon'] ?? 'This feature is coming soon'; _localizedStrings['invalidAmount'] ?? 'Please enter a valid amount';
String get featureComingSoon =>
_localizedStrings['featureComingSoon'] ?? 'This feature is coming soon';
// 결제 주기를 키값으로 변환하여 번역된 이름 반환 // 결제 주기를 키값으로 변환하여 번역된 이름 반환
String getBillingCycleName(String billingCycleKey) { String getBillingCycleName(String billingCycleKey) {
@@ -467,7 +633,8 @@ class AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
const AppLocalizationsDelegate(); const AppLocalizationsDelegate();
@override @override
bool isSupported(Locale locale) => ['en', 'ko', 'ja', 'zh'].contains(locale.languageCode); bool isSupported(Locale locale) =>
['en', 'ko', 'ja', 'zh'].contains(locale.languageCode);
@override @override
Future<AppLocalizations> load(Locale locale) async { Future<AppLocalizations> load(Locale locale) async {

View File

@@ -26,7 +26,7 @@ import 'utils/performance_optimizer.dart';
import 'navigator_key.dart'; import 'navigator_key.dart';
// AdMob 활성화 플래그 (개발 중 false, 프로덕션 시 true로 변경) // AdMob 활성화 플래그 (개발 중 false, 프로덕션 시 true로 변경)
const bool enableAdMob = false; const bool enableAdMob = true;
Future<void> main() async { Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();

View File

@@ -37,7 +37,8 @@ class AppNavigationObserver extends NavigatorObserver {
if (newRoute != null) { if (newRoute != null) {
_updateNavigationState(newRoute); _updateNavigationState(newRoute);
} }
debugPrint('Navigation: Replace ${oldRoute?.settings.name} with ${newRoute?.settings.name}'); debugPrint(
'Navigation: Replace ${oldRoute?.settings.name} with ${newRoute?.settings.name}');
} }
void _updateNavigationState(Route<dynamic> route) { void _updateNavigationState(Route<dynamic> route) {
@@ -52,7 +53,8 @@ class AppNavigationObserver extends NavigatorObserver {
try { try {
final context = navigator!.context; final context = navigator!.context;
final navigationProvider = Provider.of<NavigationProvider>(context, listen: false); final navigationProvider =
Provider.of<NavigationProvider>(context, listen: false);
navigationProvider.updateByRoute(routeName); navigationProvider.updateByRoute(routeName);
} catch (e) { } catch (e) {
debugPrint('Failed to update navigation state: $e'); debugPrint('Failed to update navigation state: $e');
@@ -69,7 +71,8 @@ class AppNavigationObserver extends NavigatorObserver {
try { try {
final context = navigator!.context; final context = navigator!.context;
final navigationProvider = Provider.of<NavigationProvider>(context, listen: false); final navigationProvider =
Provider.of<NavigationProvider>(context, listen: false);
navigationProvider.pop(); navigationProvider.pop();
} catch (e) { } catch (e) {
debugPrint('Failed to handle pop with provider: $e'); debugPrint('Failed to handle pop with provider: $e');

View File

@@ -59,9 +59,17 @@ class CategoryProvider extends ChangeNotifier {
{'name': 'storageCloud', 'color': '#2196F3', 'icon': 'cloud'}, {'name': 'storageCloud', 'color': '#2196F3', 'icon': 'cloud'},
{'name': 'telecomInternetTv', 'color': '#00BCD4', 'icon': 'wifi'}, {'name': 'telecomInternetTv', 'color': '#00BCD4', 'icon': 'wifi'},
{'name': 'lifestyle', 'color': '#4CAF50', 'icon': 'home'}, {'name': 'lifestyle', 'color': '#4CAF50', 'icon': 'home'},
{'name': 'shoppingEcommerce', 'color': '#FF9800', 'icon': 'shopping_cart'}, {
'name': 'shoppingEcommerce',
'color': '#FF9800',
'icon': 'shopping_cart'
},
{'name': 'programming', 'color': '#795548', 'icon': 'code'}, {'name': 'programming', 'color': '#795548', 'icon': 'code'},
{'name': 'collaborationOffice', 'color': '#607D8B', 'icon': 'business_center'}, {
'name': 'collaborationOffice',
'color': '#607D8B',
'icon': 'business_center'
},
{'name': 'aiService', 'color': '#673AB7', 'icon': 'smart_toy'}, {'name': 'aiService', 'color': '#673AB7', 'icon': 'smart_toy'},
{'name': 'other', 'color': '#9E9E9E', 'icon': 'category'}, {'name': 'other', 'color': '#9E9E9E', 'icon': 'category'},
]; ];

View File

@@ -270,7 +270,8 @@ class NotificationProvider extends ChangeNotifier {
// 첫 권한 부여 시 기본 설정 초기화 // 첫 권한 부여 시 기본 설정 초기화
Future<void> initializeDefaultSettingsOnFirstPermission() async { Future<void> initializeDefaultSettingsOnFirstPermission() async {
try { try {
final firstGranted = await _secureStorage.read(key: _firstPermissionGrantedKey); final firstGranted =
await _secureStorage.read(key: _firstPermissionGrantedKey);
if (firstGranted != 'true') { if (firstGranted != 'true') {
// 첫 권한 부여 시 기본값 설정 // 첫 권한 부여 시 기본값 설정
await setReminderDays(2); // 2일 전 알림 await setReminderDays(2); // 2일 전 알림
@@ -278,7 +279,8 @@ class NotificationProvider extends ChangeNotifier {
await setPaymentEnabled(true); // 결제 예정 알림 활성화 await setPaymentEnabled(true); // 결제 예정 알림 활성화
// 첫 권한 부여 플래그 저장 // 첫 권한 부여 플래그 저장
await _secureStorage.write(key: _firstPermissionGrantedKey, value: 'true'); await _secureStorage.write(
key: _firstPermissionGrantedKey, value: 'true');
} }
} catch (e) { } catch (e) {
debugPrint('기본 설정 초기화 중 오류 발생: $e'); debugPrint('기본 설정 초기화 중 오류 발생: $e');

View File

@@ -31,7 +31,8 @@ class SubscriptionProvider extends ChangeNotifier {
'\$${price} ×$rate = ₩${price * rate}'); '\$${price} ×$rate = ₩${price * rate}');
return sum + (price * rate); return sum + (price * rate);
} }
debugPrint('[SubscriptionProvider] ${subscription.serviceName}: ₩$price'); debugPrint(
'[SubscriptionProvider] ${subscription.serviceName}: ₩$price');
return sum + price; return sum + price;
}, },
); );
@@ -191,7 +192,6 @@ class SubscriptionProvider extends ChangeNotifier {
} }
} }
Future<void> clearAllSubscriptions() async { Future<void> clearAllSubscriptions() async {
_isLoading = true; _isLoading = true;
notifyListeners(); notifyListeners();
@@ -217,7 +217,8 @@ class SubscriptionProvider extends ChangeNotifier {
} }
/// 이벤트 종료 알림을 스케줄링합니다. /// 이벤트 종료 알림을 스케줄링합니다.
Future<void> _scheduleEventEndNotification(SubscriptionModel subscription) async { Future<void> _scheduleEventEndNotification(
SubscriptionModel subscription) async {
if (subscription.eventEndDate != null && if (subscription.eventEndDate != null &&
subscription.eventEndDate!.isAfter(DateTime.now())) { subscription.eventEndDate!.isAfter(DateTime.now())) {
await NotificationService.scheduleNotification( await NotificationService.scheduleNotification(
@@ -238,7 +239,6 @@ class SubscriptionProvider extends ChangeNotifier {
if (subscription.isEventActive && if (subscription.isEventActive &&
subscription.eventEndDate != null && subscription.eventEndDate != null &&
subscription.eventEndDate!.isBefore(DateTime.now())) { subscription.eventEndDate!.isBefore(DateTime.now())) {
subscription.isEventActive = false; subscription.isEventActive = false;
await _subscriptionBox.put(subscription.id, subscription); await _subscriptionBox.put(subscription.id, subscription);
hasChanges = true; hasChanges = true;
@@ -255,9 +255,8 @@ class SubscriptionProvider extends ChangeNotifier {
if (_subscriptions.isEmpty) return 0.0; if (_subscriptions.isEmpty) return 0.0;
// locale이 제공되지 않으면 현재 로케일 사용 // locale이 제공되지 않으면 현재 로케일 사용
final targetCurrency = locale != null final targetCurrency =
? CurrencyUtil.getDefaultCurrency(locale) locale != null ? CurrencyUtil.getDefaultCurrency(locale) : 'KRW'; // 기본값
: 'KRW'; // 기본값
debugPrint('[calculateTotalExpense] 계산 시작 - 타겟 통화: $targetCurrency'); debugPrint('[calculateTotalExpense] 계산 시작 - 타겟 통화: $targetCurrency');
double total = 0.0; double total = 0.0;
@@ -281,14 +280,14 @@ class SubscriptionProvider extends ChangeNotifier {
} }
/// 최근 6개월의 월별 지출 데이터를 반환합니다. (로케일별 기본 통화로 환산) /// 최근 6개월의 월별 지출 데이터를 반환합니다. (로케일별 기본 통화로 환산)
Future<List<Map<String, dynamic>>> getMonthlyExpenseData({String? locale}) async { Future<List<Map<String, dynamic>>> getMonthlyExpenseData(
{String? locale}) async {
final now = DateTime.now(); final now = DateTime.now();
final List<Map<String, dynamic>> monthlyData = []; final List<Map<String, dynamic>> monthlyData = [];
// locale이 제공되지 않으면 현재 로케일 사용 // locale이 제공되지 않으면 현재 로케일 사용
final targetCurrency = locale != null final targetCurrency =
? CurrencyUtil.getDefaultCurrency(locale) locale != null ? CurrencyUtil.getDefaultCurrency(locale) : 'KRW'; // 기본값
: 'KRW'; // 기본값
// 최근 6개월 데이터 생성 // 최근 6개월 데이터 생성
for (int i = 5; i >= 0; i--) { for (int i = 5; i >= 0; i--) {
@@ -296,10 +295,12 @@ class SubscriptionProvider extends ChangeNotifier {
double monthTotal = 0.0; double monthTotal = 0.0;
// 현재 월인지 확인 // 현재 월인지 확인
final isCurrentMonth = (month.year == now.year && month.month == now.month); final isCurrentMonth =
(month.year == now.year && month.month == now.month);
if (isCurrentMonth) { if (isCurrentMonth) {
debugPrint('[getMonthlyExpenseData] 현재 월(${month.year}-${month.month}) 계산 중...'); debugPrint(
'[getMonthlyExpenseData] 현재 월(${month.year}-${month.month}) 계산 중...');
} }
// 해당 월에 활성화된 구독 계산 // 해당 월에 활성화된 구독 계산
@@ -307,11 +308,13 @@ class SubscriptionProvider extends ChangeNotifier {
if (isCurrentMonth) { if (isCurrentMonth) {
// 현재 월인 경우: 모든 활성 구독 포함 (calculateTotalExpense와 동일하게) // 현재 월인 경우: 모든 활성 구독 포함 (calculateTotalExpense와 동일하게)
final cost = subscription.currentPrice; final cost = subscription.currentPrice;
debugPrint('[getMonthlyExpenseData] 현재 월 - ${subscription.serviceName}: ' debugPrint(
'[getMonthlyExpenseData] 현재 월 - ${subscription.serviceName}: '
'${cost} ${subscription.currency} (이벤트 적용: ${subscription.isCurrentlyInEvent})'); '${cost} ${subscription.currency} (이벤트 적용: ${subscription.isCurrentlyInEvent})');
// 통화 변환 // 통화 변환
final converted = await ExchangeRateService().convertBetweenCurrencies( final converted =
await ExchangeRateService().convertBetweenCurrencies(
cost, cost,
subscription.currency, subscription.currency,
targetCurrency, targetCurrency,
@@ -325,7 +328,8 @@ class SubscriptionProvider extends ChangeNotifier {
Duration(days: _getBillingCycleDays(subscription.billingCycle)), Duration(days: _getBillingCycleDays(subscription.billingCycle)),
); );
if (subscriptionStartDate.isBefore(DateTime(month.year, month.month + 1, 1)) && if (subscriptionStartDate
.isBefore(DateTime(month.year, month.month + 1, 1)) &&
subscription.nextBillingDate.isAfter(month)) { subscription.nextBillingDate.isAfter(month)) {
// 해당 월의 비용 계산 (이벤트 가격 고려) // 해당 월의 비용 계산 (이벤트 가격 고려)
double cost; double cost;
@@ -334,7 +338,8 @@ class SubscriptionProvider extends ChangeNotifier {
subscription.eventStartDate != null && subscription.eventStartDate != null &&
subscription.eventEndDate != null && subscription.eventEndDate != null &&
// 이벤트 기간과 해당 월이 겹치는지 확인 // 이벤트 기간과 해당 월이 겹치는지 확인
subscription.eventStartDate!.isBefore(DateTime(month.year, month.month + 1, 1)) && subscription.eventStartDate!
.isBefore(DateTime(month.year, month.month + 1, 1)) &&
subscription.eventEndDate!.isAfter(month)) { subscription.eventEndDate!.isAfter(month)) {
cost = subscription.eventPrice ?? subscription.monthlyCost; cost = subscription.eventPrice ?? subscription.monthlyCost;
} else { } else {
@@ -342,7 +347,8 @@ class SubscriptionProvider extends ChangeNotifier {
} }
// 통화 변환 // 통화 변환
final converted = await ExchangeRateService().convertBetweenCurrencies( final converted =
await ExchangeRateService().convertBetweenCurrencies(
cost, cost,
subscription.currency, subscription.currency,
targetCurrency, targetCurrency,
@@ -354,7 +360,8 @@ class SubscriptionProvider extends ChangeNotifier {
} }
if (isCurrentMonth) { if (isCurrentMonth) {
debugPrint('[getMonthlyExpenseData] 현재 월(${_getMonthLabel(month, locale ?? 'en')}) 총 지출: $monthTotal $targetCurrency'); debugPrint(
'[getMonthlyExpenseData] 현재 월(${_getMonthLabel(month, locale ?? 'en')}) 총 지출: $monthTotal $targetCurrency');
} }
monthlyData.add({ monthlyData.add({
@@ -431,10 +438,12 @@ class SubscriptionProvider extends ChangeNotifier {
serviceName.contains('티빙') || serviceName.contains('티빙') ||
serviceName.contains('디즈니') || serviceName.contains('디즈니') ||
serviceName.contains('넷플릭스')) { serviceName.contains('넷플릭스')) {
categoryId = categories.firstWhere( categoryId = categories
.firstWhere(
(cat) => cat.name == 'OTT 서비스', (cat) => cat.name == 'OTT 서비스',
orElse: () => categories.first, orElse: () => categories.first,
).id; )
.id;
} }
// 음악 서비스 // 음악 서비스
else if (serviceName.contains('spotify') || else if (serviceName.contains('spotify') ||
@@ -443,30 +452,36 @@ class SubscriptionProvider extends ChangeNotifier {
serviceName.contains('지니') || serviceName.contains('지니') ||
serviceName.contains('플로') || serviceName.contains('플로') ||
serviceName.contains('벡스')) { serviceName.contains('벡스')) {
categoryId = categories.firstWhere( categoryId = categories
.firstWhere(
(cat) => cat.name == 'music', (cat) => cat.name == 'music',
orElse: () => categories.first, orElse: () => categories.first,
).id; )
.id;
} }
// AI 서비스 // AI 서비스
else if (serviceName.contains('chatgpt') || else if (serviceName.contains('chatgpt') ||
serviceName.contains('claude') || serviceName.contains('claude') ||
serviceName.contains('midjourney') || serviceName.contains('midjourney') ||
serviceName.contains('copilot')) { serviceName.contains('copilot')) {
categoryId = categories.firstWhere( categoryId = categories
.firstWhere(
(cat) => cat.name == 'aiService', (cat) => cat.name == 'aiService',
orElse: () => categories.first, orElse: () => categories.first,
).id; )
.id;
} }
// 프로그래밍/개발 // 프로그래밍/개발
else if (serviceName.contains('github') || else if (serviceName.contains('github') ||
serviceName.contains('intellij') || serviceName.contains('intellij') ||
serviceName.contains('webstorm') || serviceName.contains('webstorm') ||
serviceName.contains('jetbrains')) { serviceName.contains('jetbrains')) {
categoryId = categories.firstWhere( categoryId = categories
.firstWhere(
(cat) => cat.name == 'programming', (cat) => cat.name == 'programming',
orElse: () => categories.first, orElse: () => categories.first,
).id; )
.id;
} }
// 오피스/협업 툴 // 오피스/협업 툴
else if (serviceName.contains('notion') || else if (serviceName.contains('notion') ||
@@ -476,24 +491,29 @@ class SubscriptionProvider extends ChangeNotifier {
serviceName.contains('figma') || serviceName.contains('figma') ||
serviceName.contains('icloud') || serviceName.contains('icloud') ||
serviceName.contains('아이클라우드')) { serviceName.contains('아이클라우드')) {
categoryId = categories.firstWhere( categoryId = categories
.firstWhere(
(cat) => cat.name == 'collaborationOffice', (cat) => cat.name == 'collaborationOffice',
orElse: () => categories.first, orElse: () => categories.first,
).id; )
.id;
} }
// 기타 서비스 (기본값) // 기타 서비스 (기본값)
else { else {
categoryId = categories.firstWhere( categoryId = categories
.firstWhere(
(cat) => cat.name == 'other', (cat) => cat.name == 'other',
orElse: () => categories.first, orElse: () => categories.first,
).id; )
.id;
} }
if (categoryId != null) { if (categoryId != null) {
subscription.categoryId = categoryId; subscription.categoryId = categoryId;
await subscription.save(); await subscription.save();
migratedCount++; migratedCount++;
final categoryName = categories.firstWhere((cat) => cat.id == categoryId).name; final categoryName =
categories.firstWhere((cat) => cat.id == categoryId).name;
debugPrint('${subscription.serviceName}$categoryName'); debugPrint('${subscription.serviceName}$categoryName');
} }
} }

View File

@@ -48,7 +48,9 @@ class _AnalysisScreenState extends State<AnalysisScreen>
'현재 해시=$currentHash, 이전 해시=$_lastDataHash, 로딩중=$_isLoading'); '현재 해시=$currentHash, 이전 해시=$_lastDataHash, 로딩중=$_isLoading');
// 데이터가 변경되었고 현재 로딩 중이 아닌 경우에만 리로드 // 데이터가 변경되었고 현재 로딩 중이 아닌 경우에만 리로드
if (currentHash != _lastDataHash && !_isLoading && _lastDataHash.isNotEmpty) { if (currentHash != _lastDataHash &&
!_isLoading &&
_lastDataHash.isNotEmpty) {
debugPrint('[AnalysisScreen] 데이터 변경 감지됨, 리로드 시작'); debugPrint('[AnalysisScreen] 데이터 변경 감지됨, 리로드 시작');
_loadData(); _loadData();
} }
@@ -71,7 +73,8 @@ class _AnalysisScreenState extends State<AnalysisScreen>
buffer.write(provider.totalMonthlyExpense.toStringAsFixed(2)); buffer.write(provider.totalMonthlyExpense.toStringAsFixed(2));
for (final sub in subscriptions) { for (final sub in subscriptions) {
buffer.write('_${sub.id}_${sub.currentPrice.toStringAsFixed(2)}_${sub.currency}'); buffer.write(
'_${sub.id}_${sub.currentPrice.toStringAsFixed(2)}_${sub.currency}');
} }
return buffer.toString(); return buffer.toString();

View File

@@ -90,15 +90,35 @@ class _CategoryManagementScreenState extends State<CategoryManagementScreen> {
), ),
items: [ items: [
DropdownMenuItem( DropdownMenuItem(
value: '#1976D2', child: Text(AppLocalizations.of(context).colorBlue, style: TextStyle(color: AppColors.darkNavy))), value: '#1976D2',
child: Text(
AppLocalizations.of(context).colorBlue,
style:
TextStyle(color: AppColors.darkNavy))),
DropdownMenuItem( DropdownMenuItem(
value: '#4CAF50', child: Text(AppLocalizations.of(context).colorGreen, style: TextStyle(color: AppColors.darkNavy))), value: '#4CAF50',
child: Text(
AppLocalizations.of(context).colorGreen,
style:
TextStyle(color: AppColors.darkNavy))),
DropdownMenuItem( DropdownMenuItem(
value: '#FF9800', child: Text(AppLocalizations.of(context).colorOrange, style: TextStyle(color: AppColors.darkNavy))), value: '#FF9800',
child: Text(
AppLocalizations.of(context).colorOrange,
style:
TextStyle(color: AppColors.darkNavy))),
DropdownMenuItem( DropdownMenuItem(
value: '#F44336', child: Text(AppLocalizations.of(context).colorRed, style: TextStyle(color: AppColors.darkNavy))), value: '#F44336',
child: Text(
AppLocalizations.of(context).colorRed,
style:
TextStyle(color: AppColors.darkNavy))),
DropdownMenuItem( DropdownMenuItem(
value: '#9C27B0', child: Text(AppLocalizations.of(context).colorPurple, style: TextStyle(color: AppColors.darkNavy))), value: '#9C27B0',
child: Text(
AppLocalizations.of(context).colorPurple,
style:
TextStyle(color: AppColors.darkNavy))),
], ],
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
@@ -117,14 +137,30 @@ class _CategoryManagementScreenState extends State<CategoryManagementScreen> {
), ),
items: [ items: [
DropdownMenuItem( DropdownMenuItem(
value: 'subscriptions', child: Text('구독', style: TextStyle(color: AppColors.darkNavy))), value: 'subscriptions',
DropdownMenuItem(value: 'movie', child: Text('영화', style: TextStyle(color: AppColors.darkNavy))), child: Text('구독',
style:
TextStyle(color: AppColors.darkNavy))),
DropdownMenuItem( DropdownMenuItem(
value: 'music_note', child: Text('음악', style: TextStyle(color: AppColors.darkNavy))), value: 'movie',
child: Text('영화',
style:
TextStyle(color: AppColors.darkNavy))),
DropdownMenuItem( DropdownMenuItem(
value: 'fitness_center', child: Text('운동', style: TextStyle(color: AppColors.darkNavy))), value: 'music_note',
child: Text('음악',
style:
TextStyle(color: AppColors.darkNavy))),
DropdownMenuItem( DropdownMenuItem(
value: 'shopping_cart', child: Text('쇼핑', style: TextStyle(color: AppColors.darkNavy))), value: 'fitness_center',
child: Text('운동',
style:
TextStyle(color: AppColors.darkNavy))),
DropdownMenuItem(
value: 'shopping_cart',
child: Text('쇼핑',
style:
TextStyle(color: AppColors.darkNavy))),
], ],
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
@@ -163,7 +199,8 @@ class _CategoryManagementScreenState extends State<CategoryManagementScreen> {
int.parse(category.color.replaceAll('#', '0xFF'))), int.parse(category.color.replaceAll('#', '0xFF'))),
), ),
title: Text( title: Text(
provider.getLocalizedCategoryName(context, category.name), provider.getLocalizedCategoryName(
context, category.name),
style: TextStyle( style: TextStyle(
color: AppColors.darkNavy, color: AppColors.darkNavy,
), ),

View File

@@ -43,7 +43,6 @@ class _DetailScreenState extends State<DetailScreen>
super.dispose(); super.dispose();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final baseColor = _controller.getCardColor(); final baseColor = _controller.getCardColor();
@@ -110,7 +109,8 @@ class _DetailScreenState extends State<DetailScreen>
), ),
const Spacer(), const Spacer(),
Text( Text(
AppLocalizations.of(context).changesAppliedAfterSave, AppLocalizations.of(context)
.changesAppliedAfterSave,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: AppColors.darkNavy, color: AppColors.darkNavy,

View File

@@ -236,7 +236,11 @@ class _MainScreenState extends State<MainScreen>
body: IndexedStack( body: IndexedStack(
index: PlatformHelper.isIOS index: PlatformHelper.isIOS
? (currentIndex == 3 ? 3 : currentIndex) // iOS: 설정화면은 인덱스 3 ? (currentIndex == 3 ? 3 : currentIndex) // iOS: 설정화면은 인덱스 3
: (currentIndex == 3 ? 3 : currentIndex == 4 ? 4 : currentIndex), // Android: 기존 로직 : (currentIndex == 3
? 3
: currentIndex == 4
? 4
: currentIndex), // Android: 기존 로직
children: _screens, children: _screens,
), ),
backgroundGradient: backgroundGradient, backgroundGradient: backgroundGradient,

View File

@@ -75,7 +75,8 @@ class _SmsScanScreenState extends State<SmsScanScreen> {
); );
} }
final currentSubscription = _controller.scannedSubscriptions[_controller.currentIndex]; final currentSubscription =
_controller.scannedSubscriptions[_controller.currentIndex];
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,

View File

@@ -89,9 +89,11 @@ class CurrencyUtil {
// USD 입력인 경우 - 기본 통화로 변환하여 표시 // USD 입력인 경우 - 기본 통화로 변환하여 표시
if (currency == 'USD' && defaultCurrency != 'USD') { if (currency == 'USD' && defaultCurrency != 'USD') {
final convertedAmount = await _exchangeRateService.convertUsdToTarget(amount, defaultCurrency); final convertedAmount = await _exchangeRateService.convertUsdToTarget(
amount, defaultCurrency);
if (convertedAmount != null) { if (convertedAmount != null) {
final primaryFormatted = _formatSingleCurrency(convertedAmount, defaultCurrency); final primaryFormatted =
_formatSingleCurrency(convertedAmount, defaultCurrency);
final usdFormatted = _formatSingleCurrency(amount, 'USD'); final usdFormatted = _formatSingleCurrency(amount, 'USD');
return '$primaryFormatted ($usdFormatted)'; return '$primaryFormatted ($usdFormatted)';
} }

View File

@@ -75,7 +75,8 @@ class ExchangeRateService {
} }
/// USD 금액을 지정된 통화로 변환합니다. /// USD 금액을 지정된 통화로 변환합니다.
Future<double?> convertUsdToTarget(double usdAmount, String targetCurrency) async { Future<double?> convertUsdToTarget(
double usdAmount, String targetCurrency) async {
await _fetchAllRatesIfNeeded(); await _fetchAllRatesIfNeeded();
switch (targetCurrency) { switch (targetCurrency) {
@@ -96,7 +97,8 @@ class ExchangeRateService {
} }
/// 지정된 통화를 USD로 변환합니다. /// 지정된 통화를 USD로 변환합니다.
Future<double?> convertTargetToUsd(double amount, String sourceCurrency) async { Future<double?> convertTargetToUsd(
double amount, String sourceCurrency) async {
await _fetchAllRatesIfNeeded(); await _fetchAllRatesIfNeeded();
switch (sourceCurrency) { switch (sourceCurrency) {
@@ -118,10 +120,7 @@ class ExchangeRateService {
/// 두 통화 간 변환을 수행합니다. (USD를 거쳐서 변환) /// 두 통화 간 변환을 수행합니다. (USD를 거쳐서 변환)
Future<double?> convertBetweenCurrencies( Future<double?> convertBetweenCurrencies(
double amount, double amount, String fromCurrency, String toCurrency) async {
String fromCurrency,
String toCurrency
) async {
if (fromCurrency == toCurrency) { if (fromCurrency == toCurrency) {
return amount; return amount;
} }
@@ -204,7 +203,8 @@ class ExchangeRateService {
} }
/// USD 금액을 지정된 언어의 기본 통화로 변환하여 포맷팅된 문자열로 반환합니다. /// USD 금액을 지정된 언어의 기본 통화로 변환하여 포맷팅된 문자열로 반환합니다.
Future<String> getFormattedAmountForLocale(double usdAmount, String locale) async { Future<String> getFormattedAmountForLocale(
double usdAmount, String locale) async {
String targetCurrency; String targetCurrency;
String localeCode; String localeCode;
String symbol; String symbol;

View File

@@ -150,15 +150,14 @@ class NotificationService {
} }
} }
static Future<bool> requestPermission() async { static Future<bool> requestPermission() async {
// 웹 플랫폼인 경우 false 반환 // 웹 플랫폼인 경우 false 반환
if (_isWeb) return false; if (_isWeb) return false;
// iOS 처리 // iOS 처리
if (Platform.isIOS) { if (Platform.isIOS) {
final iosImplementation = _notifications final iosImplementation =
.resolvePlatformSpecificImplementation< _notifications.resolvePlatformSpecificImplementation<
IOSFlutterLocalNotificationsPlugin>(); IOSFlutterLocalNotificationsPlugin>();
if (iosImplementation != null) { if (iosImplementation != null) {
@@ -173,13 +172,13 @@ class NotificationService {
// Android 처리 // Android 처리
if (Platform.isAndroid) { if (Platform.isAndroid) {
final androidImplementation = _notifications final androidImplementation =
.resolvePlatformSpecificImplementation< _notifications.resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin>(); AndroidFlutterLocalNotificationsPlugin>();
if (androidImplementation != null) { if (androidImplementation != null) {
final granted = await androidImplementation final granted =
.requestNotificationsPermission(); await androidImplementation.requestNotificationsPermission();
return granted ?? false; return granted ?? false;
} }
} }
@@ -194,8 +193,8 @@ class NotificationService {
// Android 처리 // Android 처리
if (Platform.isAndroid) { if (Platform.isAndroid) {
final androidImplementation = _notifications final androidImplementation =
.resolvePlatformSpecificImplementation< _notifications.resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin>(); AndroidFlutterLocalNotificationsPlugin>();
if (androidImplementation != null) { if (androidImplementation != null) {
@@ -207,8 +206,8 @@ class NotificationService {
// iOS 처리 // iOS 처리
if (Platform.isIOS) { if (Platform.isIOS) {
final iosImplementation = _notifications final iosImplementation =
.resolvePlatformSpecificImplementation< _notifications.resolvePlatformSpecificImplementation<
IOSFlutterLocalNotificationsPlugin>(); IOSFlutterLocalNotificationsPlugin>();
if (iosImplementation != null) { if (iosImplementation != null) {
@@ -512,8 +511,9 @@ class NotificationService {
} }
// 기본 알림 예약 (지정된 일수 전) // 기본 알림 예약 (지정된 일수 전)
final scheduledDate = final scheduledDate = subscription.nextBillingDate
subscription.nextBillingDate.subtract(Duration(days: reminderDays)).copyWith( .subtract(Duration(days: reminderDays))
.copyWith(
hour: reminderHour, hour: reminderHour,
minute: reminderMinute, minute: reminderMinute,
second: 0, second: 0,
@@ -536,12 +536,14 @@ class NotificationService {
// 이벤트가 결제일 전에 종료되는 경우 // 이벤트가 결제일 전에 종료되는 경우
final eventPrice = subscription.eventPrice ?? subscription.monthlyCost; final eventPrice = subscription.eventPrice ?? subscription.monthlyCost;
final normalPrice = subscription.monthlyCost; final normalPrice = subscription.monthlyCost;
notificationBody = '${subscription.serviceName} 구독료 ${normalPrice.toStringAsFixed(0)}원이 $daysText 결제 예정입니다.\n' notificationBody =
'${subscription.serviceName} 구독료 ${normalPrice.toStringAsFixed(0)}원이 $daysText 결제 예정입니다.\n'
'⚠️ 이벤트 종료로 가격이 ${eventPrice.toStringAsFixed(0)}원에서 ${normalPrice.toStringAsFixed(0)}원으로 변경됩니다.'; '⚠️ 이벤트 종료로 가격이 ${eventPrice.toStringAsFixed(0)}원에서 ${normalPrice.toStringAsFixed(0)}원으로 변경됩니다.';
} else { } else {
// 일반 알림 // 일반 알림
final currentPrice = subscription.currentPrice; final currentPrice = subscription.currentPrice;
notificationBody = '${subscription.serviceName} 구독료 ${currentPrice.toStringAsFixed(0)}원이 $daysText 결제 예정입니다.'; notificationBody =
'${subscription.serviceName} 구독료 ${currentPrice.toStringAsFixed(0)}원이 $daysText 결제 예정입니다.';
} }
await _notifications.zonedSchedule( await _notifications.zonedSchedule(
@@ -568,7 +570,8 @@ class NotificationService {
if (isDailyReminder && reminderDays >= 2) { if (isDailyReminder && reminderDays >= 2) {
// 첫 번째 알림 다음 날부터 결제일 전날까지 매일 알림 예약 // 첫 번째 알림 다음 날부터 결제일 전날까지 매일 알림 예약
for (int i = reminderDays - 1; i >= 1; i--) { for (int i = reminderDays - 1; i >= 1; i--) {
final dailyDate = subscription.nextBillingDate.subtract(Duration(days: i)).copyWith( final dailyDate =
subscription.nextBillingDate.subtract(Duration(days: i)).copyWith(
hour: reminderHour, hour: reminderHour,
minute: reminderMinute, minute: reminderMinute,
second: 0, second: 0,
@@ -586,15 +589,19 @@ class NotificationService {
String dailyNotificationBody; String dailyNotificationBody;
if (subscription.isEventActive && if (subscription.isEventActive &&
subscription.eventEndDate != null && subscription.eventEndDate != null &&
subscription.eventEndDate!.isBefore(subscription.nextBillingDate) && subscription.eventEndDate!
.isBefore(subscription.nextBillingDate) &&
subscription.eventEndDate!.isAfter(DateTime.now())) { subscription.eventEndDate!.isAfter(DateTime.now())) {
final eventPrice = subscription.eventPrice ?? subscription.monthlyCost; final eventPrice =
subscription.eventPrice ?? subscription.monthlyCost;
final normalPrice = subscription.monthlyCost; final normalPrice = subscription.monthlyCost;
dailyNotificationBody = '${subscription.serviceName} 구독료 ${normalPrice.toStringAsFixed(0)}원이 $remainingDaysText 결제 예정입니다.\n' dailyNotificationBody =
'${subscription.serviceName} 구독료 ${normalPrice.toStringAsFixed(0)}원이 $remainingDaysText 결제 예정입니다.\n'
'⚠️ 이벤트 종료로 가격이 ${eventPrice.toStringAsFixed(0)}원에서 ${normalPrice.toStringAsFixed(0)}원으로 변경됩니다.'; '⚠️ 이벤트 종료로 가격이 ${eventPrice.toStringAsFixed(0)}원에서 ${normalPrice.toStringAsFixed(0)}원으로 변경됩니다.';
} else { } else {
final currentPrice = subscription.currentPrice; final currentPrice = subscription.currentPrice;
dailyNotificationBody = '${subscription.serviceName} 구독료 ${currentPrice.toStringAsFixed(0)}원이 $remainingDaysText 결제 예정입니다.'; dailyNotificationBody =
'${subscription.serviceName} 구독료 ${currentPrice.toStringAsFixed(0)}원이 $remainingDaysText 결제 예정입니다.';
} }
await _notifications.zonedSchedule( await _notifications.zonedSchedule(

View File

@@ -3,7 +3,8 @@ import '../../models/subscription_model.dart';
class SubscriptionConverter { class SubscriptionConverter {
// SubscriptionModel 리스트를 Subscription 리스트로 변환 // SubscriptionModel 리스트를 Subscription 리스트로 변환
List<Subscription> convertModelsToSubscriptions(List<SubscriptionModel> models) { List<Subscription> convertModelsToSubscriptions(
List<SubscriptionModel> models) {
final result = <Subscription>[]; final result = <Subscription>[];
for (var model in models) { for (var model in models) {
@@ -11,7 +12,8 @@ class SubscriptionConverter {
final subscription = _convertSingle(model); final subscription = _convertSingle(model);
result.add(subscription); result.add(subscription);
print('모델 변환 성공: ${model.serviceName}, 카테고리ID: ${model.categoryId}, URL: ${model.websiteUrl}, 통화: ${model.currency}'); print(
'모델 변환 성공: ${model.serviceName}, 카테고리ID: ${model.categoryId}, URL: ${model.websiteUrl}, 통화: ${model.currency}');
} catch (e) { } catch (e) {
print('모델 변환 중 오류 발생: $e'); print('모델 변환 중 오류 발생: $e');
} }

View File

@@ -5,7 +5,8 @@ class SubscriptionFilter {
// 중복 구독 필터링 (서비스명과 금액이 같으면 중복으로 간주) // 중복 구독 필터링 (서비스명과 금액이 같으면 중복으로 간주)
List<Subscription> filterDuplicates( List<Subscription> filterDuplicates(
List<Subscription> scanned, List<SubscriptionModel> existing) { List<Subscription> scanned, List<SubscriptionModel> existing) {
print('_filterDuplicates: 스캔된 구독 ${scanned.length}개, 기존 구독 ${existing.length}'); print(
'_filterDuplicates: 스캔된 구독 ${scanned.length}개, 기존 구독 ${existing.length}');
// 중복되지 않은 구독만 필터링 // 중복되지 않은 구독만 필터링
return scanned.where((scannedSub) { return scanned.where((scannedSub) {
@@ -16,7 +17,8 @@ class SubscriptionFilter {
final isSameCost = existingSub.monthlyCost == scannedSub.monthlyCost; final isSameCost = existingSub.monthlyCost == scannedSub.monthlyCost;
if (isSameName && isSameCost) { if (isSameName && isSameCost) {
print('중복 발견: ${scannedSub.serviceName} (${scannedSub.monthlyCost}원)'); print(
'중복 발견: ${scannedSub.serviceName} (${scannedSub.monthlyCost}원)');
return true; return true;
} }
return false; return false;
@@ -27,7 +29,8 @@ class SubscriptionFilter {
} }
// 반복 횟수 기반 필터링 // 반복 횟수 기반 필터링
List<Subscription> filterByRepeatCount(List<Subscription> subscriptions, int minCount) { List<Subscription> filterByRepeatCount(
List<Subscription> subscriptions, int minCount) {
return subscriptions.where((sub) => sub.repeatCount >= minCount).toList(); return subscriptions.where((sub) => sub.repeatCount >= minCount).toList();
} }
@@ -44,7 +47,8 @@ class SubscriptionFilter {
List<Subscription> filterByPriceRange( List<Subscription> filterByPriceRange(
List<Subscription> subscriptions, double minPrice, double maxPrice) { List<Subscription> subscriptions, double minPrice, double maxPrice) {
return subscriptions return subscriptions
.where((sub) => sub.monthlyCost >= minPrice && sub.monthlyCost <= maxPrice) .where(
(sub) => sub.monthlyCost >= minPrice && sub.monthlyCost <= maxPrice)
.toList(); .toList();
} }

View File

@@ -107,18 +107,35 @@ class SmsScanner {
// 구독 서비스 키워드 매칭 // 구독 서비스 키워드 매칭
final subscriptionKeywords = [ final subscriptionKeywords = [
'구독', '결제', '정기결제', '자동결제', '월정액', '구독',
'subscription', 'payment', 'billing', 'charge', '결제',
'넷플릭스', 'Netflix', '유튜브', 'YouTube', 'Spotify', '정기결제',
'멜론', '웨이브', 'Disney+', '디즈니플러스', 'Apple', '자동결제',
'Microsoft', 'GitHub', 'Adobe', 'Amazon' '월정액',
'subscription',
'payment',
'billing',
'charge',
'넷플릭스',
'Netflix',
'유튜브',
'YouTube',
'Spotify',
'멜론',
'웨이브',
'Disney+',
'디즈니플러스',
'Apple',
'Microsoft',
'GitHub',
'Adobe',
'Amazon'
]; ];
// 구독 관련 키워드가 있는지 확인 // 구독 관련 키워드가 있는지 확인
bool isSubscription = subscriptionKeywords.any((keyword) => bool isSubscription = subscriptionKeywords.any((keyword) =>
body.toLowerCase().contains(keyword.toLowerCase()) || body.toLowerCase().contains(keyword.toLowerCase()) ||
sender.toLowerCase().contains(keyword.toLowerCase()) sender.toLowerCase().contains(keyword.toLowerCase()));
);
if (!isSubscription) { if (!isSubscription) {
return null; return null;
@@ -138,7 +155,8 @@ class SmsScanner {
'monthlyCost': amount ?? 0.0, 'monthlyCost': amount ?? 0.0,
'billingCycle': billingCycle, 'billingCycle': billingCycle,
'message': body, 'message': body,
'nextBillingDate': _calculateNextBillingFromDate(date, billingCycle).toIso8601String(), 'nextBillingDate':
_calculateNextBillingFromDate(date, billingCycle).toIso8601String(),
'previousPaymentDate': date.toIso8601String(), 'previousPaymentDate': date.toIso8601String(),
}; };
} catch (e) { } catch (e) {
@@ -213,7 +231,9 @@ class SmsScanner {
String _extractBillingCycle(String body) { String _extractBillingCycle(String body) {
if (body.contains('') || body.contains('monthly') || body.contains('매월')) { if (body.contains('') || body.contains('monthly') || body.contains('매월')) {
return 'monthly'; return 'monthly';
} else if (body.contains('') || body.contains('yearly') || body.contains('annual')) { } else if (body.contains('') ||
body.contains('yearly') ||
body.contains('annual')) {
return 'yearly'; return 'yearly';
} else if (body.contains('') || body.contains('weekly')) { } else if (body.contains('') || body.contains('weekly')) {
return 'weekly'; return 'weekly';
@@ -224,7 +244,8 @@ class SmsScanner {
} }
// 다음 결제일 계산 // 다음 결제일 계산
DateTime _calculateNextBillingFromDate(DateTime lastDate, String billingCycle) { DateTime _calculateNextBillingFromDate(
DateTime lastDate, String billingCycle) {
switch (billingCycle) { switch (billingCycle) {
case 'monthly': case 'monthly':
return DateTime(lastDate.year, lastDate.month + 1, lastDate.day); return DateTime(lastDate.year, lastDate.month + 1, lastDate.day);
@@ -241,7 +262,8 @@ class SmsScanner {
try { try {
final serviceName = sms['serviceName'] as String? ?? '알 수 없는 서비스'; final serviceName = sms['serviceName'] as String? ?? '알 수 없는 서비스';
final monthlyCost = (sms['monthlyCost'] as num?)?.toDouble() ?? 0.0; final monthlyCost = (sms['monthlyCost'] as num?)?.toDouble() ?? 0.0;
final billingCycle = SubscriptionModel.normalizeBillingCycle(sms['billingCycle'] as String? ?? 'monthly'); final billingCycle = SubscriptionModel.normalizeBillingCycle(
sms['billingCycle'] as String? ?? 'monthly');
final nextBillingDateStr = sms['nextBillingDate'] as String?; final nextBillingDateStr = sms['nextBillingDate'] as String?;
// 실제 반복 횟수 사용 (테스트 데이터에서는 이미 제공됨) // 실제 반복 횟수 사용 (테스트 데이터에서는 이미 제공됨)
final actualRepeatCount = repeatCount > 0 ? repeatCount : 1; final actualRepeatCount = repeatCount > 0 ? repeatCount : 1;
@@ -369,8 +391,6 @@ class SmsScanner {
return serviceUrls[serviceName]; return serviceUrls[serviceName];
} }
// 메시지에서 통화 단위를 감지하는 함수 // 메시지에서 통화 단위를 감지하는 함수
String _detectCurrency(String message) { String _detectCurrency(String message) {
final dollarKeywords = [ final dollarKeywords = [

View File

@@ -29,7 +29,8 @@ class SubscriptionUrlMatcher {
// 2. 서비스 초기화 // 2. 서비스 초기화
_categoryMapper = CategoryMapperService(_dataRepository!); _categoryMapper = CategoryMapperService(_dataRepository!);
_urlMatcher = UrlMatcherService(_dataRepository!, _categoryMapper!); _urlMatcher = UrlMatcherService(_dataRepository!, _categoryMapper!);
_cancellationService = CancellationUrlService(_dataRepository!, _urlMatcher!); _cancellationService =
CancellationUrlService(_dataRepository!, _urlMatcher!);
_nameResolver = ServiceNameResolver(_dataRepository!); _nameResolver = ServiceNameResolver(_dataRepository!);
_smsExtractor = SmsExtractorService(_urlMatcher!, _categoryMapper!); _smsExtractor = SmsExtractorService(_urlMatcher!, _categoryMapper!);
} }
@@ -67,7 +68,8 @@ class SubscriptionUrlMatcher {
/// 서비스에 공식 해지 안내 페이지가 있는지 확인 /// 서비스에 공식 해지 안내 페이지가 있는지 확인
static Future<bool> hasCancellationPage(String serviceNameOrUrl) async { static Future<bool> hasCancellationPage(String serviceNameOrUrl) async {
await initialize(); await initialize();
return await _cancellationService?.hasCancellationPage(serviceNameOrUrl) ?? false; return await _cancellationService?.hasCancellationPage(serviceNameOrUrl) ??
false;
} }
/// 서비스명으로 카테고리 찾기 /// 서비스명으로 카테고리 찾기
@@ -85,7 +87,8 @@ class SubscriptionUrlMatcher {
return await _nameResolver?.getServiceDisplayName( return await _nameResolver?.getServiceDisplayName(
serviceName: serviceName, serviceName: serviceName,
locale: locale, locale: locale,
) ?? serviceName; ) ??
serviceName;
} }
/// SMS에서 URL과 서비스 정보 추출 /// SMS에서 URL과 서비스 정보 추출

View File

@@ -11,7 +11,8 @@ class ServiceDataRepository {
if (_isInitialized) return; if (_isInitialized) return;
try { try {
final jsonString = await rootBundle.loadString('assets/data/subscription_services.json'); final jsonString =
await rootBundle.loadString('assets/data/subscription_services.json');
_servicesData = json.decode(jsonString); _servicesData = json.decode(jsonString);
_isInitialized = true; _isInitialized = true;
print('ServiceDataRepository: JSON 데이터 로드 완료'); print('ServiceDataRepository: JSON 데이터 로드 완료');

View File

@@ -25,14 +25,18 @@ class CancellationUrlService {
final lowerName = serviceName.toLowerCase().trim(); final lowerName = serviceName.toLowerCase().trim();
for (final categoryData in categories.values) { for (final categoryData in categories.values) {
final services = (categoryData as Map<String, dynamic>)['services'] as Map<String, dynamic>; final services = (categoryData as Map<String, dynamic>)['services']
as Map<String, dynamic>;
for (final serviceData in services.values) { for (final serviceData in services.values) {
final names = List<String>.from((serviceData as Map<String, dynamic>)['names'] ?? []); final names = List<String>.from(
(serviceData as Map<String, dynamic>)['names'] ?? []);
for (final name in names) { for (final name in names) {
if (lowerName.contains(name.toLowerCase()) || name.toLowerCase().contains(lowerName)) { if (lowerName.contains(name.toLowerCase()) ||
final cancellationUrls = serviceData['cancellationUrls'] as Map<String, dynamic>?; name.toLowerCase().contains(lowerName)) {
final cancellationUrls =
serviceData['cancellationUrls'] as Map<String, dynamic>?;
if (cancellationUrls != null) { if (cancellationUrls != null) {
// 요청한 언어의 URL이 있으면 반환, 없으면 다른 언어 URL 반환 // 요청한 언어의 URL이 있으면 반환, 없으면 다른 언어 URL 반환
return cancellationUrls[locale] ?? return cancellationUrls[locale] ??
@@ -49,14 +53,18 @@ class CancellationUrlService {
final domain = _urlMatcher.extractDomain(websiteUrl); final domain = _urlMatcher.extractDomain(websiteUrl);
if (domain != null) { if (domain != null) {
for (final categoryData in categories.values) { for (final categoryData in categories.values) {
final services = (categoryData as Map<String, dynamic>)['services'] as Map<String, dynamic>; final services = (categoryData as Map<String, dynamic>)['services']
as Map<String, dynamic>;
for (final serviceData in services.values) { for (final serviceData in services.values) {
final domains = List<String>.from((serviceData as Map<String, dynamic>)['domains'] ?? []); final domains = List<String>.from(
(serviceData as Map<String, dynamic>)['domains'] ?? []);
for (final serviceDomain in domains) { for (final serviceDomain in domains) {
if (domain.contains(serviceDomain) || serviceDomain.contains(domain)) { if (domain.contains(serviceDomain) ||
final cancellationUrls = serviceData['cancellationUrls'] as Map<String, dynamic>?; serviceDomain.contains(domain)) {
final cancellationUrls =
serviceData['cancellationUrls'] as Map<String, dynamic>?;
if (cancellationUrls != null) { if (cancellationUrls != null) {
return cancellationUrls[locale] ?? return cancellationUrls[locale] ??
cancellationUrls[locale == 'kr' ? 'en' : 'kr']; cancellationUrls[locale == 'kr' ? 'en' : 'kr'];

View File

@@ -24,10 +24,12 @@ class CategoryMapperService {
final services = categoryData['services'] as Map<String, dynamic>; final services = categoryData['services'] as Map<String, dynamic>;
for (final serviceData in services.values) { for (final serviceData in services.values) {
final names = List<String>.from((serviceData as Map<String, dynamic>)['names'] ?? []); final names = List<String>.from(
(serviceData as Map<String, dynamic>)['names'] ?? []);
for (final name in names) { for (final name in names) {
if (lowerName.contains(name.toLowerCase()) || name.toLowerCase().contains(lowerName)) { if (lowerName.contains(name.toLowerCase()) ||
name.toLowerCase().contains(lowerName)) {
return getCategoryIdByKey(categoryId); return getCategoryIdByKey(categoryId);
} }
} }
@@ -73,15 +75,24 @@ class CategoryMapperService {
String getCategoryForLegacyService(String serviceName) { String getCategoryForLegacyService(String serviceName) {
final lowerName = serviceName.toLowerCase(); final lowerName = serviceName.toLowerCase();
if (LegacyServiceData.ottServices.containsKey(lowerName)) return 'ott_services'; if (LegacyServiceData.ottServices.containsKey(lowerName))
if (LegacyServiceData.musicServices.containsKey(lowerName)) return 'music_streaming'; return 'ott_services';
if (LegacyServiceData.storageServices.containsKey(lowerName)) return 'cloud_storage'; if (LegacyServiceData.musicServices.containsKey(lowerName))
if (LegacyServiceData.aiServices.containsKey(lowerName)) return 'ai_services'; return 'music_streaming';
if (LegacyServiceData.programmingServices.containsKey(lowerName)) return 'dev_tools'; if (LegacyServiceData.storageServices.containsKey(lowerName))
if (LegacyServiceData.officeTools.containsKey(lowerName)) return 'office_tools'; return 'cloud_storage';
if (LegacyServiceData.lifestyleServices.containsKey(lowerName)) return 'lifestyle'; if (LegacyServiceData.aiServices.containsKey(lowerName))
if (LegacyServiceData.shoppingServices.containsKey(lowerName)) return 'shopping'; return 'ai_services';
if (LegacyServiceData.telecomServices.containsKey(lowerName)) return 'telecom'; if (LegacyServiceData.programmingServices.containsKey(lowerName))
return 'dev_tools';
if (LegacyServiceData.officeTools.containsKey(lowerName))
return 'office_tools';
if (LegacyServiceData.lifestyleServices.containsKey(lowerName))
return 'lifestyle';
if (LegacyServiceData.shoppingServices.containsKey(lowerName))
return 'shopping';
if (LegacyServiceData.telecomServices.containsKey(lowerName))
return 'telecom';
return 'other'; return 'other';
} }

View File

@@ -21,7 +21,8 @@ class ServiceNameResolver {
// JSON에서 서비스 찾기 // JSON에서 서비스 찾기
for (final categoryData in categories.values) { for (final categoryData in categories.values) {
final services = (categoryData as Map<String, dynamic>)['services'] as Map<String, dynamic>; final services = (categoryData as Map<String, dynamic>)['services']
as Map<String, dynamic>;
for (final serviceData in services.values) { for (final serviceData in services.values) {
final data = serviceData as Map<String, dynamic>; final data = serviceData as Map<String, dynamic>;

View File

@@ -36,7 +36,9 @@ class SmsExtractorService {
// 모든 서비스명 검사 // 모든 서비스명 검사
for (final entry in LegacyServiceData.allServices.entries) { for (final entry in LegacyServiceData.allServices.entries) {
if (lowerSms.contains(entry.key.toLowerCase())) { if (lowerSms.contains(entry.key.toLowerCase())) {
final categoryId = await _categoryMapper.findCategoryByServiceName(entry.key) ?? 'other'; final categoryId =
await _categoryMapper.findCategoryByServiceName(entry.key) ??
'other';
return ServiceInfo( return ServiceInfo(
serviceId: entry.key, serviceId: entry.key,

View File

@@ -62,7 +62,8 @@ class UrlMatcherService {
// 도메인이 일치하는지 확인 // 도메인이 일치하는지 확인
for (final serviceDomain in domains) { for (final serviceDomain in domains) {
if (domain.contains(serviceDomain) || serviceDomain.contains(domain)) { if (domain.contains(serviceDomain) ||
serviceDomain.contains(domain)) {
final names = List<String>.from(serviceData['names'] ?? []); final names = List<String>.from(serviceData['names'] ?? []);
final urls = serviceData['urls'] as Map<String, dynamic>?; final urls = serviceData['urls'] as Map<String, dynamic>?;

View File

@@ -22,21 +22,19 @@ class AdaptiveTheme {
background: const Color(0xFF121212), background: const Color(0xFF121212),
surface: const Color(0xFF1E1E1E), surface: const Color(0xFF1E1E1E),
), ),
scaffoldBackgroundColor: const Color(0xFF121212), scaffoldBackgroundColor: const Color(0xFF121212),
cardTheme: CardThemeData( cardTheme: CardThemeData(
color: const Color(0xFF1E1E1E), color: const Color(0xFF1E1E1E),
elevation: 2, elevation: 2,
shadowColor: Colors.black.withValues(alpha: 0.3), shadowColor: Colors.black.withValues(alpha: 0.3),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
side: BorderSide(color: Colors.white.withValues(alpha: 0.1), width: 0.5), side: BorderSide(
color: Colors.white.withValues(alpha: 0.1), width: 0.5),
), ),
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
margin: const EdgeInsets.symmetric(vertical: 8, horizontal: 16), margin: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
), ),
appBarTheme: AppBarTheme( appBarTheme: AppBarTheme(
backgroundColor: const Color(0xFF1E1E1E), backgroundColor: const Color(0xFF1E1E1E),
foregroundColor: Colors.white, foregroundColor: Colors.white,
@@ -53,7 +51,6 @@ class AdaptiveTheme {
size: 24, size: 24,
), ),
), ),
textTheme: TextTheme( textTheme: TextTheme(
headlineLarge: const TextStyle( headlineLarge: const TextStyle(
color: Colors.white, color: Colors.white,
@@ -119,22 +116,24 @@ class AdaptiveTheme {
height: 1.5, height: 1.5,
), ),
), ),
inputDecorationTheme: InputDecorationTheme( inputDecorationTheme: InputDecorationTheme(
filled: true, filled: true,
fillColor: const Color(0xFF2A2A2A), fillColor: const Color(0xFF2A2A2A),
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16), contentPadding:
const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
borderSide: BorderSide.none, borderSide: BorderSide.none,
), ),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
borderSide: BorderSide(color: Colors.white.withValues(alpha: 0.1), width: 1), borderSide:
BorderSide(color: Colors.white.withValues(alpha: 0.1), width: 1),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(color: AppColors.primaryColor, width: 1.5), borderSide:
const BorderSide(color: AppColors.primaryColor, width: 1.5),
), ),
errorBorder: OutlineInputBorder( errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
@@ -151,7 +150,6 @@ class AdaptiveTheme {
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
), ),
), ),
elevatedButtonTheme: ElevatedButtonThemeData( elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: AppColors.primaryColor, backgroundColor: AppColors.primaryColor,
@@ -164,7 +162,6 @@ class AdaptiveTheme {
elevation: 0, elevation: 0,
), ),
), ),
dividerTheme: DividerThemeData( dividerTheme: DividerThemeData(
color: Colors.white.withValues(alpha: 0.1), color: Colors.white.withValues(alpha: 0.1),
thickness: 1, thickness: 1,
@@ -206,7 +203,6 @@ class AdaptiveTheme {
background: Colors.white, background: Colors.white,
surface: Colors.white, surface: Colors.white,
), ),
textTheme: const TextTheme( textTheme: const TextTheme(
headlineLarge: TextStyle( headlineLarge: TextStyle(
color: Colors.black, color: Colors.black,
@@ -234,7 +230,6 @@ class AdaptiveTheme {
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
), ),
cardTheme: CardThemeData( cardTheme: CardThemeData(
elevation: 0, elevation: 0,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@@ -242,7 +237,6 @@ class AdaptiveTheme {
side: const BorderSide(color: Colors.black, width: 2), side: const BorderSide(color: Colors.black, width: 2),
), ),
), ),
elevatedButtonTheme: ElevatedButtonThemeData( elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: Colors.black, backgroundColor: Colors.black,
@@ -263,20 +257,17 @@ class AdaptiveTheme {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle( SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarColor: Colors.transparent, statusBarColor: Colors.transparent,
statusBarIconBrightness: brightness == Brightness.dark statusBarIconBrightness:
? Brightness.light brightness == Brightness.dark ? Brightness.light : Brightness.dark,
: Brightness.dark, statusBarBrightness:
statusBarBrightness: brightness == Brightness.dark brightness == Brightness.dark ? Brightness.light : Brightness.dark,
? Brightness.light
: Brightness.dark,
systemNavigationBarColor: isOled systemNavigationBarColor: isOled
? Colors.black ? Colors.black
: (brightness == Brightness.dark : (brightness == Brightness.dark
? const Color(0xFF121212) ? const Color(0xFF121212)
: Colors.white), : Colors.white),
systemNavigationBarIconBrightness: brightness == Brightness.dark systemNavigationBarIconBrightness:
? Brightness.light brightness == Brightness.dark ? Brightness.light : Brightness.dark,
: Brightness.dark,
)); ));
} }

View File

@@ -63,9 +63,8 @@ class MemoryManager {
/// 특정 패턴의 캐시 제거 /// 특정 패턴의 캐시 제거
void clearCacheByPattern(String pattern) { void clearCacheByPattern(String pattern) {
final keysToRemove = _cache.keys final keysToRemove =
.where((key) => key.contains(pattern)) _cache.keys.where((key) => key.contains(pattern)).toList();
.toList();
for (final key in keysToRemove) { for (final key in keysToRemove) {
_cache.remove(key); _cache.remove(key);
@@ -139,9 +138,7 @@ class MemoryManager {
/// 살아있는 위젯 수 확인 /// 살아있는 위젯 수 확인
int getAliveWidgetCount() { int getAliveWidgetCount() {
return _widgetReferences.values return _widgetReferences.values.where((ref) => ref.target != null).length;
.where((ref) => ref.target != null)
.length;
} }
/// 메모리 압박 시 대응 /// 메모리 압박 시 대응
@@ -231,7 +228,8 @@ class ImageCacheStatus {
}); });
double get sizeUsagePercentage => (currentSize / maximumSize) * 100; double get sizeUsagePercentage => (currentSize / maximumSize) * 100;
double get bytesUsagePercentage => (currentSizeBytes / maximumSizeBytes) * 100; double get bytesUsagePercentage =>
(currentSizeBytes / maximumSizeBytes) * 100;
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
'currentSize': currentSize, 'currentSize': currentSize,
@@ -263,10 +261,8 @@ class MemoryEfficientListView<T> extends StatefulWidget {
_MemoryEfficientListViewState<T>(); _MemoryEfficientListViewState<T>();
} }
class _MemoryEfficientListViewState<T> class _MemoryEfficientListViewState<T> extends State<MemoryEfficientListView<T>>
extends State<MemoryEfficientListView<T>>
with AutomaticKeepAliveClientMixin { with AutomaticKeepAliveClientMixin {
@override @override
bool get wantKeepAlive => false; bool get wantKeepAlive => false;

View File

@@ -5,7 +5,8 @@ import 'dart:async';
/// 성능 최적화를 위한 유틸리티 클래스 /// 성능 최적화를 위한 유틸리티 클래스
class PerformanceOptimizer { class PerformanceOptimizer {
static final PerformanceOptimizer _instance = PerformanceOptimizer._internal(); static final PerformanceOptimizer _instance =
PerformanceOptimizer._internal();
factory PerformanceOptimizer() => _instance; factory PerformanceOptimizer() => _instance;
PerformanceOptimizer._internal(); PerformanceOptimizer._internal();
@@ -104,7 +105,8 @@ class PerformanceOptimizer {
} }
/// 이미지 최적화 - 메모리 효율적인 크기로 조정 /// 이미지 최적화 - 메모리 효율적인 크기로 조정
static double getOptimalImageSize(BuildContext context, { static double getOptimalImageSize(
BuildContext context, {
required double originalSize, required double originalSize,
double maxSize = 1000, double maxSize = 1000,
}) { }) {
@@ -154,8 +156,8 @@ class PerformanceOptimizer {
static void trackWidget(String widgetName, bool isCreated) { static void trackWidget(String widgetName, bool isCreated) {
if (!kDebugMode) return; if (!kDebugMode) return;
_widgetCounts[widgetName] = (_widgetCounts[widgetName] ?? 0) + _widgetCounts[widgetName] =
(isCreated ? 1 : -1); (_widgetCounts[widgetName] ?? 0) + (isCreated ? 1 : -1);
// 위젯이 비정상적으로 많이 생성되면 경고 // 위젯이 비정상적으로 많이 생성되면 경고
if ((_widgetCounts[widgetName] ?? 0) > 100) { if ((_widgetCounts[widgetName] ?? 0) > 100) {
@@ -176,8 +178,10 @@ class MemoryInfo {
double get usagePercentage => (currentUsage / capacity) * 100; double get usagePercentage => (currentUsage / capacity) * 100;
String get formattedUsage => '${(currentUsage / 1024 / 1024).toStringAsFixed(2)} MB'; String get formattedUsage =>
String get formattedCapacity => '${(capacity / 1024 / 1024).toStringAsFixed(2)} MB'; '${(currentUsage / 1024 / 1024).toStringAsFixed(2)} MB';
String get formattedCapacity =>
'${(capacity / 1024 / 1024).toStringAsFixed(2)} MB';
} }
/// 성능 측정 데코레이터 /// 성능 측정 데코레이터

View File

@@ -86,8 +86,8 @@ class SubscriptionCategoryHelper {
categorizedSubscriptions['shoppingEcommerce']!.add(subscription); categorizedSubscriptions['shoppingEcommerce']!.add(subscription);
} }
// 프로그래밍 // 프로그래밍
else if (_isInCategory(subscription.serviceName, else if (_isInCategory(
LegacyServiceData.programmingServices)) { subscription.serviceName, LegacyServiceData.programmingServices)) {
if (!categorizedSubscriptions.containsKey('programming')) { if (!categorizedSubscriptions.containsKey('programming')) {
categorizedSubscriptions['programming'] = []; categorizedSubscriptions['programming'] = [];
} }

View File

@@ -6,7 +6,8 @@ import '../../controllers/add_subscription_controller.dart';
import '../../l10n/app_localizations.dart'; import '../../l10n/app_localizations.dart';
/// 구독 추가 화면의 App Bar /// 구독 추가 화면의 App Bar
class AddSubscriptionAppBar extends StatelessWidget implements PreferredSizeWidget { class AddSubscriptionAppBar extends StatelessWidget
implements PreferredSizeWidget {
final AddSubscriptionController controller; final AddSubscriptionController controller;
final double scrollOffset; final double scrollOffset;
final VoidCallback onScanSMS; final VoidCallback onScanSMS;

View File

@@ -66,7 +66,8 @@ class AddSubscriptionEventSection extends StatelessWidget {
Container( Container(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
color: controller.gradientColors[0].withValues(alpha: 0.1), color: controller.gradientColors[0]
.withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
), ),
child: Icon( child: Icon(
@@ -155,7 +156,8 @@ class AddSubscriptionEventSection extends StatelessWidget {
Expanded( Expanded(
child: Builder( child: Builder(
builder: (context) { builder: (context) {
final locale = Localizations.localeOf(context); final locale =
Localizations.localeOf(context);
String infoText; String infoText;
switch (locale.languageCode) { switch (locale.languageCode) {
case 'ko': case 'ko':
@@ -168,7 +170,8 @@ class AddSubscriptionEventSection extends StatelessWidget {
infoText = '设置折扣或促销价格'; infoText = '设置折扣或促销价格';
break; break;
default: default:
infoText = 'Set up discount or promotion price'; infoText =
'Set up discount or promotion price';
} }
return Text( return Text(
infoText, infoText,
@@ -216,8 +219,10 @@ class AddSubscriptionEventSection extends StatelessWidget {
setState(() { setState(() {
controller.eventStartDate = date; controller.eventStartDate = date;
// 시작일 설정 시 종료일이 없으면 자동으로 1달 후로 설정 // 시작일 설정 시 종료일이 없으면 자동으로 1달 후로 설정
if (date != null && controller.eventEndDate == null) { if (date != null &&
controller.eventEndDate = date.add(const Duration(days: 30)); controller.eventEndDate == null) {
controller.eventEndDate =
date.add(const Duration(days: 30));
} }
}); });
}, },
@@ -238,7 +243,8 @@ class AddSubscriptionEventSection extends StatelessWidget {
Builder( Builder(
builder: (BuildContext innerContext) { builder: (BuildContext innerContext) {
// 현재 로케일 확인 // 현재 로케일 확인
final currentLocale = Localizations.localeOf(innerContext); final currentLocale =
Localizations.localeOf(innerContext);
// 로케일에 따라 직접 텍스트 설정 // 로케일에 따라 직접 텍스트 설정
String eventPriceLabel; String eventPriceLabel;

View File

@@ -69,13 +69,17 @@ class AnalysisBadge extends StatelessWidget {
String displayText = amountText; String displayText = amountText;
if (amountText.length > 12) { if (amountText.length > 12) {
// 괄호 안의 내용 제거 // 괄호 안의 내용 제거
displayText = amountText.replaceAll(RegExp(r'\([^)]*\)'), '').trim(); displayText =
amountText.replaceAll(RegExp(r'\([^)]*\)'), '').trim();
} }
if (displayText.length > 10) { if (displayText.length > 10) {
// 통화 기호만 남기고 숫자만 표시 // 통화 기호만 남기고 숫자만 표시
final currencySymbol = CurrencyUtil.getCurrencySymbol(subscription.currency); final currencySymbol =
displayText = displayText.replaceAll(currencySymbol, '').trim(); CurrencyUtil.getCurrencySymbol(subscription.currency);
displayText = '$currencySymbol${displayText.substring(0, 6)}...'; displayText =
displayText.replaceAll(currencySymbol, '').trim();
displayText =
'$currencySymbol${displayText.substring(0, 6)}...';
} }
return Text( return Text(
displayText, displayText,

View File

@@ -48,10 +48,12 @@ class EventAnalysisCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
ThemedText.headline( ThemedText.headline(
text: AppLocalizations.of(context).eventDiscountStatus, text: AppLocalizations.of(context)
.eventDiscountStatus,
style: const TextStyle( style: const TextStyle(
fontSize: 18, fontSize: 18,
), ),
@@ -79,7 +81,10 @@ class EventAnalysisCard extends StatelessWidget {
), ),
const SizedBox(width: 4), const SizedBox(width: 4),
Text( Text(
AppLocalizations.of(context).servicesInProgress(provider.activeEventSubscriptions.length), AppLocalizations.of(context)
.servicesInProgress(provider
.activeEventSubscriptions
.length),
style: const TextStyle( style: const TextStyle(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@@ -97,15 +102,18 @@ class EventAnalysisCard extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: LinearGradient( gradient: LinearGradient(
colors: [ colors: [
const Color(0xFFFF6B6B).withValues(alpha: 0.1), const Color(0xFFFF6B6B)
const Color(0xFFFF8787).withValues(alpha: 0.1), .withValues(alpha: 0.1),
const Color(0xFFFF8787)
.withValues(alpha: 0.1),
], ],
begin: Alignment.topLeft, begin: Alignment.topLeft,
end: Alignment.bottomRight, end: Alignment.bottomRight,
), ),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: Border.all( border: Border.all(
color: const Color(0xFFFF6B6B).withValues(alpha: 0.3), color: const Color(0xFFFF6B6B)
.withValues(alpha: 0.3),
), ),
), ),
child: Row( child: Row(
@@ -118,10 +126,12 @@ class EventAnalysisCard extends StatelessWidget {
const SizedBox(width: 12), const SizedBox(width: 12),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
ThemedText( ThemedText(
AppLocalizations.of(context).monthlySavingAmount, AppLocalizations.of(context)
.monthlySavingAmount,
style: const TextStyle( style: const TextStyle(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@@ -154,24 +164,29 @@ class EventAnalysisCard extends StatelessWidget {
), ),
const SizedBox(height: 12), const SizedBox(height: 12),
...provider.activeEventSubscriptions.map((sub) { ...provider.activeEventSubscriptions.map((sub) {
final savings = sub.originalPrice - (sub.eventPrice ?? sub.originalPrice); final savings = sub.originalPrice -
(sub.eventPrice ?? sub.originalPrice);
final discountRate = final discountRate =
((savings / sub.originalPrice) * 100).round(); ((savings / sub.originalPrice) * 100)
.round();
return Container( return Container(
margin: const EdgeInsets.only(bottom: 8), margin: const EdgeInsets.only(bottom: 8),
padding: const EdgeInsets.all(12), padding: const EdgeInsets.all(12),
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.darkNavy.withValues(alpha: 0.05), color: AppColors.darkNavy
.withValues(alpha: 0.05),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: Border.all( border: Border.all(
color: AppColors.darkNavy.withValues(alpha: 0.1), color: AppColors.darkNavy
.withValues(alpha: 0.1),
), ),
), ),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
ThemedText( ThemedText(
sub.serviceName, sub.serviceName,
@@ -184,8 +199,8 @@ class EventAnalysisCard extends StatelessWidget {
Row( Row(
children: [ children: [
FutureBuilder<String>( FutureBuilder<String>(
future: CurrencyUtil future:
.formatAmount( CurrencyUtil.formatAmount(
sub.originalPrice, sub.originalPrice,
sub.currency), sub.currency),
builder: (context, snapshot) { builder: (context, snapshot) {
@@ -194,9 +209,11 @@ class EventAnalysisCard extends StatelessWidget {
snapshot.data!, snapshot.data!,
style: const TextStyle( style: const TextStyle(
fontSize: 12, fontSize: 12,
decoration: TextDecoration decoration:
TextDecoration
.lineThrough, .lineThrough,
color: AppColors.navyGray, color: AppColors
.navyGray,
), ),
); );
} }
@@ -211,9 +228,10 @@ class EventAnalysisCard extends StatelessWidget {
), ),
const SizedBox(width: 8), const SizedBox(width: 8),
FutureBuilder<String>( FutureBuilder<String>(
future: CurrencyUtil future:
.formatAmount( CurrencyUtil.formatAmount(
sub.eventPrice ?? sub.originalPrice, sub.eventPrice ??
sub.originalPrice,
sub.currency), sub.currency),
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasData) { if (snapshot.hasData) {
@@ -244,7 +262,8 @@ class EventAnalysisCard extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: const Color(0xFFFF6B6B) color: const Color(0xFFFF6B6B)
.withValues(alpha: 0.2), .withValues(alpha: 0.2),
borderRadius: BorderRadius.circular(4), borderRadius:
BorderRadius.circular(4),
), ),
child: Text( child: Text(
'$discountRate${AppLocalizations.of(context).discountPercent}', '$discountRate${AppLocalizations.of(context).discountPercent}',

View File

@@ -35,7 +35,8 @@ class MonthlyExpenseChartCard extends StatelessWidget {
if (maxValue <= 1000000) return 1000000; if (maxValue <= 1000000) return 1000000;
// 큰 금액은 자릿수에 맞춰 반올림 // 큰 금액은 자릿수에 맞춰 반올림
final magnitude = math.pow(10, maxValue.toString().split('.')[0].length - 1).toDouble(); final magnitude =
math.pow(10, maxValue.toString().split('.')[0].length - 1).toDouble();
return ((maxValue / magnitude).ceil() * magnitude).toDouble(); return ((maxValue / magnitude).ceil() * magnitude).toDouble();
} else { } else {
// 소수점이 있는 통화 (달러, 위안) // 소수점이 있는 통화 (달러, 위안)
@@ -164,8 +165,7 @@ class MonthlyExpenseChartCard extends StatelessWidget {
0, 0,
(max, data) => math.max( (max, data) => math.max(
max, data['totalExpense'] as double)), max, data['totalExpense'] as double)),
locale locale),
),
barGroups: _getMonthlyBarGroups(locale), barGroups: _getMonthlyBarGroups(locale),
gridData: FlGridData( gridData: FlGridData(
show: true, show: true,
@@ -176,13 +176,12 @@ class MonthlyExpenseChartCard extends StatelessWidget {
0, 0,
(max, data) => math.max(max, (max, data) => math.max(max,
data['totalExpense'] as double)), data['totalExpense'] as double)),
locale locale),
), CurrencyUtil.getDefaultCurrency(locale)),
CurrencyUtil.getDefaultCurrency(locale)
),
getDrawingHorizontalLine: (value) { getDrawingHorizontalLine: (value) {
return FlLine( return FlLine(
color: AppColors.navyGray.withValues(alpha: 0.1), color:
AppColors.navyGray.withValues(alpha: 0.1),
strokeWidth: 1, strokeWidth: 1,
); );
}, },
@@ -233,9 +232,10 @@ class MonthlyExpenseChartCard extends StatelessWidget {
), ),
children: [ children: [
TextSpan( TextSpan(
text: CurrencyUtil.formatTotalAmountWithLocale( text: CurrencyUtil
monthlyData[group.x]['totalExpense'] .formatTotalAmountWithLocale(
as double, monthlyData[group.x]
['totalExpense'] as double,
locale), locale),
style: const TextStyle( style: const TextStyle(
color: Color(0xFFFBBF24), color: Color(0xFFFBBF24),
@@ -254,7 +254,8 @@ class MonthlyExpenseChartCard extends StatelessWidget {
const SizedBox(height: 16), const SizedBox(height: 16),
Center( Center(
child: ThemedText.caption( child: ThemedText.caption(
text: AppLocalizations.of(context).monthlySubscriptionExpense, text: AppLocalizations.of(context)
.monthlySubscriptionExpense,
style: const TextStyle( style: const TextStyle(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,

View File

@@ -23,7 +23,8 @@ class SubscriptionPieChartCard extends StatefulWidget {
}); });
@override @override
State<SubscriptionPieChartCard> createState() => _SubscriptionPieChartCardState(); State<SubscriptionPieChartCard> createState() =>
_SubscriptionPieChartCardState();
} }
class _SubscriptionPieChartCardState extends State<SubscriptionPieChartCard> { class _SubscriptionPieChartCardState extends State<SubscriptionPieChartCard> {
@@ -78,7 +79,6 @@ class _SubscriptionPieChartCardState extends State<SubscriptionPieChartCard> {
// 파이 차트 섹션 데이터 (언어별 기본 통화로 환산) // 파이 차트 섹션 데이터 (언어별 기본 통화로 환산)
Future<List<PieChartSectionData>> _getPieSections() async { Future<List<PieChartSectionData>> _getPieSections() async {
if (widget.subscriptions.isEmpty) return []; if (widget.subscriptions.isEmpty) return [];
// 현재 locale 가져오기 // 현재 locale 가져오기
@@ -97,11 +97,13 @@ class _SubscriptionPieChartCardState extends State<SubscriptionPieChartCard> {
sectionValues.add(value); sectionValues.add(value);
} else if (subscription.currency == 'USD') { } else if (subscription.currency == 'USD') {
// USD를 기본 통화로 변환 // USD를 기본 통화로 변환
final converted = await ExchangeRateService().convertUsdToTarget(value, defaultCurrency); final converted = await ExchangeRateService()
.convertUsdToTarget(value, defaultCurrency);
sectionValues.add(converted ?? value); sectionValues.add(converted ?? value);
} else if (defaultCurrency == 'USD') { } else if (defaultCurrency == 'USD') {
// 기본 통화가 USD인 경우 다른 통화를 USD로 변환 // 기본 통화가 USD인 경우 다른 통화를 USD로 변환
final converted = await ExchangeRateService().convertTargetToUsd(value, subscription.currency); final converted = await ExchangeRateService()
.convertTargetToUsd(value, subscription.currency);
sectionValues.add(converted ?? value); sectionValues.add(converted ?? value);
} else { } else {
// 기타 통화는 일단 그대로 사용 (환율 정보가 없는 경우) // 기타 통화는 일단 그대로 사용 (환율 정보가 없는 경우)
@@ -159,7 +161,8 @@ class _SubscriptionPieChartCardState extends State<SubscriptionPieChartCard> {
} }
// 터치 상태를 반영한 섹션 데이터 생성 // 터치 상태를 반영한 섹션 데이터 생성
List<PieChartSectionData> _applyTouchedState(List<PieChartSectionData> sections) { List<PieChartSectionData> _applyTouchedState(
List<PieChartSectionData> sections) {
return List.generate(sections.length, (i) { return List.generate(sections.length, (i) {
final section = sections[i]; final section = sections[i];
final isTouched = _touchedIndex == i; final isTouched = _touchedIndex == i;
@@ -169,12 +172,14 @@ class _SubscriptionPieChartCardState extends State<SubscriptionPieChartCard> {
return PieChartSectionData( return PieChartSectionData(
value: section.value, value: section.value,
title: section.title, title: section.title,
titleStyle: section.titleStyle?.copyWith(fontSize: fontSize) ?? TextStyle( titleStyle: section.titleStyle?.copyWith(fontSize: fontSize) ??
TextStyle(
fontSize: fontSize, fontSize: fontSize,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: AppColors.pureWhite, color: AppColors.pureWhite,
shadows: const [ shadows: const [
Shadow(color: Colors.black26, blurRadius: 2, offset: Offset(0, 1)) Shadow(
color: Colors.black26, blurRadius: 2, offset: Offset(0, 1))
], ],
), ),
color: section.color, color: section.color,
@@ -217,18 +222,20 @@ class _SubscriptionPieChartCardState extends State<SubscriptionPieChartCard> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
ThemedText.headline( ThemedText.headline(
text: AppLocalizations.of(context).subscriptionServiceRatio, text: AppLocalizations.of(context)
.subscriptionServiceRatio,
style: const TextStyle( style: const TextStyle(
fontSize: 18, fontSize: 18,
), ),
), ),
FutureBuilder<String>( FutureBuilder<String>(
future: CurrencyUtil.getExchangeRateInfoForLocale( future: CurrencyUtil.getExchangeRateInfoForLocale(
context.watch<LocaleProvider>().locale.languageCode context
), .watch<LocaleProvider>()
.locale
.languageCode),
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasData && if (snapshot.hasData && snapshot.data!.isNotEmpty) {
snapshot.data!.isNotEmpty) {
return Container( return Container(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 8, horizontal: 8,
@@ -236,15 +243,15 @@ class _SubscriptionPieChartCardState extends State<SubscriptionPieChartCard> {
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: const Color(0xFFE5F2FF), color: const Color(0xFFE5F2FF),
borderRadius: borderRadius: BorderRadius.circular(4),
BorderRadius.circular(4),
border: Border.all( border: Border.all(
color: const Color(0xFFBFDBFE), color: const Color(0xFFBFDBFE),
width: 1, width: 1,
), ),
), ),
child: Text( child: Text(
AppLocalizations.of(context).exchangeRateFormat(snapshot.data!), AppLocalizations.of(context)
.exchangeRateFormat(snapshot.data!),
style: const TextStyle( style: const TextStyle(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@@ -272,7 +279,8 @@ class _SubscriptionPieChartCardState extends State<SubscriptionPieChartCard> {
height: 250, height: 250,
child: Center( child: Center(
child: ThemedText( child: ThemedText(
AppLocalizations.of(context).noSubscriptionServices, AppLocalizations.of(context)
.noSubscriptionServices,
style: const TextStyle( style: const TextStyle(
fontSize: 16, fontSize: 16,
), ),
@@ -284,16 +292,19 @@ class _SubscriptionPieChartCardState extends State<SubscriptionPieChartCard> {
child: FutureBuilder<List<PieChartSectionData>>( child: FutureBuilder<List<PieChartSectionData>>(
future: _pieSectionsFuture, future: _pieSectionsFuture,
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) { if (snapshot.connectionState ==
ConnectionState.waiting) {
return const Center( return const Center(
child: CircularProgressIndicator(), child: CircularProgressIndicator(),
); );
} }
if (!snapshot.hasData || snapshot.data!.isEmpty) { if (!snapshot.hasData ||
snapshot.data!.isEmpty) {
return Center( return Center(
child: ThemedText( child: ThemedText(
AppLocalizations.of(context).noSubscriptionServices, AppLocalizations.of(context)
.noSubscriptionServices,
style: const TextStyle( style: const TextStyle(
fontSize: 16, fontSize: 16,
), ),
@@ -306,14 +317,16 @@ class _SubscriptionPieChartCardState extends State<SubscriptionPieChartCard> {
borderData: FlBorderData(show: false), borderData: FlBorderData(show: false),
sectionsSpace: 2, sectionsSpace: 2,
centerSpaceRadius: 60, centerSpaceRadius: 60,
sections: _applyTouchedState(snapshot.data!), sections:
_applyTouchedState(snapshot.data!),
pieTouchData: PieTouchData( pieTouchData: PieTouchData(
enabled: true, enabled: true,
touchCallback: (FlTouchEvent event, touchCallback: (FlTouchEvent event,
pieTouchResponse) { pieTouchResponse) {
// 터치 응답이 없거나 섹션이 없는 경우 // 터치 응답이 없거나 섹션이 없는 경우
if (pieTouchResponse == null || if (pieTouchResponse == null ||
pieTouchResponse.touchedSection == null) { pieTouchResponse.touchedSection ==
null) {
// 차트 밖으로 나갔을 때만 리셋 // 차트 밖으로 나갔을 때만 리셋
if (_touchedIndex != -1) { if (_touchedIndex != -1) {
setState(() { setState(() {
@@ -331,7 +344,10 @@ class _SubscriptionPieChartCardState extends State<SubscriptionPieChartCard> {
if (event is FlTapUpEvent) { if (event is FlTapUpEvent) {
setState(() { setState(() {
// 동일 섹션 탭하면 선택 해제, 아니면 선택 // 동일 섹션 탭하면 선택 해제, 아니면 선택
_touchedIndex = (_touchedIndex == touchedIndex) ? -1 : touchedIndex; _touchedIndex = (_touchedIndex ==
touchedIndex)
? -1
: touchedIndex;
}); });
return; return;
} }
@@ -364,10 +380,10 @@ class _SubscriptionPieChartCardState extends State<SubscriptionPieChartCard> {
(index) { (index) {
final subscription = final subscription =
widget.subscriptions[index]; widget.subscriptions[index];
final color = _chartColors[index % _chartColors.length]; final color =
_chartColors[index % _chartColors.length];
return Padding( return Padding(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(bottom: 4.0),
bottom: 4.0),
child: Row( child: Row(
children: [ children: [
Container( Container(
@@ -385,31 +401,31 @@ class _SubscriptionPieChartCardState extends State<SubscriptionPieChartCard> {
style: const TextStyle( style: const TextStyle(
fontSize: 14, fontSize: 14,
), ),
overflow: overflow: TextOverflow.ellipsis,
TextOverflow.ellipsis,
), ),
), ),
FutureBuilder<String>( FutureBuilder<String>(
future: CurrencyUtil future: CurrencyUtil
.formatSubscriptionAmountWithLocale( .formatSubscriptionAmountWithLocale(
subscription, subscription,
context.read<LocaleProvider>().locale.languageCode), context
.read<LocaleProvider>()
.locale
.languageCode),
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasData) { if (snapshot.hasData) {
return ThemedText( return ThemedText(
snapshot.data!, snapshot.data!,
style: const TextStyle( style: const TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: fontWeight: FontWeight.bold,
FontWeight.bold,
), ),
); );
} }
return const SizedBox( return const SizedBox(
width: 20, width: 20,
height: 20, height: 20,
child: child: CircularProgressIndicator(
CircularProgressIndicator(
strokeWidth: 2, strokeWidth: 2,
), ),
); );

View File

@@ -56,7 +56,8 @@ class TotalExpenseSummaryCard extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
ThemedText.headline( ThemedText.headline(
text: AppLocalizations.of(context).totalExpenseSummary, text:
AppLocalizations.of(context).totalExpenseSummary,
style: const TextStyle( style: const TextStyle(
fontSize: 18, fontSize: 18,
), ),
@@ -67,20 +68,24 @@ class TotalExpenseSummaryCard extends StatelessWidget {
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
constraints: const BoxConstraints(), constraints: const BoxConstraints(),
onPressed: () async { onPressed: () async {
final totalExpenseText = CurrencyUtil.formatTotalAmountWithLocale(totalExpense, locale); final totalExpenseText =
CurrencyUtil.formatTotalAmountWithLocale(
totalExpense, locale);
await Clipboard.setData( await Clipboard.setData(
ClipboardData(text: totalExpenseText)); ClipboardData(text: totalExpenseText));
HapticFeedbackHelper.lightImpact(); HapticFeedbackHelper.lightImpact();
if (!context.mounted) return; if (!context.mounted) return;
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
content: Text(AppLocalizations.of(context).totalExpenseCopied(totalExpenseText)), content: Text(AppLocalizations.of(context)
.totalExpenseCopied(totalExpenseText)),
duration: const Duration(seconds: 2), duration: const Duration(seconds: 2),
behavior: SnackBarBehavior.floating, behavior: SnackBarBehavior.floating,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
backgroundColor: AppColors.glassBackground.withValues(alpha: 0.3), backgroundColor: AppColors.glassBackground
.withValues(alpha: 0.3),
margin: const EdgeInsets.symmetric( margin: const EdgeInsets.symmetric(
horizontal: 16, horizontal: 16,
vertical: 8, vertical: 8,
@@ -115,7 +120,8 @@ class TotalExpenseSummaryCard extends StatelessWidget {
), ),
const SizedBox(height: 4), const SizedBox(height: 4),
ThemedText( ThemedText(
CurrencyUtil.formatTotalAmountWithLocale(totalExpense, locale), CurrencyUtil.formatTotalAmountWithLocale(
totalExpense, locale),
style: const TextStyle( style: const TextStyle(
fontSize: 26, fontSize: 26,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@@ -134,10 +140,12 @@ class TotalExpenseSummaryCard extends StatelessWidget {
Container( Container(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.glassBackground.withValues(alpha: 0.3), color: AppColors.glassBackground
.withValues(alpha: 0.3),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: Border.all( border: Border.all(
color: AppColors.glassBorder.withValues(alpha: 0.2), color: AppColors.glassBorder
.withValues(alpha: 0.2),
), ),
), ),
child: const FaIcon( child: const FaIcon(
@@ -152,7 +160,8 @@ class TotalExpenseSummaryCard extends StatelessWidget {
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
ThemedText.caption( ThemedText.caption(
text: AppLocalizations.of(context).totalServices, text: AppLocalizations.of(context)
.totalServices,
style: const TextStyle( style: const TextStyle(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@@ -160,7 +169,9 @@ class TotalExpenseSummaryCard extends StatelessWidget {
), ),
const SizedBox(height: 2), const SizedBox(height: 2),
ThemedText( ThemedText(
AppLocalizations.of(context).subscriptionCount(subscriptions.length), AppLocalizations.of(context)
.subscriptionCount(
subscriptions.length),
style: const TextStyle( style: const TextStyle(
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@@ -176,10 +187,12 @@ class TotalExpenseSummaryCard extends StatelessWidget {
Container( Container(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.glassBackground.withValues(alpha: 0.3), color: AppColors.glassBackground
.withValues(alpha: 0.3),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: Border.all( border: Border.all(
color: AppColors.glassBorder.withValues(alpha: 0.2), color: AppColors.glassBorder
.withValues(alpha: 0.2),
), ),
), ),
child: const FaIcon( child: const FaIcon(
@@ -194,7 +207,8 @@ class TotalExpenseSummaryCard extends StatelessWidget {
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
ThemedText.caption( ThemedText.caption(
text: AppLocalizations.of(context).averageCost, text: AppLocalizations.of(context)
.averageCost,
style: const TextStyle( style: const TextStyle(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@@ -202,10 +216,12 @@ class TotalExpenseSummaryCard extends StatelessWidget {
), ),
const SizedBox(height: 2), const SizedBox(height: 2),
ThemedText( ThemedText(
CurrencyUtil.formatTotalAmountWithLocale( CurrencyUtil
.formatTotalAmountWithLocale(
subscriptions.isEmpty subscriptions.isEmpty
? 0 ? 0
: totalExpense / subscriptions.length, : totalExpense /
subscriptions.length,
locale), locale),
style: const TextStyle( style: const TextStyle(
fontSize: 18, fontSize: 18,

View File

@@ -138,7 +138,8 @@ class FlipPageRoute<T> extends PageRouteBuilder<T> {
transitionDuration: const Duration(milliseconds: 800), transitionDuration: const Duration(milliseconds: 800),
reverseTransitionDuration: const Duration(milliseconds: 800), reverseTransitionDuration: const Duration(milliseconds: 800),
transitionsBuilder: (context, animation, secondaryAnimation, child) { transitionsBuilder: (context, animation, secondaryAnimation, child) {
final isAnimatingForward = animation.status == AnimationStatus.forward; final isAnimatingForward =
animation.status == AnimationStatus.forward;
final flipAnimation = Tween( final flipAnimation = Tween(
begin: 0.0, begin: 0.0,

View File

@@ -109,8 +109,8 @@ class AnimatedWaveBackground extends StatelessWidget {
width: 30, width: 30,
height: 30, height: 30,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white.withValues(alpha: color: Colors.white.withValues(
0.1 + 0.1 * pulseController.value, alpha: 0.1 + 0.1 * pulseController.value,
), ),
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
), ),

View File

@@ -42,7 +42,8 @@ class AppNavigator {
} }
/// 구독 상세 화면으로 네비게이션 /// 구독 상세 화면으로 네비게이션
static Future<void> toDetail(BuildContext context, SubscriptionModel subscription) async { static Future<void> toDetail(
BuildContext context, SubscriptionModel subscription) async {
print('AppNavigator.toDetail 호출됨: ${subscription.serviceName}'); print('AppNavigator.toDetail 호출됨: ${subscription.serviceName}');
HapticFeedback.lightImpact(); HapticFeedback.lightImpact();
@@ -196,6 +197,7 @@ class AppNavigationObserver extends NavigatorObserver {
@override @override
void didReplace({Route<dynamic>? newRoute, Route<dynamic>? oldRoute}) { void didReplace({Route<dynamic>? newRoute, Route<dynamic>? oldRoute}) {
super.didReplace(newRoute: newRoute, oldRoute: oldRoute); super.didReplace(newRoute: newRoute, oldRoute: oldRoute);
debugPrint('Navigation: Replace ${oldRoute?.settings.name} with ${newRoute?.settings.name}'); debugPrint(
'Navigation: Replace ${oldRoute?.settings.name} with ${newRoute?.settings.name}');
} }
} }

View File

@@ -68,7 +68,8 @@ class CategoryHeaderWidget extends StatelessWidget {
final parts = <String>[]; final parts = <String>[];
// 개수는 항상 표시 // 개수는 항상 표시
parts.add(AppLocalizations.of(context).subscriptionCount(subscriptionCount)); parts
.add(AppLocalizations.of(context).subscriptionCount(subscriptionCount));
// 통화 부분을 별도로 처리 // 통화 부분을 별도로 처리
final currencyParts = <String>[]; final currencyParts = <String>[];

View File

@@ -74,8 +74,7 @@ class _DangerButtonState extends State<DangerButton> {
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
Text( Text(
widget.confirmationMessage ?? widget.confirmationMessage ?? '이 작업은 되돌릴 수 없습니다.\n계속하시겠습니까?',
'이 작업은 되돌릴 수 없습니다.\n계속하시겠습니까?',
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: const TextStyle( style: const TextStyle(
fontSize: 16, fontSize: 16,

View File

@@ -43,8 +43,10 @@ class _PrimaryButtonState extends State<PrimaryButton> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final theme = Theme.of(context); final theme = Theme.of(context);
final effectiveBackgroundColor = widget.backgroundColor ?? theme.primaryColor; final effectiveBackgroundColor =
final effectiveForegroundColor = widget.foregroundColor ?? AppColors.pureWhite; widget.backgroundColor ?? theme.primaryColor;
final effectiveForegroundColor =
widget.foregroundColor ?? AppColors.pureWhite;
Widget button = AnimatedContainer( Widget button = AnimatedContainer(
duration: const Duration(milliseconds: 200), duration: const Duration(milliseconds: 200),
@@ -64,7 +66,8 @@ class _PrimaryButtonState extends State<PrimaryButton> {
padding: widget.padding ?? const EdgeInsets.symmetric(vertical: 16), padding: widget.padding ?? const EdgeInsets.symmetric(vertical: 16),
elevation: widget.enableHoverEffect && _isHovered ? 2 : 0, elevation: widget.enableHoverEffect && _isHovered ? 2 : 0,
shadowColor: Colors.black.withValues(alpha: 0.08), shadowColor: Colors.black.withValues(alpha: 0.08),
disabledBackgroundColor: effectiveBackgroundColor.withValues(alpha: 0.6), disabledBackgroundColor:
effectiveBackgroundColor.withValues(alpha: 0.6),
), ),
child: widget.isLoading child: widget.isLoading
? SizedBox( ? SizedBox(

View File

@@ -66,13 +66,13 @@ class _SecondaryButtonState extends State<SecondaryButton> {
: effectiveBorderColor, : effectiveBorderColor,
width: widget.borderWidth, width: widget.borderWidth,
), ),
padding: widget.padding ?? const EdgeInsets.symmetric( padding: widget.padding ??
const EdgeInsets.symmetric(
vertical: 12, vertical: 12,
horizontal: 24, horizontal: 24,
), ),
backgroundColor: _isHovered backgroundColor:
? AppColors.glassBackground _isHovered ? AppColors.glassBackground : Colors.transparent,
: Colors.transparent,
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@@ -179,9 +179,8 @@ class _TextLinkButtonState extends State<TextLinkButton> {
fontSize: widget.fontSize, fontSize: widget.fontSize,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: effectiveColor, color: effectiveColor,
decoration: _isHovered decoration:
? TextDecoration.underline _isHovered ? TextDecoration.underline : TextDecoration.none,
: TextDecoration.none,
), ),
), ),
], ],

View File

@@ -34,7 +34,8 @@ class SectionCard extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final theme = Theme.of(context); final theme = Theme.of(context);
final effectiveBackgroundColor = backgroundColor ?? Colors.white; final effectiveBackgroundColor = backgroundColor ?? Colors.white;
final effectiveShadow = boxShadow ?? [ final effectiveShadow = boxShadow ??
[
BoxShadow( BoxShadow(
color: Colors.black.withValues(alpha: 0.05), color: Colors.black.withValues(alpha: 0.05),
blurRadius: 10, blurRadius: 10,

View File

@@ -53,7 +53,8 @@ class ConfirmationDialog extends StatelessWidget {
Container( Container(
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
decoration: BoxDecoration( decoration: BoxDecoration(
color: (iconColor ?? effectiveConfirmColor).withValues(alpha: 0.1), color:
(iconColor ?? effectiveConfirmColor).withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
), ),
child: Icon( child: Icon(

View File

@@ -193,7 +193,8 @@ class _CustomLoadingIndicatorState extends State<CustomLoadingIndicator>
width: widget.size / 5, width: widget.size / 5,
height: widget.size / 5, height: widget.size / 5,
decoration: BoxDecoration( decoration: BoxDecoration(
color: effectiveColor.withValues(alpha: 0.3 + value * 0.7), color:
effectiveColor.withValues(alpha: 0.3 + value * 0.7),
shape: BoxShape.circle, shape: BoxShape.circle,
), ),
); );
@@ -220,7 +221,8 @@ class _CustomLoadingIndicatorState extends State<CustomLoadingIndicator>
height: widget.size * (0.3 + _animation.value * 0.5), height: widget.size * (0.3 + _animation.value * 0.5),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: effectiveColor.withValues(alpha: 1 - _animation.value), color:
effectiveColor.withValues(alpha: 1 - _animation.value),
), ),
), ),
), ),

View File

@@ -90,7 +90,8 @@ class BaseTextField extends StatelessWidget {
minLines: minLines, minLines: minLines,
readOnly: readOnly, readOnly: readOnly,
cursorColor: cursorColor ?? theme.primaryColor, cursorColor: cursorColor ?? theme.primaryColor,
style: style ?? TextStyle( style: style ??
TextStyle(
fontSize: 16, fontSize: 16,
color: AppColors.textPrimary, color: AppColors.textPrimary,
), ),

View File

@@ -106,8 +106,6 @@ class BillingCycleSelector extends StatelessWidget {
if (isSelected) { if (isSelected) {
return Colors.white; return Colors.white;
} }
return isGlassmorphism return isGlassmorphism ? AppColors.darkNavy : Colors.grey[700]!;
? AppColors.darkNavy
: Colors.grey[700]!;
} }
} }

View File

@@ -55,7 +55,8 @@ class CategorySelector extends StatelessWidget {
Consumer<CategoryProvider>( Consumer<CategoryProvider>(
builder: (context, categoryProvider, child) { builder: (context, categoryProvider, child) {
return Text( return Text(
categoryProvider.getLocalizedCategoryName(context, category.name), categoryProvider.getLocalizedCategoryName(
context, category.name),
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@@ -131,8 +132,6 @@ class CategorySelector extends StatelessWidget {
if (isSelected) { if (isSelected) {
return Colors.white; return Colors.white;
} }
return isGlassmorphism return isGlassmorphism ? AppColors.darkNavy : Colors.grey[700]!;
? AppColors.darkNavy
: Colors.grey[700]!;
} }
} }

View File

@@ -105,7 +105,11 @@ class _CurrencyInputFieldState extends State<CurrencyInputField> {
} }
double? _parseValue(String text) { double? _parseValue(String text) {
final cleanText = text.replaceAll(',', '').replaceAll('', '').replaceAll('\$', '').trim(); final cleanText = text
.replaceAll(',', '')
.replaceAll('', '')
.replaceAll('\$', '')
.trim();
return double.tryParse(cleanText); return double.tryParse(cleanText);
} }
@@ -128,10 +132,7 @@ class _CurrencyInputFieldState extends State<CurrencyInputField> {
keyboardType: const TextInputType.numberWithOptions(decimal: true), keyboardType: const TextInputType.numberWithOptions(decimal: true),
inputFormatters: [ inputFormatters: [
FilteringTextInputFormatter.allow( FilteringTextInputFormatter.allow(
widget.currency == 'KRW' widget.currency == 'KRW' ? RegExp(r'[0-9]') : RegExp(r'[0-9.]')),
? RegExp(r'[0-9]')
: RegExp(r'[0-9.]')
),
if (widget.currency == 'USD') if (widget.currency == 'USD')
// USD의 경우 소수점 이하 2자리까지만 허용 // USD의 경우 소수점 이하 2자리까지만 허용
TextInputFormatter.withFunction((oldValue, newValue) { TextInputFormatter.withFunction((oldValue, newValue) {
@@ -157,7 +158,8 @@ class _CurrencyInputFieldState extends State<CurrencyInputField> {
final parsedValue = _parseValue(value); final parsedValue = _parseValue(value);
widget.onChanged?.call(parsedValue); widget.onChanged?.call(parsedValue);
}, },
validator: widget.validator ?? (value) { validator: widget.validator ??
(value) {
if (value == null || value.isEmpty) { if (value == null || value.isEmpty) {
return AppLocalizations.of(context).amountRequired; return AppLocalizations.of(context).amountRequired;
} }

View File

@@ -131,9 +131,7 @@ class _CurrencyOption extends StatelessWidget {
Color _getBackgroundColor(ThemeData theme) { Color _getBackgroundColor(ThemeData theme) {
if (isSelected) { if (isSelected) {
return isGlassmorphism return isGlassmorphism ? theme.primaryColor : const Color(0xFF3B82F6);
? theme.primaryColor
: const Color(0xFF3B82F6);
} }
return isGlassmorphism return isGlassmorphism
? AppColors.surfaceColorAlt ? AppColors.surfaceColorAlt
@@ -154,8 +152,6 @@ class _CurrencyOption extends StatelessWidget {
if (isSelected) { if (isSelected) {
return Colors.white; return Colors.white;
} }
return isGlassmorphism return isGlassmorphism ? AppColors.navyGray : Colors.grey[600]!;
? AppColors.navyGray
: Colors.grey[600]!;
} }
} }

View File

@@ -57,12 +57,15 @@ class DatePickerField extends StatelessWidget {
const SizedBox(height: 8), const SizedBox(height: 8),
InkWell( InkWell(
focusNode: focusNode, focusNode: focusNode,
onTap: enabled ? () async { onTap: enabled
? () async {
final DateTime? picked = await showDatePicker( final DateTime? picked = await showDatePicker(
context: context, context: context,
initialDate: selectedDate, initialDate: selectedDate,
firstDate: firstDate ?? DateTime.now().subtract(const Duration(days: 365 * 10)), firstDate: firstDate ??
lastDate: lastDate ?? DateTime.now().add(const Duration(days: 365 * 10)), DateTime.now().subtract(const Duration(days: 365 * 10)),
lastDate: lastDate ??
DateTime.now().add(const Duration(days: 365 * 10)),
builder: (BuildContext context, Widget? child) { builder: (BuildContext context, Widget? child) {
return Theme( return Theme(
data: ThemeData.light().copyWith( data: ThemeData.light().copyWith(
@@ -81,7 +84,8 @@ class DatePickerField extends StatelessWidget {
if (picked != null && picked != selectedDate) { if (picked != null && picked != selectedDate) {
onDateSelected(picked); onDateSelected(picked);
} }
} : null, }
: null,
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
child: Container( child: Container(
padding: contentPadding ?? const EdgeInsets.all(16), padding: contentPadding ?? const EdgeInsets.all(16),
@@ -97,21 +101,19 @@ class DatePickerField extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
DateFormat(effectiveDateFormat, locale.toString()).format(selectedDate), DateFormat(effectiveDateFormat, locale.toString())
.format(selectedDate),
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
color: enabled color:
? AppColors.textPrimary enabled ? AppColors.textPrimary : AppColors.textMuted,
: AppColors.textMuted,
), ),
), ),
), ),
Icon( Icon(
Icons.calendar_today, Icons.calendar_today,
size: 20, size: 20,
color: enabled color: enabled ? AppColors.navyGray : AppColors.textMuted,
? AppColors.navyGray
: AppColors.textMuted,
), ),
], ],
), ),
@@ -158,7 +160,8 @@ class DateRangePickerField extends StatelessWidget {
primaryColor: primaryColor, primaryColor: primaryColor,
onDateSelected: onStartDateSelected, onDateSelected: onStartDateSelected,
firstDate: DateTime.now().subtract(const Duration(days: 365)), firstDate: DateTime.now().subtract(const Duration(days: 365)),
lastDate: endDate ?? DateTime.now().add(const Duration(days: 365 * 2)), lastDate:
endDate ?? DateTime.now().add(const Duration(days: 365 * 2)),
), ),
), ),
const SizedBox(width: 12), const SizedBox(width: 12),
@@ -203,7 +206,8 @@ class _DateRangeItem extends StatelessWidget {
final effectivePrimaryColor = primaryColor ?? theme.primaryColor; final effectivePrimaryColor = primaryColor ?? theme.primaryColor;
return InkWell( return InkWell(
onTap: enabled ? () async { onTap: enabled
? () async {
final DateTime? picked = await showDatePicker( final DateTime? picked = await showDatePicker(
context: context, context: context,
initialDate: date ?? DateTime.now(), initialDate: date ?? DateTime.now(),
@@ -227,7 +231,8 @@ class _DateRangeItem extends StatelessWidget {
if (picked != null) { if (picked != null) {
onDateSelected(picked); onDateSelected(picked);
} }
} : null, }
: null,
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
child: Container( child: Container(
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
@@ -252,14 +257,14 @@ class _DateRangeItem extends StatelessWidget {
const SizedBox(height: 4), const SizedBox(height: 4),
Text( Text(
date != null date != null
? DateFormat(AppLocalizations.of(context).dateFormatShort).format(date!) ? DateFormat(AppLocalizations.of(context).dateFormatShort)
.format(date!)
: AppLocalizations.of(context).dateSelect, : AppLocalizations.of(context).dateSelect,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: date != null color:
? AppColors.textPrimary date != null ? AppColors.textPrimary : AppColors.textMuted,
: AppColors.textMuted,
), ),
), ),
], ],

View File

@@ -146,7 +146,8 @@ class DetailEventSection extends StatelessWidget {
controller.eventStartDate = date; controller.eventStartDate = date;
// 시작일 설정 시 종료일이 없으면 자동으로 1달 후로 설정 // 시작일 설정 시 종료일이 없으면 자동으로 1달 후로 설정
if (date != null && controller.eventEndDate == null) { if (date != null && controller.eventEndDate == null) {
controller.eventEndDate = date.add(const Duration(days: 30)); controller.eventEndDate =
date.add(const Duration(days: 30));
} }
}, },
onEndDateSelected: (date) { onEndDateSelected: (date) {
@@ -166,11 +167,14 @@ class DetailEventSection extends StatelessWidget {
validator: controller.isEventActive validator: controller.isEventActive
? (value) { ? (value) {
if (value == null || value.isEmpty) { if (value == null || value.isEmpty) {
return AppLocalizations.of(context).eventPriceRequired; return AppLocalizations.of(context)
.eventPriceRequired;
} }
final price = double.tryParse(value.replaceAll(',', '')); final price =
double.tryParse(value.replaceAll(',', ''));
if (price == null || price <= 0) { if (price == null || price <= 0) {
return AppLocalizations.of(context).invalidPrice; return AppLocalizations.of(context)
.invalidPrice;
} }
return null; return null;
} }
@@ -181,9 +185,10 @@ class DetailEventSection extends StatelessWidget {
if (controller.eventPriceController.text.isNotEmpty) if (controller.eventPriceController.text.isNotEmpty)
_DiscountBadge( _DiscountBadge(
originalPrice: controller.subscription.monthlyCost, originalPrice: controller.subscription.monthlyCost,
eventPrice: double.tryParse( eventPrice: double.tryParse(controller
controller.eventPriceController.text.replaceAll(',', '') .eventPriceController.text
) ?? 0, .replaceAll(',', '')) ??
0,
currency: controller.currency, currency: controller.currency,
), ),
], ],
@@ -216,7 +221,8 @@ class _DiscountBadge extends StatelessWidget {
return const SizedBox.shrink(); return const SizedBox.shrink();
} }
final discountPercentage = ((originalPrice - eventPrice) / originalPrice * 100).round(); final discountPercentage =
((originalPrice - eventPrice) / originalPrice * 100).round();
final discountAmount = originalPrice - eventPrice; final discountAmount = originalPrice - eventPrice;
return Container( return Container(
@@ -234,7 +240,9 @@ class _DiscountBadge extends StatelessWidget {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
child: Text( child: Text(
AppLocalizations.of(context).discountPercent.replaceAll('@', discountPercentage.toString()), AppLocalizations.of(context)
.discountPercent
.replaceAll('@', discountPercentage.toString()),
style: const TextStyle( style: const TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 12, fontSize: 12,
@@ -256,7 +264,8 @@ class _DiscountBadge extends StatelessWidget {
); );
} }
String _getLocalizedDiscountAmount(BuildContext context, String currency, double amount) { String _getLocalizedDiscountAmount(
BuildContext context, String currency, double amount) {
final loc = AppLocalizations.of(context); final loc = AppLocalizations.of(context);
switch (currency) { switch (currency) {
case 'KRW': case 'KRW':
@@ -264,9 +273,11 @@ class _DiscountBadge extends StatelessWidget {
case 'JPY': case 'JPY':
return loc.discountAmountYen.replaceAll('@', amount.toInt().toString()); return loc.discountAmountYen.replaceAll('@', amount.toInt().toString());
case 'CNY': case 'CNY':
return loc.discountAmountYuan.replaceAll('@', amount.toStringAsFixed(2)); return loc.discountAmountYuan
.replaceAll('@', amount.toStringAsFixed(2));
default: // USD default: // USD
return loc.discountAmountDollar.replaceAll('@', amount.toStringAsFixed(2)); return loc.discountAmountDollar
.replaceAll('@', amount.toStringAsFixed(2));
} }
} }
} }

View File

@@ -114,9 +114,9 @@ class DetailFormSection extends StatelessWidget {
controller.currency = value; controller.currency = value;
// 통화 변경시 금액 포맷 업데이트 // 통화 변경시 금액 포맷 업데이트
if (value == 'KRW') { if (value == 'KRW') {
final amount = double.tryParse( final amount = double.tryParse(controller
controller.monthlyCostController.text.replaceAll(',', '') .monthlyCostController.text
); .replaceAll(',', ''));
if (amount != null) { if (amount != null) {
controller.monthlyCostController.text = controller.monthlyCostController.text =
amount.toInt().toString(); amount.toInt().toString();
@@ -164,7 +164,8 @@ class DetailFormSection extends StatelessWidget {
}, },
label: AppLocalizations.of(context).nextBillingDate, label: AppLocalizations.of(context).nextBillingDate,
firstDate: DateTime.now(), firstDate: DateTime.now(),
lastDate: DateTime.now().add(const Duration(days: 365 * 2)), lastDate:
DateTime.now().add(const Duration(days: 365 * 2)),
primaryColor: baseColor, primaryColor: baseColor,
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
@@ -207,4 +208,3 @@ class DetailFormSection extends StatelessWidget {
); );
} }
} }

View File

@@ -115,7 +115,8 @@ class DetailHeaderSection extends StatelessWidget {
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black.withValues(alpha: 0.1), color: Colors.black
.withValues(alpha: 0.1),
blurRadius: 8, blurRadius: 8,
offset: const Offset(0, 4), offset: const Offset(0, 4),
), ),
@@ -124,8 +125,10 @@ class DetailHeaderSection extends StatelessWidget {
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
child: WebsiteIcon( child: WebsiteIcon(
url: controller.websiteUrlController.text, url: controller
serviceName: controller.serviceNameController.text, .websiteUrlController.text,
serviceName: controller
.serviceNameController.text,
size: 48, size: 48,
), ),
), ),
@@ -134,10 +137,13 @@ class DetailHeaderSection extends StatelessWidget {
const SizedBox(width: 16), const SizedBox(width: 16),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Text( Text(
controller.displayName ?? controller.serviceNameController.text, controller.displayName ??
controller
.serviceNameController.text,
style: const TextStyle( style: const TextStyle(
fontSize: 28, fontSize: 28,
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
@@ -154,12 +160,18 @@ class DetailHeaderSection extends StatelessWidget {
), ),
const SizedBox(height: 4), const SizedBox(height: 4),
Text( Text(
AppLocalizations.of(context).billingCyclePayment.replaceAll('@', AppLocalizations.of(context)
_getLocalizedBillingCycle(context, controller.billingCycle)), .billingCyclePayment
.replaceAll(
'@',
_getLocalizedBillingCycle(
context,
controller.billingCycle)),
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Colors.white.withValues(alpha: 0.8), color: Colors.white
.withValues(alpha: 0.8),
), ),
), ),
], ],
@@ -176,19 +188,29 @@ class DetailHeaderSection extends StatelessWidget {
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
_InfoColumn( _InfoColumn(
label: AppLocalizations.of(context).nextBillingDate, label: AppLocalizations.of(context)
value: AppLocalizations.of(context).formatDate(controller.nextBillingDate), .nextBillingDate,
value: AppLocalizations.of(context)
.formatDate(
controller.nextBillingDate),
), ),
FutureBuilder<String>( FutureBuilder<String>(
future: () async { future: () async {
final locale = context.read<LocaleProvider>().locale.languageCode; final locale = context
.read<LocaleProvider>()
.locale
.languageCode;
final amount = double.tryParse( final amount = double.tryParse(
controller.monthlyCostController.text.replaceAll(',', '') controller
) ?? 0; .monthlyCostController.text
return CurrencyUtil.formatAmountWithLocale( .replaceAll(',', '')) ??
0;
return CurrencyUtil
.formatAmountWithLocale(
amount, amount,
controller.currency, controller.currency,
locale, locale,
@@ -196,7 +218,8 @@ class DetailHeaderSection extends StatelessWidget {
}(), }(),
builder: (context, snapshot) { builder: (context, snapshot) {
return _InfoColumn( return _InfoColumn(
label: AppLocalizations.of(context).monthlyExpense, label: AppLocalizations.of(context)
.monthlyExpense,
value: snapshot.data ?? '-', value: snapshot.data ?? '-',
alignment: CrossAxisAlignment.end, alignment: CrossAxisAlignment.end,
); );
@@ -219,6 +242,7 @@ class DetailHeaderSection extends StatelessWidget {
}, },
); );
} }
String _getLocalizedBillingCycle(BuildContext context, String cycle) { String _getLocalizedBillingCycle(BuildContext context, String cycle) {
final loc = AppLocalizations.of(context); final loc = AppLocalizations.of(context);
switch (cycle.toLowerCase()) { switch (cycle.toLowerCase()) {

View File

@@ -58,7 +58,8 @@ class EmptyStateWidget extends StatelessWidget {
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: AppColors.primaryColor.withValues(alpha: 0.3), color:
AppColors.primaryColor.withValues(alpha: 0.3),
spreadRadius: 0, spreadRadius: 0,
blurRadius: 16, blurRadius: 16,
offset: const Offset(0, 8), offset: const Offset(0, 8),

View File

@@ -81,7 +81,8 @@ class _ExpandableFabState extends State<ExpandableFab>
animation: _expandAnimation, animation: _expandAnimation,
builder: (context, child) { builder: (context, child) {
return Container( return Container(
color: AppColors.shadowBlack.withValues(alpha: 3.75 * _expandAnimation.value), color: AppColors.shadowBlack
.withValues(alpha: 3.75 * _expandAnimation.value),
); );
}, },
), ),

View File

@@ -124,8 +124,11 @@ class _FloatingNavigationBarState extends State<FloatingNavigationBar>
_NavigationItem( _NavigationItem(
icon: Icons.settings_rounded, icon: Icons.settings_rounded,
label: AppLocalizations.of(context).settings, label: AppLocalizations.of(context).settings,
isSelected: PlatformHelper.isIOS ? widget.selectedIndex == 3 : widget.selectedIndex == 4, isSelected: PlatformHelper.isIOS
onTap: () => _onItemTapped(PlatformHelper.isIOS ? 3 : 4), ? widget.selectedIndex == 3
: widget.selectedIndex == 4,
onTap: () =>
_onItemTapped(PlatformHelper.isIOS ? 3 : 4),
), ),
], ],
), ),

View File

@@ -6,7 +6,8 @@ import 'themed_text.dart';
import '../l10n/app_localizations.dart'; import '../l10n/app_localizations.dart';
/// 글래스모피즘 효과가 적용된 통일된 앱바 /// 글래스모피즘 효과가 적용된 통일된 앱바
class GlassmorphicAppBar extends StatelessWidget implements PreferredSizeWidget { class GlassmorphicAppBar extends StatelessWidget
implements PreferredSizeWidget {
final String title; final String title;
final List<Widget>? actions; final List<Widget>? actions;
final Widget? leading; final Widget? leading;
@@ -54,12 +55,16 @@ class GlassmorphicAppBar extends StatelessWidget implements PreferredSizeWidget
begin: Alignment.topLeft, begin: Alignment.topLeft,
end: Alignment.bottomRight, end: Alignment.bottomRight,
colors: [ colors: [
(backgroundColor ?? (isDarkMode (backgroundColor ??
(isDarkMode
? AppColors.glassBackgroundDark ? AppColors.glassBackgroundDark
: AppColors.glassBackground)).withValues(alpha: opacity), : AppColors.glassBackground))
(backgroundColor ?? (isDarkMode .withValues(alpha: opacity),
(backgroundColor ??
(isDarkMode
? AppColors.glassSurfaceDark ? AppColors.glassSurfaceDark
: AppColors.glassSurface)).withValues(alpha: opacity * 0.8), : AppColors.glassSurface))
.withValues(alpha: opacity * 0.8),
], ],
), ),
border: Border( border: Border(
@@ -81,7 +86,9 @@ class GlassmorphicAppBar extends StatelessWidget implements PreferredSizeWidget
child: SizedBox( child: SizedBox(
height: kToolbarHeight, height: kToolbarHeight,
child: NavigationToolbar( child: NavigationToolbar(
leading: leading ?? (automaticallyImplyLeading && (canPop || onBackPressed != null) leading: leading ??
(automaticallyImplyLeading &&
(canPop || onBackPressed != null)
? _buildBackButton(context) ? _buildBackButton(context)
: null), : null),
middle: _buildTitle(context), middle: _buildTitle(context),
@@ -92,7 +99,8 @@ class GlassmorphicAppBar extends StatelessWidget implements PreferredSizeWidget
) )
: null, : null,
centerMiddle: centerTitle, centerMiddle: centerTitle,
middleSpacing: titleSpacing ?? NavigationToolbar.kMiddleSpacing, middleSpacing:
titleSpacing ?? NavigationToolbar.kMiddleSpacing,
), ),
), ),
), ),
@@ -109,7 +117,8 @@ class GlassmorphicAppBar extends StatelessWidget implements PreferredSizeWidget
Widget _buildBackButton(BuildContext context) { Widget _buildBackButton(BuildContext context) {
return IconButton( return IconButton(
icon: const Icon(Icons.arrow_back_ios_new_rounded), icon: const Icon(Icons.arrow_back_ios_new_rounded),
onPressed: onBackPressed ?? () { onPressed: onBackPressed ??
() {
HapticFeedback.lightImpact(); HapticFeedback.lightImpact();
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
@@ -214,10 +223,12 @@ class GlassmorphicSliverAppBar extends StatelessWidget {
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
elevation: 0, elevation: 0,
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
leading: leading ?? (automaticallyImplyLeading && (canPop || onBackPressed != null) leading: leading ??
(automaticallyImplyLeading && (canPop || onBackPressed != null)
? IconButton( ? IconButton(
icon: const Icon(Icons.arrow_back_ios_new_rounded), icon: const Icon(Icons.arrow_back_ios_new_rounded),
onPressed: onBackPressed ?? () { onPressed: onBackPressed ??
() {
HapticFeedback.lightImpact(); HapticFeedback.lightImpact();
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
@@ -230,7 +241,8 @@ class GlassmorphicSliverAppBar extends StatelessWidget {
flexibleSpace: LayoutBuilder( flexibleSpace: LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) { builder: (BuildContext context, BoxConstraints constraints) {
final top = constraints.biggest.height; final top = constraints.biggest.height;
final isCollapsed = top <= kToolbarHeight + MediaQuery.of(context).padding.top; final isCollapsed =
top <= kToolbarHeight + MediaQuery.of(context).padding.top;
return FlexibleSpaceBar( return FlexibleSpaceBar(
title: isCollapsed title: isCollapsed
@@ -244,7 +256,8 @@ class GlassmorphicSliverAppBar extends StatelessWidget {
) )
: null, : null,
centerTitle: centerTitle, centerTitle: centerTitle,
titlePadding: const EdgeInsets.only(left: 16, bottom: 16, right: 16), titlePadding:
const EdgeInsets.only(left: 16, bottom: 16, right: 16),
background: Stack( background: Stack(
fit: StackFit.expand, fit: StackFit.expand,
children: [ children: [
@@ -260,10 +273,12 @@ class GlassmorphicSliverAppBar extends StatelessWidget {
colors: [ colors: [
(isDarkMode (isDarkMode
? AppColors.glassBackgroundDark ? AppColors.glassBackgroundDark
: AppColors.glassBackground).withValues(alpha: opacity), : AppColors.glassBackground)
.withValues(alpha: opacity),
(isDarkMode (isDarkMode
? AppColors.glassSurfaceDark ? AppColors.glassSurfaceDark
: AppColors.glassSurface).withValues(alpha: opacity * 0.8), : AppColors.glassSurface)
.withValues(alpha: opacity * 0.8),
], ],
), ),
border: Border( border: Border(

View File

@@ -80,11 +80,14 @@ class _GlassmorphicScaffoldState extends State<GlassmorphicScaffold>
final currentScroll = _scrollController!.position.pixels; final currentScroll = _scrollController!.position.pixels;
// 스크롤 방향에 따라 플로팅 네비게이션 바 표시/숨김 // 스크롤 방향에 따라 플로팅 네비게이션 바 표시/숨김
if (currentScroll > 50 && _scrollController!.position.userScrollDirection == ScrollDirection.reverse) { if (currentScroll > 50 &&
_scrollController!.position.userScrollDirection ==
ScrollDirection.reverse) {
if (_isFloatingNavBarVisible) { if (_isFloatingNavBarVisible) {
setState(() => _isFloatingNavBarVisible = false); setState(() => _isFloatingNavBarVisible = false);
} }
} else if (_scrollController!.position.userScrollDirection == ScrollDirection.forward) { } else if (_scrollController!.position.userScrollDirection ==
ScrollDirection.forward) {
if (!_isFloatingNavBarVisible) { if (!_isFloatingNavBarVisible) {
setState(() => _isFloatingNavBarVisible = true); setState(() => _isFloatingNavBarVisible = true);
} }
@@ -159,7 +162,9 @@ class _GlassmorphicScaffoldState extends State<GlassmorphicScaffold>
gradient: LinearGradient( gradient: LinearGradient(
begin: Alignment.topLeft, begin: Alignment.topLeft,
end: Alignment.bottomRight, end: Alignment.bottomRight,
colors: gradientColors.map((color) => color.withOpacity(0.3)).toList(), colors: gradientColors
.map((color) => color.withOpacity(0.3))
.toList(),
), ),
), ),
), ),
@@ -273,7 +278,9 @@ class WavePainter extends CustomPainter {
path.moveTo(0, size.height); path.moveTo(0, size.height);
for (double x = 0; x <= size.width; x++) { for (double x = 0; x <= size.width; x++) {
final y = math.sin((x / size.width * 2 * math.pi) + (progress * 2 * math.pi)) * 20 + final y =
math.sin((x / size.width * 2 * math.pi) + (progress * 2 * math.pi)) *
20 +
size.height * 0.5; size.height * 0.5;
path.lineTo(x, y); path.lineTo(x, y);
} }

View File

@@ -56,7 +56,8 @@ class GlassmorphismCard extends StatelessWidget {
padding: padding, padding: padding,
decoration: BoxDecoration( decoration: BoxDecoration(
color: backgroundColor ?? AppColors.glassCard, color: backgroundColor ?? AppColors.glassCard,
gradient: gradient ?? LinearGradient( gradient: gradient ??
LinearGradient(
begin: Alignment.topLeft, begin: Alignment.topLeft,
end: Alignment.bottomRight, end: Alignment.bottomRight,
colors: isDarkMode colors: isDarkMode
@@ -64,15 +65,18 @@ class GlassmorphismCard extends StatelessWidget {
: AppColors.glassGradient, : AppColors.glassGradient,
), ),
borderRadius: BorderRadius.circular(borderRadius), borderRadius: BorderRadius.circular(borderRadius),
border: border ?? Border.all( border: border ??
Border.all(
color: isDarkMode color: isDarkMode
? AppColors.primaryColor.withValues(alpha: 0.3) ? AppColors.primaryColor.withValues(alpha: 0.3)
: AppColors.glassBorder, : AppColors.glassBorder,
width: 1, width: 1,
), ),
boxShadow: boxShadow ?? [ boxShadow: boxShadow ??
[
BoxShadow( BoxShadow(
color: AppColors.shadowBlack, // color.md 가이드: rgba(0,0,0,0.08) color: AppColors
.shadowBlack, // color.md 가이드: rgba(0,0,0,0.08)
blurRadius: 20, blurRadius: 20,
spreadRadius: -5, spreadRadius: -5,
offset: const Offset(0, 10), offset: const Offset(0, 10),
@@ -119,7 +123,8 @@ class AnimatedGlassmorphismCard extends StatefulWidget {
}); });
@override @override
State<AnimatedGlassmorphismCard> createState() => _AnimatedGlassmorphismCardState(); State<AnimatedGlassmorphismCard> createState() =>
_AnimatedGlassmorphismCardState();
} }
class _AnimatedGlassmorphismCardState extends State<AnimatedGlassmorphismCard> class _AnimatedGlassmorphismCardState extends State<AnimatedGlassmorphismCard>

View File

@@ -52,8 +52,10 @@ class HomeContent extends StatelessWidget {
} }
// 카테고리별 구독 구분 // 카테고리별 구독 구분
final categoryProvider = Provider.of<CategoryProvider>(context, listen: false); final categoryProvider =
final categorizedSubscriptions = SubscriptionCategoryHelper.categorizeSubscriptions( Provider.of<CategoryProvider>(context, listen: false);
final categorizedSubscriptions =
SubscriptionCategoryHelper.categorizeSubscriptions(
provider.subscriptions, provider.subscriptions,
categoryProvider, categoryProvider,
context, context,
@@ -120,7 +122,8 @@ class HomeContent extends StatelessWidget {
child: Row( child: Row(
children: [ children: [
Text( Text(
AppLocalizations.of(context).subscriptionCount(provider.subscriptions.length), AppLocalizations.of(context)
.subscriptionCount(provider.subscriptions.length),
style: const TextStyle( style: const TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

View File

@@ -88,7 +88,8 @@ class MainScreenSummaryCard extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
AppLocalizations.of(context).monthlyTotalSubscriptionCost, AppLocalizations.of(context)
.monthlyTotalSubscriptionCost,
style: TextStyle( style: TextStyle(
color: AppColors color: AppColors
.darkNavy, // color.md 가이드: 밝은 배경 위 어두운 텍스트 .darkNavy, // color.md 가이드: 밝은 배경 위 어두운 텍스트
@@ -99,9 +100,12 @@ class MainScreenSummaryCard extends StatelessWidget {
// 환율 정보 표시 (영어 사용자는 표시 안함) // 환율 정보 표시 (영어 사용자는 표시 안함)
if (locale != 'en') if (locale != 'en')
FutureBuilder<String>( FutureBuilder<String>(
future: CurrencyUtil.getExchangeRateInfoForLocale(locale), future:
CurrencyUtil.getExchangeRateInfoForLocale(
locale),
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasData && snapshot.data!.isNotEmpty) { if (snapshot.hasData &&
snapshot.data!.isNotEmpty) {
return Container( return Container(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 8, horizontal: 8,
@@ -116,7 +120,9 @@ class MainScreenSummaryCard extends StatelessWidget {
), ),
), ),
child: Text( child: Text(
AppLocalizations.of(context).exchangeRateDisplay.replaceAll('@', snapshot.data!), AppLocalizations.of(context)
.exchangeRateDisplay
.replaceAll('@', snapshot.data!),
style: const TextStyle( style: const TextStyle(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@@ -133,7 +139,8 @@ class MainScreenSummaryCard extends StatelessWidget {
const SizedBox(height: 8), const SizedBox(height: 8),
// 월별 총 비용 표시 (언어별 기본 통화) // 월별 총 비용 표시 (언어별 기본 통화)
FutureBuilder<double>( FutureBuilder<double>(
future: CurrencyUtil.calculateTotalMonthlyExpenseInDefaultCurrency( future: CurrencyUtil
.calculateTotalMonthlyExpenseInDefaultCurrency(
provider.subscriptions, provider.subscriptions,
locale, locale,
), ),
@@ -142,7 +149,10 @@ class MainScreenSummaryCard extends StatelessWidget {
return const CircularProgressIndicator(); return const CircularProgressIndicator();
} }
final monthlyCost = snapshot.data!; final monthlyCost = snapshot.data!;
final decimals = (defaultCurrency == 'KRW' || defaultCurrency == 'JPY') ? 0 : 2; final decimals = (defaultCurrency == 'KRW' ||
defaultCurrency == 'JPY')
? 0
: 2;
return Row( return Row(
crossAxisAlignment: CrossAxisAlignment.baseline, crossAxisAlignment: CrossAxisAlignment.baseline,
@@ -150,9 +160,13 @@ class MainScreenSummaryCard extends StatelessWidget {
children: [ children: [
Text( Text(
NumberFormat.currency( NumberFormat.currency(
locale: defaultCurrency == 'KRW' ? 'ko_KR' : locale: defaultCurrency == 'KRW'
defaultCurrency == 'JPY' ? 'ja_JP' : ? 'ko_KR'
defaultCurrency == 'CNY' ? 'zh_CN' : 'en_US', : defaultCurrency == 'JPY'
? 'ja_JP'
: defaultCurrency == 'CNY'
? 'zh_CN'
: 'en_US',
symbol: '', symbol: '',
decimalDigits: decimals, decimalDigits: decimals,
).format(monthlyCost), ).format(monthlyCost),
@@ -179,7 +193,8 @@ class MainScreenSummaryCard extends StatelessWidget {
const SizedBox(height: 16), const SizedBox(height: 16),
// 연간 비용 및 총 구독 수 표시 // 연간 비용 및 총 구독 수 표시
FutureBuilder<double>( FutureBuilder<double>(
future: CurrencyUtil.calculateTotalMonthlyExpenseInDefaultCurrency( future: CurrencyUtil
.calculateTotalMonthlyExpenseInDefaultCurrency(
provider.subscriptions, provider.subscriptions,
locale, locale,
), ),
@@ -189,17 +204,25 @@ class MainScreenSummaryCard extends StatelessWidget {
} }
final monthlyCost = snapshot.data!; final monthlyCost = snapshot.data!;
final yearlyCost = monthlyCost * 12; final yearlyCost = monthlyCost * 12;
final decimals = (defaultCurrency == 'KRW' || defaultCurrency == 'JPY') ? 0 : 2; final decimals = (defaultCurrency == 'KRW' ||
defaultCurrency == 'JPY')
? 0
: 2;
return Row( return Row(
children: [ children: [
_buildInfoBox( _buildInfoBox(
context, context,
title: AppLocalizations.of(context).estimatedAnnualCost, title: AppLocalizations.of(context)
.estimatedAnnualCost,
value: '${NumberFormat.currency( value: '${NumberFormat.currency(
locale: defaultCurrency == 'KRW' ? 'ko_KR' : locale: defaultCurrency == 'KRW'
defaultCurrency == 'JPY' ? 'ja_JP' : ? 'ko_KR'
defaultCurrency == 'CNY' ? 'zh_CN' : 'en_US', : defaultCurrency == 'JPY'
? 'ja_JP'
: defaultCurrency == 'CNY'
? 'zh_CN'
: 'en_US',
symbol: currencySymbol, symbol: currencySymbol,
decimalDigits: decimals, decimalDigits: decimals,
).format(yearlyCost)}', ).format(yearlyCost)}',
@@ -207,8 +230,10 @@ class MainScreenSummaryCard extends StatelessWidget {
const SizedBox(width: 16), const SizedBox(width: 16),
_buildInfoBox( _buildInfoBox(
context, context,
title: AppLocalizations.of(context).totalSubscriptionServices, title: AppLocalizations.of(context)
value: '$totalSubscriptions${AppLocalizations.of(context).servicesUnit}', .totalSubscriptionServices,
value:
'$totalSubscriptions${AppLocalizations.of(context).servicesUnit}',
), ),
], ],
); );
@@ -255,7 +280,8 @@ class MainScreenSummaryCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
AppLocalizations.of(context).eventDiscountActive, AppLocalizations.of(context)
.eventDiscountActive,
style: TextStyle( style: TextStyle(
color: AppColors color: AppColors
.darkNavy, // color.md 가이드: 밝은 배경 위 어두운 텍스트 .darkNavy, // color.md 가이드: 밝은 배경 위 어두운 텍스트
@@ -266,7 +292,8 @@ class MainScreenSummaryCard extends StatelessWidget {
const SizedBox(height: 2), const SizedBox(height: 2),
// 이벤트 절약액 표시 (언어별 기본 통화) // 이벤트 절약액 표시 (언어별 기본 통화)
FutureBuilder<double>( FutureBuilder<double>(
future: CurrencyUtil.calculateTotalEventSavingsInDefaultCurrency( future: CurrencyUtil
.calculateTotalEventSavingsInDefaultCurrency(
provider.subscriptions, provider.subscriptions,
locale, locale,
), ),
@@ -275,15 +302,24 @@ class MainScreenSummaryCard extends StatelessWidget {
return const SizedBox(); return const SizedBox();
} }
final eventSavings = snapshot.data!; final eventSavings = snapshot.data!;
final decimals = (defaultCurrency == 'KRW' || defaultCurrency == 'JPY') ? 0 : 2; final decimals =
(defaultCurrency == 'KRW' ||
defaultCurrency == 'JPY')
? 0
: 2;
return Row( return Row(
children: [ children: [
Text( Text(
NumberFormat.currency( NumberFormat.currency(
locale: defaultCurrency == 'KRW' ? 'ko_KR' : locale: defaultCurrency == 'KRW'
defaultCurrency == 'JPY' ? 'ja_JP' : ? 'ko_KR'
defaultCurrency == 'CNY' ? 'zh_CN' : 'en_US', : defaultCurrency == 'JPY'
? 'ja_JP'
: defaultCurrency ==
'CNY'
? 'zh_CN'
: 'en_US',
symbol: currencySymbol, symbol: currencySymbol,
decimalDigits: decimals, decimalDigits: decimals,
).format(eventSavings), ).format(eventSavings),

View File

@@ -44,7 +44,7 @@ class _NativeAdWidgetState extends State<NativeAdWidget> {
} }
_nativeAd = NativeAd( _nativeAd = NativeAd(
adUnitId: _testAdUnitId(), // 실제 배포 시 교체 필요 adUnitId: _testAdUnitId(), // 실제 광고 단위 ID
factoryId: 'listTile', // Android/iOS 모두 동일하게 맞춰야 함 factoryId: 'listTile', // Android/iOS 모두 동일하게 맞춰야 함
request: const AdRequest(), request: const AdRequest(),
listener: NativeAdListener( listener: NativeAdListener(
@@ -63,15 +63,15 @@ class _NativeAdWidgetState extends State<NativeAdWidget> {
)..load(); )..load();
} }
/// 테스트 광고 단위 ID 반환 함수 /// 광고 단위 ID 반환 함수
/// Theme.of(context)를 사용하지 않고 Platform 클래스 직접 사용 /// Theme.of(context)를 사용하지 않고 Platform 클래스 직접 사용
String _testAdUnitId() { String _testAdUnitId() {
if (Platform.isAndroid) { if (Platform.isAndroid) {
// Android 테스트 네이티브 광고 ID // Android 네이티브 광고 ID
return 'ca-app-pub-3940256099942544/2247696110'; return 'ca-app-pub-6691216385521068/4512709971';
} else if (Platform.isIOS) { } else if (Platform.isIOS) {
// iOS 테스트 네이티브 광고 ID // iOS 네이티브 광고 ID
return 'ca-app-pub-3940256099942544/3986624511'; return 'ca-app-pub-6691216385521068/4512709971';
} }
return ''; return '';
} }

View File

@@ -43,7 +43,8 @@ class _SubscriptionCardWidgetState extends State<SubscriptionCardWidget> {
void initState() { void initState() {
super.initState(); super.initState();
// URL 필드 자동 설정 // URL 필드 자동 설정
if (widget.websiteUrlController.text.isEmpty && widget.subscription.websiteUrl != null) { if (widget.websiteUrlController.text.isEmpty &&
widget.subscription.websiteUrl != null) {
widget.websiteUrlController.text = widget.subscription.websiteUrl!; widget.websiteUrlController.text = widget.subscription.websiteUrl!;
} }
} }
@@ -256,7 +257,8 @@ class _SubscriptionCardWidgetState extends State<SubscriptionCardWidget> {
const SizedBox(height: 8), const SizedBox(height: 8),
CategorySelector( CategorySelector(
categories: categoryProvider.categories, categories: categoryProvider.categories,
selectedCategoryId: widget.selectedCategoryId ?? widget.subscription.category, selectedCategoryId:
widget.selectedCategoryId ?? widget.subscription.category,
onChanged: widget.onCategoryChanged, onChanged: widget.onCategoryChanged,
baseColor: _getCategoryColor(categoryProvider), baseColor: _getCategoryColor(categoryProvider),
isGlassmorphism: true, isGlassmorphism: true,
@@ -304,7 +306,8 @@ class _SubscriptionCardWidgetState extends State<SubscriptionCardWidget> {
} }
Color? _getCategoryColor(CategoryProvider categoryProvider) { Color? _getCategoryColor(CategoryProvider categoryProvider) {
final categoryId = widget.selectedCategoryId ?? widget.subscription.category; final categoryId =
widget.selectedCategoryId ?? widget.subscription.category;
if (categoryId == null) return null; if (categoryId == null) return null;
final category = categoryProvider.getCategoryById(categoryId); final category = categoryProvider.getCategoryById(categoryId);

View File

@@ -325,8 +325,8 @@ class _RippleAnimationState extends State<RippleAnimation>
height: 100 + 200 * _animation.value, height: 100 + 200 * _animation.value,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: widget.rippleColor.withValues(alpha: color: widget.rippleColor.withValues(
(1 - _animation.value) * 0.3, alpha: (1 - _animation.value) * 0.3,
), ),
), ),
); );

View File

@@ -60,7 +60,6 @@ class _SubscriptionCardState extends State<SubscriptionCard>
} }
} }
@override @override
void didUpdateWidget(SubscriptionCard oldWidget) { void didUpdateWidget(SubscriptionCard oldWidget) {
super.didUpdateWidget(oldWidget); super.didUpdateWidget(oldWidget);
@@ -203,7 +202,8 @@ class _SubscriptionCardState extends State<SubscriptionCard>
daysUntilNext = 7; // 다음 주 같은 요일 daysUntilNext = 7; // 다음 주 같은 요일
} }
if (daysUntilNext == 0) return AppLocalizations.of(context).paymentDueToday; if (daysUntilNext == 0)
return AppLocalizations.of(context).paymentDueToday;
return AppLocalizations.of(context).paymentDueInDays(daysUntilNext); return AppLocalizations.of(context).paymentDueInDays(daysUntilNext);
} }
@@ -234,15 +234,15 @@ class _SubscriptionCardState extends State<SubscriptionCard>
} }
final categoryProvider = context.watch<CategoryProvider>(); final categoryProvider = context.watch<CategoryProvider>();
final category = categoryProvider.getCategoryById(widget.subscription.categoryId!); final category =
categoryProvider.getCategoryById(widget.subscription.categoryId!);
if (category == null) { if (category == null) {
return AppColors.blueGradient; return AppColors.blueGradient;
} }
final categoryColor = Color( final categoryColor =
int.parse(category.color.replaceAll('#', '0xFF')) Color(int.parse(category.color.replaceAll('#', '0xFF')));
);
return [ return [
categoryColor, categoryColor,
@@ -301,8 +301,10 @@ class _SubscriptionCardState extends State<SubscriptionCard>
borderRadius: 16, borderRadius: 16,
blur: _isHovering ? 15 : 10, blur: _isHovering ? 15 : 10,
width: double.infinity, // 전체 너비를 차지하도록 설정 width: double.infinity, // 전체 너비를 차지하도록 설정
onTap: widget.onTap ?? () async { onTap: widget.onTap ??
print('[SubscriptionCard] AnimatedGlassmorphismCard onTap 호출됨 - ${widget.subscription.serviceName}'); () async {
print(
'[SubscriptionCard] AnimatedGlassmorphismCard onTap 호출됨 - ${widget.subscription.serviceName}');
await AppNavigator.toDetail(context, widget.subscription); await AppNavigator.toDetail(context, widget.subscription);
}, },
child: Column( child: Column(
@@ -349,17 +351,18 @@ class _SubscriptionCardState extends State<SubscriptionCard>
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
// 서비스명 // 서비스명
Flexible( Flexible(
child: Text( child: Text(
_displayName ?? widget.subscription.serviceName, _displayName ??
widget.subscription.serviceName,
style: const TextStyle( style: const TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 18, fontSize: 18,
color: AppColors.darkNavy, // color.md 가이드: 메인 텍스트 color: AppColors
.darkNavy, // color.md 가이드: 메인 텍스트
), ),
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
@@ -371,7 +374,8 @@ class _SubscriptionCardState extends State<SubscriptionCard>
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
// 이벤트 배지 // 이벤트 배지
if (widget.subscription.isCurrentlyInEvent) ...[ if (widget
.subscription.isCurrentlyInEvent) ...[
Container( Container(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 8, horizontal: 8,
@@ -384,8 +388,7 @@ class _SubscriptionCardState extends State<SubscriptionCard>
Color(0xFFFF8787), Color(0xFFFF8787),
], ],
), ),
borderRadius: borderRadius: BorderRadius.circular(12),
BorderRadius.circular(12),
), ),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
@@ -418,19 +421,21 @@ class _SubscriptionCardState extends State<SubscriptionCard>
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.surfaceColorAlt, color: AppColors.surfaceColorAlt,
borderRadius: borderRadius: BorderRadius.circular(12),
BorderRadius.circular(12),
border: Border.all( border: Border.all(
color: AppColors.borderColor, color: AppColors.borderColor,
width: 0.5, width: 0.5,
), ),
), ),
child: Text( child: Text(
AppLocalizations.of(context).getBillingCycleName(widget.subscription.billingCycle), AppLocalizations.of(context)
.getBillingCycleName(
widget.subscription.billingCycle),
style: const TextStyle( style: const TextStyle(
fontSize: 11, fontSize: 11,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: AppColors.navyGray, // color.md 가이드: 서브 텍스트 color: AppColors
.navyGray, // color.md 가이드: 서브 텍스트
), ),
), ),
), ),
@@ -443,8 +448,7 @@ class _SubscriptionCardState extends State<SubscriptionCard>
// 가격 정보 // 가격 정보
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
// 가격 표시 (이벤트 가격 반영) // 가격 표시 (이벤트 가격 반영)
// 가격 표시 (언어별 통화) // 가격 표시 (언어별 통화)
@@ -455,7 +459,8 @@ class _SubscriptionCardState extends State<SubscriptionCard>
return const SizedBox(); return const SizedBox();
} }
if (widget.subscription.isCurrentlyInEvent && snapshot.data!.contains('|')) { if (widget.subscription.isCurrentlyInEvent &&
snapshot.data!.contains('|')) {
final prices = snapshot.data!.split('|'); final prices = snapshot.data!.split('|');
return Row( return Row(
children: [ children: [
@@ -465,7 +470,8 @@ class _SubscriptionCardState extends State<SubscriptionCard>
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: AppColors.navyGray, color: AppColors.navyGray,
decoration: TextDecoration.lineThrough, decoration:
TextDecoration.lineThrough,
), ),
), ),
const SizedBox(width: 8), const SizedBox(width: 8),
@@ -485,7 +491,8 @@ class _SubscriptionCardState extends State<SubscriptionCard>
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: widget.subscription.isCurrentlyInEvent color: widget
.subscription.isCurrentlyInEvent
? const Color(0xFFFF6B6B) ? const Color(0xFFFF6B6B)
: AppColors.primaryColor, : AppColors.primaryColor,
), ),
@@ -506,18 +513,15 @@ class _SubscriptionCardState extends State<SubscriptionCard>
.withValues(alpha: 0.1) .withValues(alpha: 0.1)
: AppColors.successColor : AppColors.successColor
.withValues(alpha: 0.1), .withValues(alpha: 0.1),
borderRadius: borderRadius: BorderRadius.circular(12),
BorderRadius.circular(12),
), ),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Icon( Icon(
isNearBilling isNearBilling
? Icons ? Icons.access_time_filled_rounded
.access_time_filled_rounded : Icons.check_circle_rounded,
: Icons
.check_circle_rounded,
size: 12, size: 12,
color: isNearBilling color: isNearBilling
? AppColors.warningColor ? AppColors.warningColor
@@ -552,7 +556,8 @@ class _SubscriptionCardState extends State<SubscriptionCard>
vertical: 2, vertical: 2,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: const Color(0xFFFF6B6B).withValues(alpha: 0.1), color: const Color(0xFFFF6B6B)
.withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
child: Row( child: Row(
@@ -566,7 +571,8 @@ class _SubscriptionCardState extends State<SubscriptionCard>
const SizedBox(width: 4), const SizedBox(width: 4),
// 이벤트 절약액 표시 (언어별 통화) // 이벤트 절약액 표시 (언어별 통화)
FutureBuilder<String>( FutureBuilder<String>(
future: CurrencyUtil.formatEventSavingsWithLocale( future: CurrencyUtil
.formatEventSavingsWithLocale(
widget.subscription, widget.subscription,
localeProvider.locale.languageCode, localeProvider.locale.languageCode,
), ),
@@ -589,12 +595,17 @@ class _SubscriptionCardState extends State<SubscriptionCard>
), ),
const SizedBox(width: 8), const SizedBox(width: 8),
// 이벤트 종료일까지 남은 일수 // 이벤트 종료일까지 남은 일수
if (widget.subscription.eventEndDate != null) ...[ if (widget.subscription.eventEndDate !=
null) ...[
Text( Text(
AppLocalizations.of(context).daysRemaining(widget.subscription.eventEndDate!.difference(DateTime.now()).inDays), AppLocalizations.of(context).daysRemaining(
widget.subscription.eventEndDate!
.difference(DateTime.now())
.inDays),
style: const TextStyle( style: const TextStyle(
fontSize: 11, fontSize: 11,
color: AppColors.navyGray, // color.md 가이드: 서브 텍스트 color: AppColors
.navyGray, // color.md 가이드: 서브 텍스트
), ),
), ),
], ],

View File

@@ -46,12 +46,17 @@ class SubscriptionListWidget extends StatelessWidget {
child: Consumer<CategoryProvider>( child: Consumer<CategoryProvider>(
builder: (context, categoryProvider, child) { builder: (context, categoryProvider, child) {
return CategoryHeaderWidget( return CategoryHeaderWidget(
categoryName: categoryProvider.getLocalizedCategoryName(context, category), categoryName: categoryProvider.getLocalizedCategoryName(
context, category),
subscriptionCount: subscriptions.length, subscriptionCount: subscriptions.length,
totalCostUSD: _calculateTotalByCurrency(subscriptions, 'USD'), totalCostUSD:
totalCostKRW: _calculateTotalByCurrency(subscriptions, 'KRW'), _calculateTotalByCurrency(subscriptions, 'USD'),
totalCostJPY: _calculateTotalByCurrency(subscriptions, 'JPY'), totalCostKRW:
totalCostCNY: _calculateTotalByCurrency(subscriptions, 'CNY'), _calculateTotalByCurrency(subscriptions, 'KRW'),
totalCostJPY:
_calculateTotalByCurrency(subscriptions, 'JPY'),
totalCostCNY:
_calculateTotalByCurrency(subscriptions, 'CNY'),
); );
}, },
), ),
@@ -95,30 +100,38 @@ class SubscriptionListWidget extends StatelessWidget {
child: SwipeableSubscriptionCard( child: SwipeableSubscriptionCard(
subscription: subscriptions[subIndex], subscription: subscriptions[subIndex],
onTap: () { onTap: () {
print('[SubscriptionListWidget] SwipeableSubscriptionCard onTap 호출됨'); print(
AppNavigator.toDetail(context, subscriptions[subIndex]); '[SubscriptionListWidget] SwipeableSubscriptionCard onTap 호출됨');
AppNavigator.toDetail(
context, subscriptions[subIndex]);
}, },
onDelete: () async { onDelete: () async {
// 현재 로케일에 맞는 서비스명 가져오기 // 현재 로케일에 맞는 서비스명 가져오기
final localeProvider = Provider.of<LocaleProvider>( final localeProvider =
Provider.of<LocaleProvider>(
context, context,
listen: false, listen: false,
); );
final locale = localeProvider.locale.languageCode; final locale =
final displayName = await SubscriptionUrlMatcher.getServiceDisplayName( localeProvider.locale.languageCode;
serviceName: subscriptions[subIndex].serviceName, final displayName = await SubscriptionUrlMatcher
.getServiceDisplayName(
serviceName:
subscriptions[subIndex].serviceName,
locale: locale, locale: locale,
); );
// 삭제 확인 다이얼로그 표시 // 삭제 확인 다이얼로그 표시
final shouldDelete = await DeleteConfirmationDialog.show( final shouldDelete =
await DeleteConfirmationDialog.show(
context: context, context: context,
serviceName: displayName, serviceName: displayName,
); );
if (shouldDelete && context.mounted) { if (shouldDelete && context.mounted) {
// 사용자가 확인한 경우에만 삭제 진행 // 사용자가 확인한 경우에만 삭제 진행
final provider = Provider.of<SubscriptionProvider>( final provider =
Provider.of<SubscriptionProvider>(
context, context,
listen: false, listen: false,
); );
@@ -129,7 +142,8 @@ class SubscriptionListWidget extends StatelessWidget {
if (context.mounted) { if (context.mounted) {
AppSnackBar.showError( AppSnackBar.showError(
context: context, context: context,
message: AppLocalizations.of(context).subscriptionDeleted(displayName), message: AppLocalizations.of(context)
.subscriptionDeleted(displayName),
icon: Icons.delete_forever_rounded, icon: Icons.delete_forever_rounded,
); );
} }
@@ -152,7 +166,8 @@ class SubscriptionListWidget extends StatelessWidget {
} }
/// 특정 통화의 총 합계를 계산합니다. /// 특정 통화의 총 합계를 계산합니다.
double _calculateTotalByCurrency(List<SubscriptionModel> subscriptions, String currency) { double _calculateTotalByCurrency(
List<SubscriptionModel> subscriptions, String currency) {
return subscriptions return subscriptions
.where((sub) => sub.currency == currency) .where((sub) => sub.currency == currency)
.fold(0.0, (sum, sub) => sum + sub.monthlyCost); .fold(0.0, (sum, sub) => sum + sub.monthlyCost);

View File

@@ -258,7 +258,8 @@ class _SwipeableSubscriptionCardState extends State<SwipeableSubscriptionCard>
angle: _currentOffset / 2000, angle: _currentOffset / 2000,
child: SubscriptionCard( child: SubscriptionCard(
subscription: widget.subscription, subscription: widget.subscription,
onTap: widget.onTap, // onTap 콜백을 전달하여 SubscriptionCard 내부에서도 탭 처리 가능하도록 함 onTap: widget
.onTap, // onTap 콜백을 전달하여 SubscriptionCard 내부에서도 탭 처리 가능하도록 함
), ),
), ),
), ),

View File

@@ -35,7 +35,8 @@ class ThemedText extends StatelessWidget {
}); });
/// 배경 밝기에 따른 텍스트 색상 결정 /// 배경 밝기에 따른 텍스트 색상 결정
static Color getContrastColor(BuildContext context, { static Color getContrastColor(
BuildContext context, {
bool forceLight = false, bool forceLight = false,
bool forceDark = false, bool forceDark = false,
}) { }) {
@@ -58,21 +59,22 @@ class ThemedText extends StatelessWidget {
/// 글래스모피즘 컨텍스트인지 확인 /// 글래스모피즘 컨텍스트인지 확인
static bool _isGlassmorphicContext(BuildContext context) { static bool _isGlassmorphicContext(BuildContext context) {
// 부모 위젯 체인에서 글래스모피즘 카드가 있는지 확인 // 부모 위젯 체인에서 글래스모피즘 카드가 있는지 확인
final glassmorphic = context.findAncestorWidgetOfExactType<GlassmorphicIndicator>(); final glassmorphic =
context.findAncestorWidgetOfExactType<GlassmorphicIndicator>();
return glassmorphic != null; return glassmorphic != null;
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final textColor = color ?? getContrastColor( final textColor = color ??
getContrastColor(
context, context,
forceLight: forceLight, forceLight: forceLight,
forceDark: forceDark, forceDark: forceDark,
); );
final finalColor = opacity != null final finalColor =
? textColor.withValues(alpha: opacity!) opacity != null ? textColor.withValues(alpha: opacity!) : textColor;
: textColor;
final defaultStyle = DefaultTextStyle.of(context).style; final defaultStyle = DefaultTextStyle.of(context).style;

View File

@@ -104,8 +104,6 @@ class FaviconCache {
// 구글 파비콘 API 서비스 // 구글 파비콘 API 서비스
class GoogleFaviconService { class GoogleFaviconService {
// 구글 파비콘 API URL 생성 // 구글 파비콘 API URL 생성
static String getFaviconUrl(String domain, int size) { static String getFaviconUrl(String domain, int size) {
final directUrl = final directUrl =
@@ -137,7 +135,8 @@ class GoogleFaviconService {
static String getBase64PlaceholderIcon(String serviceName, Color color) { static String getBase64PlaceholderIcon(String serviceName, Color color) {
// 간단한 SVG 생성 (서비스 이름의 첫 글자를 원 안에 표시) // 간단한 SVG 생성 (서비스 이름의 첫 글자를 원 안에 표시)
final initial = serviceName.isNotEmpty ? serviceName[0].toUpperCase() : '?'; final initial = serviceName.isNotEmpty ? serviceName[0].toUpperCase() : '?';
final colorHex = color.toARGB32().toRadixString(16).padLeft(8, '0').substring(2); final colorHex =
color.toARGB32().toRadixString(16).padLeft(8, '0').substring(2);
// 공백 없이 SVG 생성 (공백이 있으면 Base64 디코딩 후 이미지 로드 시 문제 발생) // 공백 없이 SVG 생성 (공백이 있으면 Base64 디코딩 후 이미지 로드 시 문제 발생)
final svgContent = final svgContent =
@@ -568,7 +567,8 @@ class _WebsiteIconState extends State<WebsiteIcon>
boxShadow: widget.isHovered boxShadow: widget.isHovered
? [ ? [
BoxShadow( BoxShadow(
color: _getColorFromName().withValues(alpha: 0.3), // 약 0.3 알파값 color:
_getColorFromName().withValues(alpha: 0.3), // 약 0.3 알파값
blurRadius: 12, blurRadius: 12,
spreadRadius: 0, spreadRadius: 0,
offset: const Offset(0, 4), offset: const Offset(0, 4),