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. String? documentCategory,
  11. Rect? roi,
  12. List<String>? enhancementsApplied,
  13. bool? isDuplicate,
  14. List<Offset>? corners,
  15. Rect? boundingBox,
  16. Size? imageSize,
  17. Duration? scanDuration,
  18. Map<String, dynamic>? metadata,
  19. List<ScanResult>? multiResults,
  20. DocumentQualityScore? qualityScore,
  21. double? consensusConfidence,
  22. Map<String, bool>? verifications,
  23. Map<String, dynamic>? preprocessingInfo,
  24. BankChequeInfo? bankChequeInfo,
  25. List<BarcodeResult>? detectedBarcodes,
  26. String? sessionId,
  27. String? exportFormat,
  28. String? encryptionStatus,
  29. bool? watermarkApplied,
  30. OcrTextResult? ocrTextResult,
  31. List<String>? processingPipeline,
  32. List<ScanResult>? alternativeResults,
  33. String? detectorName,
  34. List<String>? postProcessingCorrections,
})

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,
  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,
  List<String>? processingPipeline,
  List<ScanResult>? alternativeResults,
  String? detectorName,
  List<String>? postProcessingCorrections,
}) {
  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,
    documentCategory: documentCategory ?? this.documentCategory,
    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,
    qualityScore: qualityScore ?? this.qualityScore,
    consensusConfidence: consensusConfidence ?? this.consensusConfidence,
    verifications: verifications ?? this.verifications,
    preprocessingInfo: preprocessingInfo ?? this.preprocessingInfo,
    bankChequeInfo: bankChequeInfo ?? this.bankChequeInfo,
    detectedBarcodes: detectedBarcodes ?? this.detectedBarcodes,
    sessionId: sessionId ?? this.sessionId,
    exportFormat: exportFormat ?? this.exportFormat,
    encryptionStatus: encryptionStatus ?? this.encryptionStatus,
    watermarkApplied: watermarkApplied ?? this.watermarkApplied,
    ocrTextResult: ocrTextResult ?? this.ocrTextResult,
    processingPipeline: processingPipeline ?? this.processingPipeline,
    alternativeResults: alternativeResults ?? this.alternativeResults,
    detectorName: detectorName ?? this.detectorName,
    postProcessingCorrections:
        postProcessingCorrections ?? this.postProcessingCorrections,
  );
}