document_camera_frame 2.2.3
document_camera_frame: ^2.2.3 copied to clipboard
Flutter package for capturing and cropping document images with a customizable camera interface.
2.2.1 2.2.3 #
- Update Readme.md
- Update metadata
- Update example
2.2.0 #
added:
- Major internal refactoring: Separated UI and business logic for better maintainability.
- Improved Architecture:
- UI split into
DocumentCameraPreviewLayerandDocumentCameraOverlayLayer. - State management and business logic extracted into
DocumentCameraLogic.
- UI split into
- New styling parameters:
showDetectionStatusTextinDocumentCameraFrame: Toggle live detection guidance text.showInstructionTextinDocumentCameraInstructionStyle: Toggle top instruction text.topPositionandrightPositioninDocumentCameraSideIndicatorStyle: Precise control over side indicator placement.
- Enhanced Internal Services:
DocumentDetectionServiceOptimization:- Added Letterbox Correction: Accounts for camera sensor aspect ratio vs display area to ensure precise frame alignment.
- Added Best-Candidate Selection: Intelligently picks the best document candidate based on aspect ratio and area.
- Added Live Guidance Engine: Generates real-time user hints ("Move closer", "Move right", etc.) via
detectionStatusNotifier. - Added Screen-Space Mapping: Automatically maps detection coordinates to screen pixels for overlay rendering, including mirroring support for front cameras.
ImageConverterServiceRobustness:- Hardened conversion paths for
BGRA8888(iOS) andNV21/YUV420(Android). - Added Stride (BytesPerRow) Handling to prevent image skewing/distortion on various hardware.
- Hardened conversion paths for
changed:
DocumentCameraFramewidget is now more efficient and easier to customize.- Refactored internal components for a cleaner codebase.
2.1.0 2.1.1 #
added:
- On-device OCR (text extraction): Optional text recognition via
enableExtractText. enableExtractTextparameter: Whentrue, runs OCR after capture and setsDocumentCaptureData.frontOcrTextandbackOcrTextbefore calling the save callback (no API key or internet required).OcrServiceclass: Reusable on-device OCR using Google ML Kit (Latin script; English and other Latin-based languages). Exported from the package for custom use.DocumentCaptureData.frontOcrTextandDocumentCaptureData.backOcrText: Optional extracted text whenenableExtractTextis true.- Dependency:
google_mlkit_text_recognitionfor OCR.
changed:
onDocumentSaved: New preferred callback name (replacesonBothSidesSaved). Fits both one-sided documents (e.g. passport) and two-sided (e.g. ID). Callback receivesDocumentCaptureDatawith image paths and, whenenableExtractTextis true,frontOcrTextandbackOcrText.onBothSidesSavedis deprecated; useonDocumentSaved. The deprecated callback still works for backward compatibility.DocumentCaptureDatamodel: Now holds optionalfrontOcrTextandbackOcrText; doc comment updated for one-sided vs two-sided use.
notes:
- OCR supports Latin script only (English, etc.). Arabic is not supported by ML Kit's on-device model.
- Android:
minSdk21+ required. iOS: platform 15.5+ and armv7 exclusion recommended for ML Kit.
2.0.1 2.0.4 #
- Update Readme.md
- Update metadata
2.0.0 #
added:
- Modular styling system with dedicated style classes:
DocumentCameraAnimationStyleDocumentCameraFrameStyleDocumentCameraButtonStyleDocumentCameraTitleStyleDocumentCameraSideIndicatorStyleDocumentCameraProgressStyleDocumentCameraInstructionStyle
- Auto-capture functionality via
enableAutoCaptureparameter. - Error handling with
onCameraErrorcallback. - Enhanced animation using
FrameCaptureAnimation. - Performance boost using
ValueListenableBuilderwithchild. - Complete Dart documentation for all style properties.
changed:
- BREAKING: Replaced individual style params with grouped
styleobjects. - BREAKING: Constructor now uses style classes (
buttonStyle,animationStyle, etc.). - Optimized animation rendering and reduced rebuilds.
- Refactored code for better structure and performance.
migration_guide: before: |
DocumentCameraFrame(
captureButtonStyle: buttonStyle,
captureButtonAlignment: Alignment.center,
captureButtonPadding: EdgeInsets.all(16),
capturingAnimationDuration: Duration(seconds: 1),
)
after: |
DocumentCameraFrame(
buttonStyle: DocumentCameraButtonStyle(
captureButtonStyle: buttonStyle,
captureButtonAlignment: Alignment.center,
captureButtonPadding: EdgeInsets.all(16),
),
animationStyle: DocumentCameraAnimationStyle(
capturingAnimationDuration: Duration(seconds: 1),
),
)
1.0.9 1.0.4 #
- Update
examples.gif - Update Readme.md
- Update metadata
1.0.3 #
- Update metadata
1.0.2 #
- Update metadata
1.0.0 #
added:
- Two-sided document capture: front and back.
- Callbacks:
onFrontCaptured,onBackCaptured,onBothSidesSaved. - Custom titles and instructions per side.
- Navigation controls and side indicator UI.
- Animated progress bar and frame flip transitions.
- Camera switching via button.
changed:
- BREAKING: Replaced
onSavedwithonBothSidesSaved. - Refactored to support two-sided logic and flow.
- Enhanced transitions and layout handling.
fixed:
- Better capture reset flow.
- Improved multi-side state handling.
- Camera-related error recovery.
0.1.6 #
- Update metadata.
0.1.5 #
features:
- Added camera switch icon. fixes:
retakeButtonTextandsaveButtonTextnow display correctly.- Custom camera selection (not hardcoded to ID 0).
0.1.4 #
- Update Readme.md.
0.1.3 #
- Update metadata.
0.1.2 #
- Added
showCloseButtonflag. - Frame animation duration reduced to
400ms.
0.1.0 #
- Redesigned
DocumentCameraFrameUI. - Added:
captureOuterCircleRadiuscaptureInnerCircleRadius
- Smooth container open animation (bottom to top).
- Documentation updated accordingly.
0.0.9 #
- Add
example.gif - Update Readme.md.
0.0.8 #
- Add
example.mp4 - Update Readme.md.
0.0.7 to 0.0.2 #
- README and metadata updates.
0.0.3 #
- Fixed deprecated usage in
DocumentCameraFramePainter:- Changed
Colors.black.withOpacity(0.5)toColors.black.withAlpha(127).
- Changed
0.0.1 #
- Initial release.