card_utils library
Constants
- LENGTH_AMERICAN_EXPRESS → const int
- LENGTH_COMMON_CARD → const int
- LENGTH_DINERS_CLUB → const int
- MAX_LENGTH_AMEX_DINERS → const int
- MAX_LENGTH_COMMON → const int
Functions
-
getLengthForBrand(
String cardBrand) → int -
getPossibleCardType(
String? cardNumber, {bool shouldNormalize = true}) → String -
isValidCardLength(
String? cardNumber, {String? cardBrand}) → bool - Checks to see whether the input number is of the correct length, given the assumed brand of the card. This function does not perform a Luhn check.
-
isValidCardNumber(
String? cardNumber) → bool - Checks the input string to see whether or not it is a valid card number, possibly with groupings separated by spaces or hyphens.
-
isValidLuhnNumber(
String? cardNumber) → bool - Checks the input string to see whether or not it is a valid Luhn number.