0

Is there any way to scan a credit card in flutter? i tried Card IO plug in and i tried using it but when i open the camera, it just shows me a box and when i focus on the card nothing happens.

Package used: https://pub.dartlang.org/packages/flutter_card_io

FlatButton(
  onPressed: () async {
    Map<String, dynamic> details = await FlutterCardIo.scanCard({
      "requireExpiry": true,
      "scanExpiry": true,
      "requireCVV": false,
      "requirePostalCode": false,
      "restrictPostalCodeToNumericOnly": false,
      "requireCardHolderName": false,
      "scanInstructions": "Fit the card within the box",
    });
    print(details);
  },
  child: Text("Test"),
), 

pubspec.yaml

dependencies:
  flutter_card_io:
    git:
      url: git://github.com/procedurallygenerated/flutter_card_io.git

If there is any possible way that anyone knows of i would be grateful! I really need it for an important project i am doing.

Matt Ke
  • 3,599
  • 12
  • 30
  • 49
Bahij.Mik
  • 1,358
  • 2
  • 9
  • 22

2 Answers2

2

A little late to the party I know, but I tried installing CardIO (the core one and the flutter one) anyway... Not only are they no longer maintained but they're not compatible :(

I got these errors on pub get.

  • The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.10 and higher. project ':core_card_io' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71 core_card_io: ^0.0.2

  • Because myapp depends on flutter_card_io >=0.0.2 which requires SDK version >=1.8.0 <2.0.0, version solving failed. flutter_card_io: ^0.0.3

So I found an alternative which does seem to do the job.

card_scanner 0.0.4

If you have another one to share, please do :)

Marina
  • 101
  • 1
  • 7
1

Currently, there seems to be no other plugin publicly available for Flutter. However, the one you mentioned should work fine. Try compiling the example application that comes with the plugin and use multiple cards to test it. Keep in mind that Card.io only works with cards that have raised digits.

KyIe LiebIer
  • 408
  • 2
  • 12