document_scan
0.5.0, released 3 weeks ago by toughapps.app
Offline document edge detection for Flutter returning corner coordinates.
What it does
Detects document edges and corner coordinates from live camera frames or still photos using native vision engines. It performs perspective correction and filtering to produce clean scanned documents, leaving UI and camera management entirely to the developer.
AI-written summary of version 0.5.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need custom camera UI and UX while retaining document edge detection.
- You require fully offline document scanning without external cloud services or bundled ML models.
- You need corner coordinates and processed image bytes rather than a pre-packaged fullscreen view.
Skip it when
- You want a ready-to-use drop-in fullscreen document scanner UI out of the box.
- You need built-in OCR capabilities included with the scanner.
Strengths
- Widget-free and camera-agnostic, giving full control over the user interface.
- Runs fully offline using native platform vision engines (Apple Vision on iOS, OpenCV on Android).
- Supports real-time live-frame detection streams with stabilization and auto-capture analysis.
Weaknesses
- Requires you to bring your own camera package and build the camera preview and overlay UI.
- Perspective-correction warp is CPU intensive and runs on a background isolate.
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
No camera dependency bundled; you must supply your own camera setup and pass frames as ScanInput.
import 'package:document_scan/document_scan.dart';
final scanner = DocumentScanner();
final scan = await scanner.scan(ScanInput.file('/path/to/photo.jpg'));
if (scan != null) {
Image.memory(scan.bytes);
}Alternatives
Packages that do the same job and could replace document_scan.
- camera_android
Android implementation of the camera plugin using the Camera2 library.
85Compare - camera_avfoundation
iOS implementation of the Flutter camera plugin providing preview, photo, and video capture.
84Compare - cunning_document_scanner
Scan paper documents and convert them to images or PDFs with auto-cropping.
92Compare - camera_android_camerax
Android camera implementation using CameraX library
89Compare
Works with
Packages commonly used together with document_scan: ones it builds on, ones built on it, and its own family.