flutter_cardidy 1.0.0 icon indicating copy to clipboard operation
flutter_cardidy: ^1.0.0 copied to clipboard

A flutter port of Cardidy, a package to validate or identify card numbers & cvv with ease.

Flutter Cardidy #

pub package publisher pub package GitHub Stars Flutter Tests

Buy Me A Coffee

A plugin to validate or identify card numbers & cvv with ease.

This flutter package will help you validate card numbers or CVVs and identiy card issuing provider with minimal code and efforts.

  • simple and easy
  • regex-free
  • up-to-date with Wikipedia
  • no other dependencies
  • well documented
  • production-ready

This package is a Flutter port of original package Cardidy written in C#. #


NOTE: The closer we are to an official spec is the Wikipedia's Payment card number page.

Installation #

      dependencies:
        flutter_cardidy: ^1.0.0

Getting Started #

Add the dependency to your project and start using Flutter Cardidy everywhere:

Import the package.

import 'package:flutter_cardidy/flutter_cardidy.dart';

To validate and identify card's issuing provider

// single card number identification
final result = FlutterCardidy.identify("4127540509730813");
Console.WriteLine(result.first); // print Visa

Multi card identification

// returns a KVP Map of, cardnum as key & result as value
final mapResult = FlutterCardidy.identifyMultiple(["4127540509730813","4771320594031"]);

Validating CVV

var cvv = "123";
var visaCvvIsValid = FlutterCardidy.isCvvValid(cvv, CardType.Visa);

Validating card number without identification

var isCardValid = FlutterCardidy.isCardNumberValid("47!Z320594033");

Properties #

Return type of Identify is List<CardType>. A card is sometimes a co-branded card like Visa or Visa Electron, in this case all matching providers are returned.

PropertyTypeDefaultNote
cardNumString (required)String-Your card number input string
validateLengthbooltrueValidate the length as part of the String identification.
A false value can be useful to identify the fragment of a card number.
ignoreNoiseboolfalseIgnore common noise found in card number. This noise is any of - ..
handleAnonymizationboolfalseSet any non-digits to zero. It is common to use "X" and "#" to hide some digits.

Improve #

Help me by reporting bugs, submit new ideas for features or anything else that you want to share.

  • Just write an issue on GitHub. ✏️
  • And don't forget to hit the like button for this package ✌️

More #

Check out my other useful packages on pub.dev

License #

MIT

1
likes
120
pub points
4%
popularity

Publisher

verified publisher iconhey24sheep.com

A flutter port of Cardidy, a package to validate or identify card numbers & cvv with ease.

Repository (GitHub)

Documentation

Documentation
API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_cardidy