copyWith method

ScanOptions copyWith({
  1. List<BarcodeFormat>? formats,
  2. bool? enableFlash,
  3. bool? autoFocus,
  4. bool? multiScan,
  5. int? maxScans,
  6. bool? beepOnScan,
  7. bool? vibrateOnScan,
  8. bool? showOverlay,
  9. int? overlayColor,
  10. bool? restrictScanArea,
  11. double? scanAreaRatio,
  12. int? timeoutSeconds,
  13. bool? returnImage,
  14. double? imageQuality,
  15. bool? detectInverted,
  16. CameraResolution? cameraResolution,
  17. CameraFacing? cameraFacing,
})

Creates a copy of this options with the given fields replaced

Implementation

ScanOptions copyWith({
  List<BarcodeFormat>? formats,
  bool? enableFlash,
  bool? autoFocus,
  bool? multiScan,
  int? maxScans,
  bool? beepOnScan,
  bool? vibrateOnScan,
  bool? showOverlay,
  int? overlayColor,
  bool? restrictScanArea,
  double? scanAreaRatio,
  int? timeoutSeconds,
  bool? returnImage,
  double? imageQuality,
  bool? detectInverted,
  CameraResolution? cameraResolution,
  CameraFacing? cameraFacing,
}) {
  return ScanOptions(
    formats: formats ?? this.formats,
    enableFlash: enableFlash ?? this.enableFlash,
    autoFocus: autoFocus ?? this.autoFocus,
    multiScan: multiScan ?? this.multiScan,
    maxScans: maxScans ?? this.maxScans,
    beepOnScan: beepOnScan ?? this.beepOnScan,
    vibrateOnScan: vibrateOnScan ?? this.vibrateOnScan,
    showOverlay: showOverlay ?? this.showOverlay,
    overlayColor: overlayColor ?? this.overlayColor,
    restrictScanArea: restrictScanArea ?? this.restrictScanArea,
    scanAreaRatio: scanAreaRatio ?? this.scanAreaRatio,
    timeoutSeconds: timeoutSeconds ?? this.timeoutSeconds,
    returnImage: returnImage ?? this.returnImage,
    imageQuality: imageQuality ?? this.imageQuality,
    detectInverted: detectInverted ?? this.detectInverted,
    cameraResolution: cameraResolution ?? this.cameraResolution,
    cameraFacing: cameraFacing ?? this.cameraFacing,
  );
}