Initial commit: SubManager Flutter App
주요 구현 완료 기능: - 구독 관리 (추가/편집/삭제/카테고리 분류) - 이벤트 할인 시스템 (기본값 자동 설정) - SMS 자동 스캔 및 구독 정보 추출 - 알림 시스템 (타임존 처리 안정화) - 환율 변환 지원 (KRW/USD) - 반응형 UI 및 애니메이션 - 다국어 지원 (한국어/영어) 버그 수정: - NotificationService tz.local 초기화 오류 해결 - MainScreenSummaryCard 레이아웃 오버플로우 수정 - 구독 추가 시 LateInitializationError 완전 해결 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
64
lib/models/subscription.dart
Normal file
64
lib/models/subscription.dart
Normal file
@@ -0,0 +1,64 @@
|
||||
class Subscription {
|
||||
final String id;
|
||||
final String serviceName;
|
||||
final double monthlyCost;
|
||||
final String billingCycle;
|
||||
final DateTime nextBillingDate;
|
||||
final String? category;
|
||||
final String? notes;
|
||||
final int repeatCount;
|
||||
final DateTime? lastPaymentDate;
|
||||
final String? websiteUrl;
|
||||
final String currency;
|
||||
|
||||
Subscription({
|
||||
required this.id,
|
||||
required this.serviceName,
|
||||
required this.monthlyCost,
|
||||
required this.billingCycle,
|
||||
required this.nextBillingDate,
|
||||
this.category,
|
||||
this.notes,
|
||||
this.repeatCount = 1,
|
||||
this.lastPaymentDate,
|
||||
this.websiteUrl,
|
||||
this.currency = 'KRW',
|
||||
});
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
'id': id,
|
||||
'serviceName': serviceName,
|
||||
'monthlyCost': monthlyCost,
|
||||
'billingCycle': billingCycle,
|
||||
'nextBillingDate': nextBillingDate.toIso8601String(),
|
||||
'category': category,
|
||||
'notes': notes,
|
||||
'repeatCount': repeatCount,
|
||||
'lastPaymentDate': lastPaymentDate?.toIso8601String(),
|
||||
'websiteUrl': websiteUrl,
|
||||
'currency': currency,
|
||||
};
|
||||
}
|
||||
|
||||
factory Subscription.fromMap(Map<String, dynamic> map) {
|
||||
return Subscription(
|
||||
id: map['id'] as String,
|
||||
serviceName: map['serviceName'] as String,
|
||||
monthlyCost: map['monthlyCost'] as double,
|
||||
billingCycle: map['billingCycle'] as String,
|
||||
nextBillingDate: DateTime.parse(map['nextBillingDate'] as String),
|
||||
category: map['category'] as String?,
|
||||
notes: map['notes'] as String?,
|
||||
repeatCount: (map['repeatCount'] as num?)?.toInt() ?? 1,
|
||||
lastPaymentDate: map['lastPaymentDate'] != null
|
||||
? DateTime.parse(map['lastPaymentDate'] as String)
|
||||
: null,
|
||||
websiteUrl: map['websiteUrl'] as String?,
|
||||
currency: map['currency'] as String? ?? 'KRW',
|
||||
);
|
||||
}
|
||||
|
||||
// 주기적 결제 여부 확인
|
||||
bool get isRecurring => repeatCount > 1;
|
||||
}
|
||||
Reference in New Issue
Block a user