CreditCardModel class

Represents a credit card model with essential information.

This class encapsulates the details of a credit card, including the card number, expiration date (month and year), and the cardholder's name.

Constructors

CreditCardModel.new({required String number, required String expirationMonth, required String expirationYear, required String holderName})
Constructs a CreditCardModel with the required parameters.
CreditCardModel.fromJson(String source)
Creates a CreditCardModel from a JSON string.
factory
CreditCardModel.fromMap(Map<String, dynamic> map)
Creates a CreditCardModel from a map of key-value pairs.
factory

Properties

creditCardNumberValidationResults ↔ CCNumValidationResults?
The validation results for the credit card number. This property provides information about the validity of the credit card number.
getter/setter pair
expirationMonth String
The expiration month of the credit card.
getter/setter pair
expirationYear String
The expiration year of the credit card.
getter/setter pair
expiryDate String
Returns the expiry date in the format 'MM/YYYY'.
no setter
hashCode int
Generates a hash code for the CreditCardModel.
no setteroverride
holderName String
The name of the credit card holder.
getter/setter pair
isValide bool
Checks if the credit card information is valid.
no setter
number String
The credit card number.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({String? number, String? expirationMonth, String? expirationYear, String? holderName}) CreditCardModel
Creates a copy of this CreditCardModel with the given fields replaced with new values.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() String
Converts this CreditCardModel to a JSON string.
toMap() Map<String, dynamic>
Converts this CreditCardModel to a map of key-value pairs.
toString() String
Returns a string representation of this CreditCardModel.
override

Operators

operator ==(Object other) bool
Compares this CreditCardModel with another object for equality.
override