copyWith method

ScanResult copyWith({
  1. ScanMode? mode,
  2. String? rawValue,
  3. Map<String, String>? fields,
  4. bool? isValid,
  5. double? confidence,
  6. DateTime? timestamp,
  7. String? imagePath,
  8. Uint8List? rawBytes,
  9. String? format,
  10. Rect? roi,
  11. List<String>? enhancementsApplied,
  12. bool? isDuplicate,
  13. List<Offset>? corners,
  14. Rect? boundingBox,
  15. Size? imageSize,
  16. Duration? scanDuration,
  17. Map<String, dynamic>? metadata,
  18. List<ScanResult>? multiResults,
})

Creates a copy of ScanResult with updated fields.

Implementation

ScanResult 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,
}) {
  return ScanResult(
    mode: mode ?? this.mode,
    rawValue: rawValue ?? this.rawValue,
    fields: fields ?? this.fields,
    isValid: isValid ?? this.isValid,
    confidence: confidence ?? this.confidence,
    timestamp: timestamp ?? this.timestamp,
    imagePath: imagePath ?? this.imagePath,
    rawBytes: rawBytes ?? this.rawBytes,
    format: format ?? this.format,
    roi: roi ?? this.roi,
    enhancementsApplied: enhancementsApplied ?? this.enhancementsApplied,
    isDuplicate: isDuplicate ?? this.isDuplicate,
    corners: corners ?? this.corners,
    boundingBox: boundingBox ?? this.boundingBox,
    imageSize: imageSize ?? this.imageSize,
    scanDuration: scanDuration ?? this.scanDuration,
    metadata: metadata ?? this.metadata,
    multiResults: multiResults ?? this.multiResults,
  );
}