ScannerOptions class
Dynamic Region of Interest (ROI) scanning window rectangle. Configuration options controlling camera detection rate, ROI bounds, duplicate caching, auto-zoom, image enhancement, isolate multi-threading, and enterprise scanning parameters.
Constructors
-
ScannerOptions({ScanStrategy scanStrategy = ScanStrategy.continuous, ScanWindow? scanWindow = ScanWindow.centerReticle, int frameThrottleMs = 50, int targetFrameRate = 20, bool enableAdaptiveFps = true, bool enableAdaptiveFrameSkipping = true, bool enablePauseOnStaticFrame = true, bool enableProgressiveResolution = true, Duration duplicateTimeout = const Duration(milliseconds: 2000), bool enableDuplicateFilter = true, bool enableDetectionCache = true, Duration detectionCacheTimeout = const Duration(milliseconds: 2000), int frameQueueCapacity = 3, bool enableIsolateProcessing = true, bool enableImageEnhancement = true, bool enableBlurDetection = true, bool enableAutoBrightnessCheck = true, bool autoTorchInLowLight = false, double lowLightThreshold = 0.25, bool enableAutoZoom = true, bool autoResetZoomAfterScan = true, double autoZoomThreshold = 0.15, bool continuousAutofocus = true, bool enableMultiCodeDetection = true, int maxMultiCodeCount = 10, bool enableScanHistory = true, int maxHistorySize = 50, int? maxBatchCount, double minConfidence = 0.70, Rect? rectScanArea, List<
String> ? allowedFormats, bool enableSound = true, bool enableVibration = true, double torchLevel = 1.0, bool isFocusLocked = false, bool enableAutoCapture = true, double autoCaptureQualityThreshold = 0.85, int autoCaptureSteadyFrames = 3, bool enableMultiFrameConsensus = true, int consensusFrameCount = 3, double consensusAccuracyThreshold = 0.98, bool enableAdaptiveRoi = true, bool enableEncryptedStorage = false, String? encryptionPassword, bool enableCloudSync = false, String? cloudSyncEndpoint, bool enableWatermark = false, String? watermarkText, double imageCompressionQuality = 0.85, String exportFormat = 'pdf', int isolatePoolSize = 2, int frameQueueDepth = 3, bool enableMultiPassOcr = true, int multiPassOcrCount = 3, bool enableBarcodeFallbackDecoder = true, int barcodeFallbackTimeoutMs = 200, bool enableGlareDetection = true, double glareThreshold = 0.05, bool enableCoverageCheck = true, double coverageMinRatio = 0.15, bool enableAdaptivePreprocessing = true, bool enableTenengradBlur = true}) -
Constructs a ScannerOptions instance.
const
-
ScannerOptions.custom({ScanStrategy scanStrategy = ScanStrategy.continuous, ScanWindow? scanWindow = ScanWindow.centerReticle, Rect? scanArea, bool? allowDuplicates, Duration? duplicateDelay, int frameThrottleMs = 50, int targetFrameRate = 20, bool enableAdaptiveFps = true, bool enableAdaptiveFrameSkipping = true, bool enablePauseOnStaticFrame = true, bool enableProgressiveResolution = true, Duration duplicateTimeout = const Duration(milliseconds: 2000), bool enableDuplicateFilter = true, bool enableDetectionCache = true, Duration detectionCacheTimeout = const Duration(milliseconds: 2000), int frameQueueCapacity = 3, bool enableIsolateProcessing = true, bool enableImageEnhancement = true, bool enableBlurDetection = true, bool enableAutoBrightnessCheck = true, bool autoTorchInLowLight = false, double lowLightThreshold = 0.25, bool enableAutoZoom = true, bool autoResetZoomAfterScan = true, double autoZoomThreshold = 0.15, bool continuousAutofocus = true, bool enableMultiCodeDetection = true, int maxMultiCodeCount = 10, bool enableScanHistory = true, int maxHistorySize = 50, int? maxBatchCount, double minConfidence = 0.70, List<
String> ? allowedFormats, bool enableSound = true, bool enableVibration = true, double torchLevel = 1.0, bool isFocusLocked = false, bool enableAutoCapture = true, double autoCaptureQualityThreshold = 0.85, int autoCaptureSteadyFrames = 3, bool enableMultiFrameConsensus = true, int consensusFrameCount = 3, double consensusAccuracyThreshold = 0.98, bool enableAdaptiveRoi = true}) -
Factory constructor supporting explicit
scanArea,allowDuplicates, andduplicateDelayparameters.factory
Properties
- allowDuplicates → bool
-
Alias getter for duplicate filter setting (inverted).
no setter
-
allowedFormats
→ List<
String> ? -
Optional whitelist of allowed barcode format symbologies (e.g.
'QR_CODE', 'EAN_13', 'PDF417').final - autoCaptureQualityThreshold → double
-
Quality score threshold (0.0 to 1.0) required to trigger auto capture.
final
- autoCaptureSteadyFrames → int
-
Number of consecutive stable high-quality frames required for auto capture.
final
- autoResetZoomAfterScan → bool
-
Automatically reset digital zoom back to 1.0x after successful scan emission.
final
- autoTorchInLowLight → bool
-
Automatically switch flashlight on when ambient light drops below threshold.
final
- autoZoomThreshold → double
-
Code-to-viewport area ratio below which auto-zoom triggers (e.g., 0.15 = 15%).
final
- barcodeFallbackTimeoutMs → int
-
Timeout in ms before barcode fallback decoder gives up.
final
- cloudSyncEndpoint → String?
-
REST API endpoint URL for cloud sync (required if enableCloudSync is true).
final
- consensusAccuracyThreshold → double
-
Target accuracy confidence threshold (e.g. 0.98 = 98%) required for consensus emission.
final
- consensusFrameCount → int
-
Number of sequential frames accumulated for temporal consensus voting.
final
- continuousAutofocus → bool
-
Whether continuous autofocus mode is enabled.
final
- coverageMinRatio → double
-
Minimum quad area / frame area ratio for valid coverage.
final
- detectionCacheTimeout → Duration
-
Timeout duration for detection cache entries.
final
- duplicateDelay → Duration
-
Alias getter for duplicate timeout delay.
no setter
- duplicateTimeout → Duration
-
Timeout duration during which identical scanned payloads are ignored.
final
- enableAdaptiveFps → bool
-
Dynamically adjust frame processing rate based on detection state (Searching: 30 FPS, Detected: 15 FPS, Idle: 10 FPS).
final
- enableAdaptiveFrameSkipping → bool
-
Dynamically adjust frame skipping based on device processing load & latency.
final
- enableAdaptivePreprocessing → bool
-
Enable adaptive preprocessing (auto-selects best pipeline per frame).
final
- enableAdaptiveRoi → bool
-
Dynamic Region of Interest (ROI) adjustment based on detected target bounding box.
final
- enableAutoBrightnessCheck → bool
-
Analyze frame luminosity and emit low-light alert if below threshold.
final
- enableAutoCapture → bool
-
Whether enterprise document auto capture is enabled when quality threshold is met.
final
- enableAutoZoom → bool
-
Automatically trigger digital camera zoom when small barcodes are detected far away.
final
- enableBarcodeFallbackDecoder → bool
-
Enable standalone barcode fallback decoder (ZXing-style) when ML Kit fails.
final
- enableBlurDetection → bool
-
Evaluate frame sharpness score to trigger auto-refocus if blurred.
final
- enableCloudSync → bool
-
Whether to enable cloud synchronization of scan results.
final
- enableCoverageCheck → bool
-
Enable document coverage ratio checking for auto-capture.
final
- enableDetectionCache → bool
-
Enable in-memory LRU detection cache to bypass duplicate frame decoding.
final
- enableDuplicateFilter → bool
-
Whether duplicate filtering is enabled.
final
- enableEncryptedStorage → bool
-
Whether to encrypt scan results before local storage.
final
- enableGlareDetection → bool
-
Enable specular glare/reflection detection.
final
- enableImageEnhancement → bool
-
Apply brightness normalization, contrast enhancement, sharpening, and denoising in isolate.
final
- enableIsolateProcessing → bool
-
Offload YUV/NV21 image conversions, ROI cropping, and image enhancement to background isolate.
final
- enableMultiCodeDetection → bool
-
Allow detecting multiple barcodes/QR codes in a single image pass.
final
- enableMultiFrameConsensus → bool
-
Whether multi-frame temporal consensus voting is enabled to achieve 98-99% OCR accuracy.
final
- enableMultiPassOcr → bool
-
Enable multi-pass OCR with different preprocessing per pass.
final
- enablePauseOnStaticFrame → bool
-
Automatically skip vision engine analysis when scene remains static.
final
- enableProgressiveResolution → bool
-
Enable progressive camera resolution escalation (640x480 -> 1280x720 -> 1920x1080).
final
- enableScanHistory → bool
-
Retain in-memory log of recent scan results.
final
- enableSound → bool
-
Whether audio beep feedback is emitted on scan success/failure.
final
- enableTenengradBlur → bool
-
Enable Tenengrad blur detection (more robust than Laplacian).
final
- enableVibration → bool
-
Whether haptic vibration feedback is triggered on scan success/failure.
final
- enableWatermark → bool
-
Whether to apply watermark to scanned document exports.
final
- encryptionPassword → String?
-
Password for encrypted scan storage (required if enableEncryptedStorage is true).
final
- exportFormat → String
-
Default export format for scan results (pdf, jpg, png).
final
- frameQueueCapacity → int
-
Maximum frame buffer queue size to prevent memory backlog.
final
- frameQueueDepth → int
-
Maximum pending frames in the processing queue before dropping.
final
- frameThrottleMs → int
-
Minimum delay in milliseconds between consecutive frame analysis passes.
(e.g. 50ms = max 20 detections/sec for optimal CPU & battery usage).
final
- glareThreshold → double
-
Maximum fraction of hot pixels before glare warning (0.0-1.0).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- imageCompressionQuality → double
-
Image compression quality factor (0.0 = max compression, 1.0 = no compression).
final
- isFocusLocked → bool
-
Whether camera focus is currently locked to prevent hunting.
final
- isolatePoolSize → int
-
Number of persistent isolates in the processing pool (1-4).
final
- lowLightThreshold → double
-
Normalized ambient luminosity threshold (0.0 to 1.0) for low-light detection.
final
- maxBatchCount → int?
-
Optional maximum items limit in batch inventory mode.
final
- maxHistorySize → int
-
Maximum scan history capacity.
final
- maxMultiCodeCount → int
-
Maximum number of codes to return in a multi-code pass.
final
- minConfidence → double
-
Minimum confidence required to accept a scan result (0.0 to 1.0).
final
- multiPassOcrCount → int
-
Number of OCR passes to run per frame (2-4).
final
- rectScanArea → Rect?
-
Optional explicit pixel/coordinate scan rectangle restriction area.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scanArea → Rect?
-
Explicit pixel area ROI scan bounds (alias for rectScanArea).
no setter
- scanStrategy → ScanStrategy
-
Active result handling strategy (single, continuous, batch).
final
- scanWindow → ScanWindow?
-
Restrict image analysis strictly to this sub-region cutout (ROI).
final
- targetFrameRate → int
-
Target frame processing rate in frames per second (e.g. 15-30 FPS).
final
- torchLevel → double
-
Flashlight torch intensity brightness level (0.0 to 1.0).
final
- watermarkText → String?
-
Watermark text to apply on exported documents.
final
Methods
-
copyWith(
{ScanStrategy? scanStrategy, ScanWindow? scanWindow, int? frameThrottleMs, int? targetFrameRate, bool? enableAdaptiveFps, bool? enableAdaptiveFrameSkipping, bool? enablePauseOnStaticFrame, bool? enableProgressiveResolution, Duration? duplicateTimeout, bool? enableDuplicateFilter, bool? enableDetectionCache, Duration? detectionCacheTimeout, int? frameQueueCapacity, bool? enableIsolateProcessing, bool? enableImageEnhancement, bool? enableBlurDetection, bool? enableAutoBrightnessCheck, bool? autoTorchInLowLight, double? lowLightThreshold, bool? enableAutoZoom, bool? autoResetZoomAfterScan, double? autoZoomThreshold, bool? continuousAutofocus, bool? enableMultiCodeDetection, int? maxMultiCodeCount, bool? enableScanHistory, int? maxHistorySize, int? maxBatchCount, double? minConfidence, Rect? rectScanArea, List< String> ? allowedFormats, bool? enableSound, bool? enableVibration, double? torchLevel, bool? isFocusLocked, bool? enableAutoCapture, double? autoCaptureQualityThreshold, int? autoCaptureSteadyFrames, bool? enableMultiFrameConsensus, int? consensusFrameCount, double? consensusAccuracyThreshold, bool? enableAdaptiveRoi, bool? enableEncryptedStorage, String? encryptionPassword, bool? enableCloudSync, String? cloudSyncEndpoint, bool? enableWatermark, String? watermarkText, double? imageCompressionQuality, String? exportFormat}) → ScannerOptions -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- batterySaver → const ScannerOptions
- Battery-saver preset for background/inventory batch scanning.
- highPerformance → const ScannerOptions
- High-performance preset optimized for speed and low CPU consumption.