CardInfoModel class
CardInfoModel is a Dart class automatically generated using json_annotation. It represents card information obtained from a scanning process, typically used in applications that involve credit card scanning or processing. Properties:
- number: A string representing the card number.
- expiryDate: A string representing the card's expiry date.
- expiryMonth: An integer representing the card's expiry month.
- cardholderName: A string representing the name of the cardholder. Example Usage:
// Creating an instance of CardInfoModel
CardInfoModel cardInfo = CardInfoModel(
number: "1234 5678 9012 3456",
expiryDate: "2023 or 23",
expiryMonth: 12,
cardholderName: "John Doe",
);
Note: This class is typically used for serializing and deserializing JSON data related to card information, and it serves as a model for representing card details in the Dart programming language.
- Annotations
-
- @JsonSerializable()
Constructors
- CardInfoModel({String? number, String? expiryDate, String? expiryMonth, String? cardholderName})
- Constructor for creating a CardInfoModel instance.
-
CardInfoModel.fromJson(Map<
String, dynamic> json) -
Factory method for creating a CardInfoModel instance from a JSON map.
factory
Properties
- cardholderName → String?
-
Name of the cardholder.
final
- expiryDate → String?
-
Expiry year of the card.
final
- expiryMonth → String?
-
Expiry month of the card.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- number → String?
-
Card number.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Method for converting a CardInfoModel instance to a JSON map.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited