Search code examples
fluttercredit-cardcard.io

Why does nothing happen when I focus the camera on a card using Flutter Card IO?


I'm using the Card IO plug-in to scan a credit card in Flutter. When I open the camera, it just shows me a box and when I focus on the card, nothing happens:

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

How can I fix this so it scans the card?


Solution

  • 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.