GitHub repositoryishaquehassan/document_scanner_flutter

document_scanner_flutter

A document scanner plugin for flutter

document_scanner_flutter project cover
Stars
63
Forks
136
Last push (UTC)
Mar 1, 2026
Project status
Active

Original README

English project snapshot. Visit GitHub for the latest content.

document_scanner_flutter pub package

A document scanner + PDF generator plugin for Flutter. Supports Android and iOS with auto edge detection, cropping, B&W filter, and PDF generation.

Requirements

Platform Minimum Version
Android API 21 (Android 5.0)
iOS iOS 12.0
Flutter 3.0.0
Dart 2.17.0

Getting Started

Installing
document_scanner_flutter: ^0.4.0

Usage

Basic — Camera or Gallery picker
final File? scannedDoc = await DocumentScannerFlutter.launch(context);
// returns null if user cancels
Specific source
final File? scannedDoc = await DocumentScannerFlutter.launch(
  context,
  source: ScannerFileSource.CAMERA, // or ScannerFileSource.GALLERY
);
Re-edit an existing image (v0.4.0+)
final Uint8List imageBytes = await myFile.readAsBytes();

final File? rescanned = await DocumentScannerFlutter.launch(
  context,
  source: ScannerFileSource.CAMERA,
  initialImage: imageBytes,
  canBackToInitial: true,
);
Recover last scan after crash (v0.4.0+)
// Call this on app startup to recover image lost due to process death
final File? recovered = await DocumentScannerFlutter.retrieveLostData();
if (recovered != null) {
  // use recovered image
}
PDF generation from multiple scans
final File? pdfFile = await DocumentScannerFlutter.launchForPdf(
  context,
  source: ScannerFileSource.CAMERA,
);
// returns a PDF File or null if cancelled
Labels customization
final File? scannedDoc = await DocumentScannerFlutter.launch(
  context,
  source: ScannerFileSource.CAMERA,
  labelsConfig: {
    ScannerLabelsConfig.ANDROID_NEXT_BUTTON_LABEL: 'Next',
    ScannerLabelsConfig.ANDROID_SAVE_BUTTON_LABEL: 'Save',
    ScannerLabelsConfig.ANDROID_ROTATE_LEFT_LABEL: 'Rotate Left',
    ScannerLabelsConfig.ANDROID_ROTATE_RIGHT_LABEL: 'Rotate Right',
    ScannerLabelsConfig.ANDROID_ORIGINAL_LABEL: 'Original',
    ScannerLabelsConfig.ANDROID_BMW_LABEL: 'B & W',
    ScannerLabelsConfig.PICKER_CAMERA_LABEL: 'Camera',
    ScannerLabelsConfig.PICKER_GALLERY_LABEL: 'Gallery',
    ScannerLabelsConfig.PICKER_CANCEL_LABEL: 'Cancel',
    ScannerLabelsConfig.ANDROID_INITIAL_IMAGE_LOADING_MESSAGE: 'Loading image...',
  },
);

Changelog

See CHANGELOG.md for full release history.

Ishaq Hassan GitHub avatar
GitHub author

Ishaq Hassan ↗

Flutter Framework Contributor | Engineering Manager @ DigitalHire | Open Source Author

@DigitalHire-NewKarachi, PakistanOfficial website ↗
LanguagesDartKotlinSwiftRubyObjective-CShell

Packages published by this repository

Dependencies used

Dependency list 5 items

How do I choose a repository?

Start with your use case, compare repository activity, and check the original project before adopting it.

  1. Search by repository name, owner or description, then narrow the results by topic.
  2. Compare stars, forks and recent pushes. Stars show community interest, not a guarantee of quality.
  3. Read the README, license and issues on GitHub before using a project.

Sources and maintenance

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗