card_scan 1.0.0 copy "card_scan: ^1.0.0" to clipboard
card_scan: ^1.0.0 copied to clipboard

A Flutter plugin for card scanning.

Card Scan Flutter Plugin #

Flutter plugin for scanning credit/debit cards directly in your app.
Supports Android (Google Pay OCR API) and iOS (native SwiftUI scanner).

๐Ÿš€ Features #

  • Scan card number with camera
  • Recognize expiration date
  • Capture cardholder name (iOS only)

๐Ÿ“ฆ Installation #

Add to your pubspec.yaml:

dependencies:
  card_scan: ^1.0.0

โš™๏ธ Setup #

Android #

  • Connect Google Pay API for test or production
  • Ensure Google account signed in on device

iOS #

  • Minimum iOS version: 13.0
  • Add camera permission in Info.plist:
<key>NSCameraUsageDescription</key>
<string>We need camera access to scan your card</string>

๐Ÿ”ฅ Usage #

import 'dart:io';
import 'package:card_scan/card_scan.dart';

// Android usage example
if (Platform.isAndroid) {
  final result = await GoogleCardScanner.scan(testEnvironment: true);
  print(result?.number);
}

// iOS camera view example
Stack(
  children: [
    /// Camera + scanner
    Positioned.fill(
      child: CardScan(
        onScanned: (event) {
          if (!isProcessed) {
            isProcessed = true;
            Navigator.of(context).pop(event); // return event
          }
        },
      ),
    ),

    // Custom overlay here
  ],
)

  • GoogleCardScanner.scan() โ€” Android OCR using Google Pay
  • CardScannerModal โ€” iOS SwiftUI camera view

๐Ÿงช Notes #

  • Android OCR requires a signed-in Google account and production access to Google Pay API.
  • Use testEnvironment: true for test cards.
  • iOS scanning works offline.
11
likes
0
points
19
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin for card scanning.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on card_scan

Packages that implement card_scan