credit_form/validation library
Classes
- AddressCitySubmitRegexValidator
- AddressLineSubmitRegexValidator
- AddressPostalSubmitRegexValidator
- AddressStateSubmitRegexValidator
- CardNumberInputFormatter
- Card-number formatter. Grouping and the digit cap come from CardTypeRegs for the digits in this edit, so a pasted Amex number is 4-6-5 immediately.
- CardTypeRegs
- Brand prefixes, accepted lengths, and on-screen grouping.
- CreditCvvSubmitRegexValidator
- CreditExpirySubmitRegexValidator
- Expiration in MM/YY with slash (matches masked field output).
- CreditNameSubmitRegexValidator
- CreditNumberSubmitRegexValidator
- Card number check driven by CardTypeRegs: brand length, then Luhn.
- EmailEditingRegexValidator
- EmailSubmitRegexValidator
- FormValidator
- MaskedTextInputFormatter
- PhoneRegexValidator
- PhoneSubmitRegexValidator
- RegexValidator
- StringValidator
- ValidatorInputFormatter
Enums
Functions
-
isCreditExpiryOnOrAfterMonth(
String value, {DateTime? at}) → bool -
True when
valueis valid MM/YY and the expiry month is still current or in the future relative toat(defaults to DateTime.now). Cards are treated as valid through the last day of the printed month. -
isLikelyAmexCardDigits(
String digitsOnly) → bool - Returns true when digits-only input is consistent with an Amex PAN prefix.
-
luhnValid(
String digits) → bool -
Luhn (mod-10) check.
digitsmust be numeric; anything else is invalid.