ScanOptions constructor
const
ScanOptions({
- List<
BarcodeFormat> formats = const [], - bool enableFlash = false,
- bool autoFocus = true,
- bool multiScan = false,
- int maxScans = 1,
- bool beepOnScan = true,
- bool vibrateOnScan = true,
- bool showOverlay = true,
- int overlayColor = 0xFF00FF00,
- bool restrictScanArea = false,
- double scanAreaRatio = 0.7,
- int timeoutSeconds = 0,
- bool returnImage = false,
- double imageQuality = 0.8,
- bool detectInverted = false,
- CameraResolution cameraResolution = CameraResolution.medium,
- 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',
);