MobileScannerController constructor

MobileScannerController({
  1. bool autoStart = true,
  2. Size? cameraResolution,
  3. DetectionSpeed detectionSpeed = DetectionSpeed.normal,
  4. int detectionTimeoutMs = 250,
  5. CameraFacing facing = CameraFacing.back,
  6. List<BarcodeFormat> formats = const <BarcodeFormat>[],
  7. bool returnImage = false,
  8. bool torchEnabled = false,
  9. bool useNewCameraSelector = false,
})

Construct a new MobileScannerController instance.

Implementation

MobileScannerController({
  this.autoStart = true,
  this.cameraResolution,
  this.detectionSpeed = DetectionSpeed.normal,
  int detectionTimeoutMs = 250,
  this.facing = CameraFacing.back,
  this.formats = const <BarcodeFormat>[],
  this.returnImage = false,
  this.torchEnabled = false,
  this.useNewCameraSelector = false,
})  : detectionTimeoutMs =
          detectionSpeed == DetectionSpeed.normal ? detectionTimeoutMs : 0,
      assert(
        detectionTimeoutMs >= 0,
        'The detection timeout must be greater than or equal to 0.',
      ),
      super(MobileScannerState.uninitialized(facing));