document_capture 0.0.2 copy "document_capture: ^0.0.2" to clipboard
document_capture: ^0.0.2 copied to clipboard

DocuCapture is a Flutter package that provides a simple way to capture documents using a camera.

document_capture #

A Flutter package for scanning and capturing identity documents using the device camera.

Currently supports Kenya National ID cards (front and back), with planned support for passports and driver licenses.


โœจ Features #

  • ๐Ÿ“„ Scan identity documents using camera
  • ๐Ÿ‡ฐ๐Ÿ‡ช Kenya National ID support (Front & Back)
  • ๐Ÿ“ท Real-time image capture
  • ๐Ÿ” Automatic document detection
  • ๐Ÿงพ MRZ (Machine Readable Zone) data extraction (Back of ID)
  • โšก Lightweight and easy to integrate

๐Ÿš€ Getting started #

Add the package to your pubspec.yaml:

dependencies:
  document_capture: ^0.0.2

Then run:

flutter pub get

๐Ÿ“ฆ Usage #

Import the package:

import 'dart:io';
import 'package:flutter/material.dart';
import 'package:document_capture/widget/id_scan_button.dart';
import 'package:document_capture/mrz_parser/mrz_result.dart';

Example: Scanning ID (Front & Back) #

class IdScanExample extends StatefulWidget {
  @override
  State<IdScanExample> createState() => _IdScanExampleState();
}

class _IdScanExampleState extends State<IdScanExample> {
  File? frontImage;
  File? backImage;
  File? faceImage;
  MRZContent? mrzContent;

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        // Scan Front of ID
        IdFrontScanButton(
          onCompleted: (result) {
            setState(() {
              frontImage = result['captureImage'] as File;
              faceImage = result['faceImage'] as File?;
            });
          },
          child: const Text('Scan Front of ID'),
        ),

        const SizedBox(height: 20),

        // Scan Back of ID
        IdBackScanButton(
          onCompleted: (result) {
            setState(() {
              backImage = result['fileImage'] as File;
              mrzContent = result['mrzContent'] as MRZContent;
            });
          },
          child: const Text('Scan Back of ID'),
        ),

        const SizedBox(height: 20),

        // Display extracted data
        if (mrzContent != null) ...[
          Text('Full Name: ${mrzContent!.fullNames}'),
          Text('ID Number: ${mrzContent!.personalNumber2}'),
          Text('Date of Birth: ${mrzContent!.birthDate}'),
          Text('Gender: ${mrzContent!.sex}'),
        ],
      ],
    );
  }
}

๐Ÿ“Œ Supported Documents #

Document Type Status
Kenya National ID โœ… Supported
Passport ๐Ÿšง Planned
Driver License ๐Ÿšง Planned

๐Ÿ“Œ Use cases #

  • KYC (Know Your Customer)
  • Fintech onboarding
  • Identity verification systems
  • Insurance and government applications

โš ๏ธ Requirements #

  • Camera permission required
  • Works on Android and iOS

โš ๏ธ Limitations #

  • Currently supports only Kenya National ID
  • Other document types are planned but not yet implemented

๐Ÿ”ฎ Roadmap #

  • Passport scanning support
  • Driver license scanning
  • Multi-country document support
  • Improved OCR and data extraction

๐Ÿค Contributions #

Contributions are welcome! Feel free to open issues or submit pull requests.


๐Ÿ“„ License #

MIT License

0
likes
120
points
38
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

DocuCapture is a Flutter package that provides a simple way to capture documents using a camera.

Homepage

License

MIT (license)

Dependencies

camera, camera_platform_interface, dotted_border, flutter, google_mlkit_commons, google_mlkit_face_detection, google_mlkit_text_recognition, image, image_picker, intl, path_provider

More

Packages that depend on document_capture