ScanOptions constructor

const ScanOptions({
  1. List<BarcodeFormat> formats = const [],
  2. bool enableFlash = false,
  3. bool autoFocus = true,
  4. bool multiScan = false,
  5. int maxScans = 1,
  6. bool beepOnScan = true,
  7. bool vibrateOnScan = true,
  8. bool showOverlay = true,
  9. int overlayColor = 0xFF00FF00,
  10. bool restrictScanArea = false,
  11. double scanAreaRatio = 0.7,
  12. int timeoutSeconds = 0,
  13. bool returnImage = false,
  14. double imageQuality = 0.8,
  15. bool detectInverted = false,
  16. CameraResolution cameraResolution = CameraResolution.medium,
  17. CameraFacing cameraFacing = CameraFacing.back,
})

Implementation

const ScanOptions({
  this.formats = const [],
  this.enableFlash = false,
  this.autoFocus = true,
  this.multiScan = false,
  this.maxScans = 1,
  this.beepOnScan = true,
  this.vibrateOnScan = true,
  this.showOverlay = true,
  this.overlayColor = 0xFF00FF00,
  this.restrictScanArea = false,
  this.scanAreaRatio = 0.7,
  this.timeoutSeconds = 0,
  this.returnImage = false,
  this.imageQuality = 0.8,
  this.detectInverted = false,
  this.cameraResolution = CameraResolution.medium,
  this.cameraFacing = CameraFacing.back,
}) : assert(maxScans >= 0, 'Max scans must be non-negative'),
     assert(
       scanAreaRatio > 0.0 && scanAreaRatio <= 1.0,
       'Scan area ratio must be between 0.0 and 1.0',
     ),
     assert(timeoutSeconds >= 0, 'Timeout must be non-negative'),
     assert(
       imageQuality >= 0.0 && imageQuality <= 1.0,
       'Image quality must be between 0.0 and 1.0',
     );