flutter_document_scan_sdk 2.0.2  flutter_document_scan_sdk: ^2.0.2 copied to clipboard
flutter_document_scan_sdk: ^2.0.2 copied to clipboard
A wrapper for Dynamsoft Capture Vision SDK, capable of detecting document edges and rectifying documents.
Flutter Document Scan SDK #
A Flutter wrapper for the Dynamsoft Capture Vision SDK, featuring document detection and normalization.


Demo Video #
- 
iOS https://github.com/user-attachments/assets/d6f44994-ea37-4f72-8079-6492f52547d2 
- 
Windows https://github.com/user-attachments/assets/89113ad1-7699-49a7-ade0-81949cc8ced6 
- 
Web https://github.com/user-attachments/assets/3e51915b-c7ad-4406-8ef1-e5cb12fee806 
Supported Platforms #
- 
✅ Windows 
- 
✅ Linux 
- 
✅ Android 
- 
✅ iOS - 
Add camera and microphone usage descriptions to ios/Runner/Info.plist:<key>NSCameraUsageDescription</key> <string>Can I use the camera please?</string> <key>NSMicrophoneUsageDescription</key> <string>Can I use the mic please?</string>copied to clipboard
- 
Minimum deployment target: iOS 13.0 or later 
 
- 
- 
✅ Web In index.html, include:<script src="https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-bundle@3.0.3001/dist/dcv.bundle.min.js"></script>copied to clipboard
Prerequisites #
Getting Started #
- 
Set the license key in example/lib/global.dart:Future<int> initDocumentSDK() async { int? ret = await docScanner.init( "LICENSE-KEY"); ... }copied to clipboard
- 
Run the example project on your desired platform: cd example flutter run -d chrome # Run on Web flutter run -d linux # Run on Linux flutter run -d windows # Run on Windows flutter run # Run on default connected device (e.g., Android)copied to clipboard
API Reference #
| Method | Description | Parameters | Return Type | 
|---|---|---|---|
| Future<int?> init(String key) | Initializes the SDK with a license key. | key: License string | Future<int?> | 
| Future<NormalizedImage?> normalizeFile(String file, List<Offset> points, ColorMode color) | Normalizes a document image from a file. | file: Path to the image filepoints: Document corner pointscolor: output image color | Future<NormalizedImage?> | 
| Future<NormalizedImage?> normalizeBuffer(Uint8List bytes, int width, int height, int stride, int format, List<Offset> points, int rotation, ColorMode color) | Normalizes a document image from a raw image buffer. | bytes: Image bufferwidth,height: Image dimensionsstride: Row stride in bytesformat: Image pixel format indexpoints: Document corner pointsrotation: 0/90/180/270color: output image color | Future<NormalizedImage?> | 
| Future<List<DocumentResult>?> detectFile(String file) | Detects documents in an image file. | file: Path to the image file | Future<List<DocumentResult>?> | 
| Future<List<DocumentResult>?> detectBuffer(Uint8List bytes, int width, int height, int stride, int format, int rotation) | Detects documents from a raw image buffer. | bytes: Image bufferwidth,height: Image dimensionsstride: Row stride in bytesformat: Image pixel format indexrotation: 0/90/180/270 | Future<List<DocumentResult>?> |