copyWith method
Creates a copy of this CreditCardModel with the given fields replaced with new values.
Returns a new CreditCardModel instance with updated fields.
Implementation
CreditCardModel copyWith({
String? number,
String? expirationMonth,
String? expirationYear,
String? holderName,
}) {
return CreditCardModel(
number: number ?? this.number,
expirationMonth: expirationMonth ?? this.expirationMonth,
expirationYear: expirationYear ?? this.expirationYear,
holderName: holderName ?? this.holderName,
);
}