insurance_card_scanner 0.3.0 copy "insurance_card_scanner: ^0.3.0" to clipboard
insurance_card_scanner: ^0.3.0 copied to clipboard

A library that makes it easy to add health insurance card scanning to any flutter application.

Flutter library for scanning insurance cards.

Features #

Adds a widget which scans insurance cards using the device's camera.

Getting started #

Android camera permissions #

Add the following line to your AndroidManifest.xml file:

<key>NSCameraUsageDescription</key>
<string>To scan cards please grant camera access</string>

iOS camera permissions #

Add the following lines to your Info.plist file:

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

Usage #

CardScanner #

Use it on your custom screens like any other widget:

import 'package:insurance_card_scanner/insurance_card_scanner.dart';

class ScannerWidgetScreen extends StatelessWidget {
  const ScannerWidgetScreen({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Scanner widget'),
      ),
      body: CardScanner(
        sessionToken: 'pass your token here',
        onSuccess: (card) {
          print('Scan success');
        },
        onCardScanError: (message) {
          print(message ?? 'Scan error');
        },
        onWebViewLoadError: () {
          print('WebView load error');
        },
        onCardScanCancel: () {
          Navigator.of(context).pop();
        },
      ),
    );
  }
}

CardScannerModal #

Push it using Navigator to open a full-screen scanner.


Navigator.of(context).push(
  CardScanModal(
    sessionToken: 'pass your token here',
    onSuccess: (card) {
      print('Scan success');
    },
    onCardScanError: (message) {
      print(message ?? 'Scan error');
    },
    onWebViewLoadError: () {
      print('WebView load error');
    },
    onCardScanCancel: () {
      Navigator.of(context).pop();
    },
  ),
);

1
likes
110
pub points
51%
popularity

Publisher

verified publishercardscan.ai

A library that makes it easy to add health insurance card scanning to any flutter application.

Homepage

Documentation

Documentation
API reference

License

unknown (LICENSE)

Dependencies

flutter, permission_handler, pubspec_parse, url_launcher, webview_flutter, webview_flutter_android, webview_flutter_wkwebview

More

Packages that depend on insurance_card_scanner