ScanResult class

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

Constructors

ScanResult({required ScanMode mode, required String rawValue, required Map<String, String> fields, bool isValid = true, double confidence = 1.0, DateTime? timestamp, String? imagePath, Uint8List? rawBytes, String? format, Rect? roi, List<String>? enhancementsApplied, bool isDuplicate = false, List<Offset>? corners, Rect? boundingBox, Size? imageSize, Duration? scanDuration, Map<String, dynamic>? metadata, List<ScanResult>? multiResults})
Creates a new ScanResult instance.
ScanResult.error(ScanMode mode, String errorMessage)
Creates a failed or error ScanResult instance.
factory

Properties

boundingBox Rect?
Detected bounding box rectangle in frame pixel coordinates.
final
confidence double
Detection confidence score ranging from 0.0 to 1.0.
final
corners List<Offset>?
Detected barcode or document corner points in frame pixel coordinates.
final
enhancementsApplied List<String>
List of image enhancement filters applied during isolate preprocessing.
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
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
timestamp DateTime
Timestamp when the scan occurred.
final

Methods

copyWith({ScanMode? mode, String? rawValue, Map<String, String>? fields, bool? isValid, double? confidence, DateTime? timestamp, String? imagePath, Uint8List? rawBytes, String? format, Rect? roi, List<String>? enhancementsApplied, bool? isDuplicate, List<Offset>? corners, Rect? boundingBox, Size? imageSize, Duration? scanDuration, Map<String, dynamic>? metadata, List<ScanResult>? multiResults}) 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