feat: improve sms scan review and detail layouts
This commit is contained in:
@@ -14,6 +14,7 @@ class Subscription {
|
||||
final String currency;
|
||||
final String? paymentCardId;
|
||||
final PaymentCardSuggestion? paymentCardSuggestion;
|
||||
final String? rawMessage;
|
||||
|
||||
Subscription({
|
||||
required this.id,
|
||||
@@ -29,8 +30,50 @@ class Subscription {
|
||||
this.currency = 'KRW',
|
||||
this.paymentCardId,
|
||||
this.paymentCardSuggestion,
|
||||
this.rawMessage,
|
||||
});
|
||||
|
||||
Subscription copyWith({
|
||||
String? id,
|
||||
String? serviceName,
|
||||
double? monthlyCost,
|
||||
String? billingCycle,
|
||||
DateTime? nextBillingDate,
|
||||
String? category,
|
||||
String? notes,
|
||||
int? repeatCount,
|
||||
DateTime? lastPaymentDate,
|
||||
String? websiteUrl,
|
||||
String? currency,
|
||||
String? paymentCardId,
|
||||
PaymentCardSuggestion? paymentCardSuggestion,
|
||||
String? rawMessage,
|
||||
}) {
|
||||
return Subscription(
|
||||
id: id ?? this.id,
|
||||
serviceName: serviceName ?? this.serviceName,
|
||||
monthlyCost: monthlyCost ?? this.monthlyCost,
|
||||
billingCycle: billingCycle ?? this.billingCycle,
|
||||
nextBillingDate: nextBillingDate ?? this.nextBillingDate,
|
||||
category: category ?? this.category,
|
||||
notes: notes ?? this.notes,
|
||||
repeatCount: repeatCount ?? this.repeatCount,
|
||||
lastPaymentDate: lastPaymentDate ?? this.lastPaymentDate,
|
||||
websiteUrl: websiteUrl ?? this.websiteUrl,
|
||||
currency: currency ?? this.currency,
|
||||
paymentCardId: paymentCardId ?? this.paymentCardId,
|
||||
paymentCardSuggestion: paymentCardSuggestion ??
|
||||
(this.paymentCardSuggestion != null
|
||||
? PaymentCardSuggestion(
|
||||
issuerName: this.paymentCardSuggestion!.issuerName,
|
||||
last4: this.paymentCardSuggestion!.last4,
|
||||
source: this.paymentCardSuggestion!.source,
|
||||
)
|
||||
: null),
|
||||
rawMessage: rawMessage ?? this.rawMessage,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
'id': id,
|
||||
@@ -48,6 +91,7 @@ class Subscription {
|
||||
'paymentCardSuggestionIssuer': paymentCardSuggestion?.issuerName,
|
||||
'paymentCardSuggestionLast4': paymentCardSuggestion?.last4,
|
||||
'paymentCardSuggestionSource': paymentCardSuggestion?.source,
|
||||
'rawMessage': rawMessage,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -74,6 +118,7 @@ class Subscription {
|
||||
source: map['paymentCardSuggestionSource'] as String?,
|
||||
)
|
||||
: null,
|
||||
rawMessage: map['rawMessage'] as String?,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user