Repositório GitHubishaquehassan/document_scanner_flutter

document_scanner_flutter

Um plug-in de digitalização de documentos para o flutter

Capa do projeto document_scanner_flutter
Estrelas
63
Forks
136
Último push (UTC)
1 de mar. de 2026
Status do projeto
Ativo

README original

Texto original em inglês. Visite o GitHub para a versão atual.

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
Autor no GitHub

Ishaq Hassan ↗

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

@DigitalHire-NewKarachi, PakistanSite oficial ↗
LinguagensDartKotlinSwiftRubyObjective-CShell

Pacotes publicados por este repositório

Dependências usadas

Lista de dependências 5 itens

Como escolher um repositório para seu projeto?

Filtre pelo caso de uso, compare a atividade e confira o projeto original antes de adotá-lo.

  1. Busque por nome, autor ou descrição e filtre por tema.
  2. Compare estrelas, forks e envios recentes. Estrelas indicam interesse, mas não garantem qualidade.
  3. Confira o README, a licença e as issues no GitHub antes de usar o projeto.

Fontes e manutenção

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

GitHub Docs — About repositories ↗