flutter_card_io 0.0.3

  • README.md
  • Example
  • Installing
  • Versions
  • 82

CardIO plugin for flutter

A Flutter plugin for iOS and Android for scanning credit cards using the camera. This uses the CardIO library for iOS and Android

Note: This plugin is still under development, and some APIs might not be available yet. Feedback and pull requests are welcome!


First, add flutter_card_io as a dependency in your pubspec.yaml file.


Add the following key to your Info.plist file, located in <project root>/ios/Runner/Info.plist:

NSCameraUsageDescription - Set the value to be a string describing why your app needs to use the camera (e.g. "To scan credit cards."). This string will be displayed when the app initially requests permission to access the camera.


Add the following permission to your Android Manifest, located in `<project root>/android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.CAMERA"/>

Add card.io's open source license acknowledgments to your app's acknowledgments.


  Map<String, dynamic> details = await FlutterCardIo.scanCard({
    "requireExpiry": true,
    "scanExpiry": true,
    "requireCVV": true,
    "requirePostalCode": true,
    "restrictPostalCodeToNumericOnly": true,
    "requireCardHolderName": true,
    "scanInstructions": "Hola! Fit the card within the box",


    "cardholderName": "John doe",
    "cardNumber": "1234 5678 9876 1236",
    "redactedCardNumber": "**** **** **** 1236",
    "expiryMonth": 12,
    "expiryYear": 2022,
    "cvv": 123,
    "postalCode": "93748"

[0.0.3] - Return cardType.

  • Return credit card type

[0.0.2] - Updated readme.

  • Update readme so it looks good on pub.dartlang.org

[0.0.1] - Initial release.

  • Add android and iOS sdk


import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_card_io/flutter_card_io.dart';

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  _MyAppState createState() => new _MyAppState();

class _MyAppState extends State<MyApp> {
  Map<String, dynamic> _data = {};

  initState() {

  // Platform messages are asynchronous, so we initialize in an async method.
  _scanCard() async {
    Map<String, dynamic> details;
    // Platform messages may fail, so we use a try/catch PlatformException.
    try {
      details = await FlutterCardIo.scanCard({
        "requireExpiry": true,
        "scanExpiry": true,
        "requireCVV": true,
        "requirePostalCode": true,
        "restrictPostalCodeToNumericOnly": true,
        "requireCardHolderName": true,
        "scanInstructions": "Hola! Fit the card within the box",

    } on PlatformException {

    if (details == null) {

    if (!mounted) return;

    setState(() {
      _data = details;

  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text('CardIO sample app'),
        body: new Column(
          children: <Widget>[
            new Column(
              children: _data.keys.map((String key) {
                return new Text(_data[key].toString());
            new Container(
              margin: new EdgeInsets.all(30.0),
              child: new Center(
                child: new RaisedButton(
                  child: new Text("Scan"),
                  onPressed: _scanCard,

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  flutter_card_io: "^0.0.3"

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

      import 'package:flutter_card_io/flutter_card_io.dart';
Version Uploaded Documentation Archive
0.0.3 Feb 27, 2018 Go to the documentation of flutter_card_io 0.0.3 Download flutter_card_io 0.0.3 archive
0.0.2 Feb 26, 2018 Go to the documentation of flutter_card_io 0.0.2 Download flutter_card_io 0.0.2 archive
0.0.1 Feb 26, 2018 Go to the documentation of flutter_card_io 0.0.1 Download flutter_card_io 0.0.1 archive


We analyzed this package on Jul 13, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3
  • Flutter: 0.5.4


Describes how popular the package is relative to other packages. [more]
72 / 100
Code health derived from static analysis. [more]
88 / 100
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
Learn more about scoring.


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.


  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 1 hint.

    Run flutter format to format lib/flutter_card_io.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.6 1.14.10
meta 1.1.5
sky_engine 0.0.99
typed_data 1.1.5
vector_math 2.0.6 2.0.7