Skip to content
pubscout

credit_card_validator

2.1.0, released 3 years ago by an unverified publisher

Validates credit card numbers, expiration dates, and CVVs based on card type.

WASM-readyUnverified publisher
$ flutter pub add credit_card_validator
Source repository

What it does

Validates credit card numbers, expiration dates, and security codes (CVV/CVC) in real time while typing. It also identifies the credit card type and supports custom credit card definitions.

AI-written summary of version 2.1.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to validate credit card inputs in a checkout form as the user types.
  • You want to detect the credit card network/type from the card number.

Skip it when

  • You need actual payment processing or server-side bank verification.
  • You require robust form builders that handle more than just credit card fields.

Strengths

  • Supports 'potentially valid' input states for live UI feedback during typing.
  • Supports multiple popular credit card networks and custom card definitions.

Weaknesses

  • Does not verify card information with a bank or payment processor.
  • Limited documentation on all configuration options outside the basic README.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1
import 'package:credit_card_validator/credit_card_validator.dart';

final _ccValidator = CreditCardValidator();
var ccNumResults = _ccValidator.validateCCNum(ccNum);

Alternatives

Packages that do the same job and could replace credit_card_validator.

Works with

Packages commonly used together with credit_card_validator: ones it builds on, ones built on it, and its own family.