feat: 알림 설정 개선 및 USD 환율 자동 적용
- 알림 권한 첫 부여 시 기본 설정 자동 적용 (2일전, 반복 알림 활성화) - 반복 알림 설명 문구를 설정 상태에 따라 동적으로 변경 - USD 통화 구독에 대한 환율 자동 적용 기능 추가 - 설정 화면 텍스트 색상을 어두운 색상으로 변경하여 가독성 향상 - 광고 위젯 레이아웃 및 화면 간격 조정 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:hive/hive.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
import '../models/subscription_model.dart';
|
||||
import '../services/notification_service.dart';
|
||||
import '../services/exchange_rate_service.dart';
|
||||
import 'category_provider.dart';
|
||||
|
||||
class SubscriptionProvider extends ChangeNotifier {
|
||||
@@ -15,9 +16,19 @@ class SubscriptionProvider extends ChangeNotifier {
|
||||
bool get isLoading => _isLoading;
|
||||
|
||||
double get totalMonthlyExpense {
|
||||
final exchangeRateService = ExchangeRateService();
|
||||
final rate = exchangeRateService.cachedUsdToKrwRate ??
|
||||
ExchangeRateService.DEFAULT_USD_TO_KRW_RATE;
|
||||
|
||||
return _subscriptions.fold(
|
||||
0.0,
|
||||
(sum, subscription) => sum + subscription.currentPrice, // 이벤트 가격 반영
|
||||
(sum, subscription) {
|
||||
final price = subscription.currentPrice;
|
||||
if (subscription.currency == 'USD') {
|
||||
return sum + (price * rate);
|
||||
}
|
||||
return sum + price;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -44,6 +55,9 @@ class SubscriptionProvider extends ChangeNotifier {
|
||||
_isLoading = true;
|
||||
notifyListeners();
|
||||
|
||||
// 환율 정보 미리 로드
|
||||
await ExchangeRateService().getUsdToKrwRate();
|
||||
|
||||
_subscriptionBox = await Hive.openBox<SubscriptionModel>('subscriptions');
|
||||
await refreshSubscriptions();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user