CardDetails class
Class encapsulating the card's data as well as validation of the data.
CardDetails.validState == ValidState.ok
when fields are filled and validated as correct.
Constructors
- CardDetails({required String? cardNumber, required String? securityCode, required String? expirationString, required String? postalCode})
- CardDetails.blank()
-
Sets every field to null, a default
CardDetails
when nothing has been entered.factory
Properties
- cardNumber ↔ String?
-
Returns the CardNumber as a
String
with the spaces removed.getter/setter pair - cardNumberFilled → bool
-
Returns true if
_cardNumber
is null, or if the _cardNumber matches the detectedprovider
's card lenght, defaulting to 16.no setter - expirationDate ↔ DateTime?
-
getter/setter pair
- expirationString ↔ String?
-
getter/setter pair
- expMonth → String
-
no setter
- expYear → String
-
no setter
- hash → int
-
Provides a hash of the CardDetails object
Hashes
_cardNumber
,expirationString
,securityCode
, andpostalCode
.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- isComplete → bool
-
Returns true if all details are complete and valid
otherwise, return false.
no setter
- maxINNLength → int
-
The maximum length of the INN (identifier)
of a card provider.
no setter
-
onCompleteController
↔ StreamController<
CardDetails> -
getter/setter pair
- overrideValidState ← CardDetailsValidState
-
no getter
- postalCode ↔ String?
-
getter/setter pair
- provider ↔ CardProvider?
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- securityCode ↔ String?
-
getter/setter pair
- validState → CardDetailsValidState
-
Checks the validity of the
CardDetails
and returns the result.no setter
Methods
-
broadcastStatus(
) → void -
Detects if the card is complete, then broadcasts
card details to
onCompleteController
-
checkIsValid(
) → void -
Validates each field of the
CardDetails
object in entry order, namely _cardNumber -> expirationString -> securityCode -> postalCode -
detectCardProvider(
) → void -
Iterates over the list
_providers
, detecting which provider the current_cardNumber
falls under. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited