paper_scanner library
Backward-compatible library alias for the scanner API.
Prefer importing package:paper_document_scanner/paper_document_scanner.dart.
Classes
- DetectedQuad
-
The result of a detection request: a Quad plus a
0.0 .. 1.0confidence score reported by the native detector. - PageEditorScreen
- Full-screen page detail/edit view — the "full view" opened by tapping a page preview.
- PaperScanner
- One-line entry point for launching the scanner.
- PaperScannerController
- Drives the entire scan flow with a plain ChangeNotifier — no bloc/flutter_bloc dependency, deliberately, so this package never version-locks a consumer's state-management choice.
- PaperScannerLabels
- All user-facing strings, so consumers localize the scanner with their own translations. Defaults match the reference design.
- PaperScannerOptions
- Behavioral configuration for a scan session (separate from visual PaperScannerStyle).
- PaperScannerScreen
- The full-screen scanner UI.
- PaperScannerStyle
- The full visual theme for the scanner UI — the custom-UI payoff that OS system scanners cannot offer.
- PaperScanResult
- The result returned by a scan session.
- Quad
- Four normalized corner points describing a document outline.
- ScannedPage
- One page captured during a scan session.
- ScannedPageResult
- Per-page detail in a PaperScanResult.
- ScanPoint
- A normalized 2D point.
Enums
- ScanFilter
- Enhancement filters applied to a captured page.
- ScannerSkin
- Which native scanner look the UI should imitate.
- ScanStage
- The stages a scan session moves through.
Functions
Typedefs
- ActionButtonBuilder = Widget Function(BuildContext context, String label, VoidCallback? onPressed)
-
Builds a primary action button (e.g. "Keep") given a
labelandonPressed(null = disabled). - CameraBottomChromeBuilder = Widget Function(BuildContext context, PaperScannerController controller, PaperScannerStyle style, VoidCallback onCapture, VoidCallback onReview, VoidCallback onCycleFlash, VoidCallback onOpenFilters, VoidCallback onToggleAutoCapture, bool capturing, IconData flashIcon)
- Builds the camera bottom chrome. Return a full replacement for controls, thumbnail preview and shutter.
- CameraTopChromeBuilder = Widget Function(BuildContext context, PaperScannerController controller, PaperScannerStyle style, VoidCallback onCancel, VoidCallback onDone)
- Builds the camera top chrome. Return a full replacement for the close/status/done row.
- CaptureButtonBuilder = Widget Function(BuildContext context, VoidCallback onCapture, bool busy)
-
Builds the capture (shutter) button.
onCapturetakes the photo;busyis true while a capture/processing step is running. - CornerHandleBuilder = Widget Function(BuildContext context)
- Builds a single draggable crop corner handle.
- CropActionButtonBuilder = Widget Function(BuildContext context, String label, VoidCallback? onTap, bool primary, bool busy, PaperScannerStyle style)
- Builds one crop action button such as Retake or Keep.
- CropActionsBuilder = Widget Function(BuildContext context, PaperScannerController controller, PaperScannerStyle style, VoidCallback onRetake, VoidCallback onKeep)
- Builds the crop/review action row. Return a full replacement for Retake/Keep.
- PagePreviewBuilder = Widget Function(BuildContext context, ScannedPage page, int index, String label, PaperScannerStyle style, PaperScannerLabels labels, VoidCallback onClose, VoidCallback onDelete)
- Builds the full-screen committed-page preview opened from the review list.
-
PageReviewListBuilder
= Widget Function(BuildContext context, PaperScannerController controller, List<
ScannedPage> pages, PaperScannerStyle style, PaperScannerLabels labels, void onReorder(int oldIndex, int newIndex), void onPreview(int index), void onDelete(int index)) - Builds the page review list inside the bottom sheet.
- PageReviewSheetBuilder = Widget Function(BuildContext context, PaperScannerController controller, PaperScannerStyle style, PaperScannerLabels labels, VoidCallback onClose, void onPreview(int index), void onDelete(int index))
- Builds the committed-page review bottom sheet. Use this for a full replacement of the review title, list, spacing and actions.
- PageReviewTileBuilder = Widget Function(BuildContext context, ScannedPage page, int index, String label, PaperScannerStyle style, PaperScannerLabels labels, VoidCallback onPreview, VoidCallback onDelete, Widget dragHandle)
- Builds one committed-page row in the review list.
- PageThumbnailBuilder = Widget Function(BuildContext context, ScannedPage page, VoidCallback onTap, PaperScannerStyle style)
- Builds the committed-page preview thumbnail shown in the camera stage.
-
PdfAssembler
= Future<
String> Function(List<String> imagePaths) -
Assembles
imagePathsinto a single file and returns its path. - ScannerControlButtonBuilder = Widget Function(BuildContext context, IconData icon, String label, VoidCallback onTap, bool active, PaperScannerStyle style)
- Builds one camera control button (Flash, Filters, Shutter auto toggle).
- ScannerIconButtonBuilder = Widget Function(BuildContext context, IconData icon, VoidCallback onTap, Color background, Color foreground)
- Builds a round top icon button such as close or done.
- StatusPillBuilder = Widget Function(BuildContext context, String label, PaperScannerStyle style)
- Builds a status pill such as "Ready for next scan.".