ScanResult class

Represents the extracted structured data resulting from a camera or image scan.

Constructors

ScanResult({required ScanMode mode, required String rawValue, Map<String, String>? fields, bool isValid = true, double confidence = 1.0, DateTime? timestamp, String? imagePath, Uint8List? rawBytes, String? format, String? documentCategory, Rect? roi, List<String>? enhancementsApplied, bool isDuplicate = false, List<Offset>? corners, Rect? boundingBox, Size? imageSize, Duration? scanDuration, Map<String, dynamic>? metadata, List<ScanResult>? multiResults, DocumentQualityScore? qualityScore, double? consensusConfidence, Map<String, bool>? verifications, Map<String, dynamic>? preprocessingInfo, BankChequeInfo? bankChequeInfo, List<BarcodeResult>? detectedBarcodes, String? sessionId, String? exportFormat, String? encryptionStatus, bool watermarkApplied = false, OcrTextResult? ocrTextResult})
Creates a new ScanResult instance.
ScanResult.error(ScanMode mode, String errorMessage)
Creates a failed or error ScanResult instance.
factory
ScanResult.fromJson(Map<String, dynamic> json)
Deserializes a ScanResult from a JSON map.
factory

Properties

bankChequeInfo BankChequeInfo?
Parsed details from a Bank Cheque MICR codeline if mode is ScanMode.cheque.
final
barcodes List<BarcodeResult>
Convenience getter returning list of BarcodeResult detected in frame.
no setter
boundingBox Rect?
Detected bounding box rectangle in frame pixel coordinates.
final
confidence double
Detection confidence score ranging from 0.0 to 1.0.
final
consensusConfidence double?
Confidence score achieved via temporal multi-frame consensus voting (up to 0.99 = 99%).
final
corners List<Offset>?
Detected barcode or document corner points in frame pixel coordinates.
final
detectedBarcodes List<BarcodeResult>?
Explicit list of individual detected barcodes in multi-barcode scanning mode.
final
documentCategory String?
Classified document category string (e.g. invoice, receipt, passport, aadhaar, pan, vin).
final
encryptionStatus String?
Encryption status indicator for encrypted storage tracking.
final
enhancementsApplied List<String>
List of image enhancement filters applied during isolate preprocessing.
final
exportFormat String?
Export format used (PDF, JPG, PNG) for export metadata tracking.
final
fields Map<String, String>
Map of key-value parsed attributes extracted from the document or code.
final
format String?
Detected barcode format or document type specification.
final
hashCode int
The hash code for this object.
no setterinherited
imagePath String?
Optional file path to captured camera frame image.
final
imageSize Size?
Input frame or image resolution size.
final
isDuplicate bool
Whether this result was identified as a duplicate during session caching.
final
isValid bool
Flag indicating whether validation or checksum verification passed.
final
metadata Map<String, dynamic>
Additional raw metadata key-values.
final
mode ScanMode
The scanning mode used during extraction.
final
multiResults List<ScanResult>?
List of individual scan results detected in a multi-code pass.
final
ocrTextResult OcrTextResult?
Full structured OCR text result (blocks, lines, elements).
final
preprocessingInfo Map<String, dynamic>
Processing algorithms and enhancements metadata applied to the input image.
final
qualityScore DocumentQualityScore?
Calculated document quality score metrics (blur, contrast, brightness).
final
rawBytes Uint8List?
Optional raw byte buffer of the scanned image frame.
final
rawValue String
The original unparsed raw text payload from the OCR or Barcode detector.
final
roi Rect?
Region of Interest (ROI) sub-rectangle cutout in frame pixel coordinates.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scanDuration Duration?
Total execution duration elapsed during frame detection and parsing.
final
sessionId String?
Session identifier for multi-scan session tracking.
final
timestamp DateTime
Timestamp when the scan occurred.
final
verifications Map<String, bool>
Detailed checklist of verification tests performed and their pass/fail statuses.
final
watermarkApplied bool
Whether a watermark has been applied to this scan's output.
final

Methods

copyWith({ScanMode? mode, String? rawValue, Map<String, String>? fields, bool? isValid, double? confidence, DateTime? timestamp, String? imagePath, Uint8List? rawBytes, String? format, String? documentCategory, Rect? roi, List<String>? enhancementsApplied, bool? isDuplicate, List<Offset>? corners, Rect? boundingBox, Size? imageSize, Duration? scanDuration, Map<String, dynamic>? metadata, List<ScanResult>? multiResults, DocumentQualityScore? qualityScore, double? consensusConfidence, Map<String, bool>? verifications, Map<String, dynamic>? preprocessingInfo, BankChequeInfo? bankChequeInfo, List<BarcodeResult>? detectedBarcodes, String? sessionId, String? exportFormat, String? encryptionStatus, bool? watermarkApplied, OcrTextResult? ocrTextResult}) ScanResult
Creates a copy of ScanResult with updated fields.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes the scan result to a JSON-compatible map.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited