MobileScannerController constructor

MobileScannerController({
  1. bool autoStart = true,
  2. Size? cameraResolution,
  3. CameraLensType lensType = CameraLensType.any,
  4. DetectionSpeed detectionSpeed = DetectionSpeed.normal,
  5. int detectionTimeoutMs = 250,
  6. CameraFacing facing = CameraFacing.back,
  7. List<BarcodeFormat> formats = const <BarcodeFormat>[],
  8. bool returnImage = false,
  9. bool torchEnabled = false,
  10. bool invertImage = false,
  11. bool autoZoom = false,
  12. double? initialZoom,
})

Construct a new MobileScannerController instance.

Implementation

MobileScannerController({
  this.autoStart = true,
  this.cameraResolution,
  this.lensType = CameraLensType.any,
  this.detectionSpeed = DetectionSpeed.normal,
  int detectionTimeoutMs = 250,
  this.facing = CameraFacing.back,
  this.formats = const <BarcodeFormat>[],
  this.returnImage = false,
  this.torchEnabled = false,
  this.invertImage = false,
  this.autoZoom = false,
  this.initialZoom,
}) : detectionTimeoutMs =
         detectionSpeed == DetectionSpeed.normal ? detectionTimeoutMs : 0,
     assert(
       detectionTimeoutMs >= 0,
       'The detection timeout must be greater than or equal to 0.',
     ),
     assert(
       facing != CameraFacing.unknown,
       'CameraFacing.unknown is not a valid camera direction.',
     ),
     super(const MobileScannerState.uninitialized());