ScannerView constructor

const ScannerView({
  1. Key? key,
  2. CameraLensFacing? lensFacing,
  3. Color? flashOnColor,
  4. Color? flashOffColor,
  5. double topRatio = 0.3,
  6. double leftRatio = 0.1,
  7. double widthRatio = 0.8,
  8. double heightRatio = 0.4,
  9. bool bestFit = true,
  10. double? hornStrokeWidth,
  11. double? scannerStrokeWidth,
  12. bool scannerBox = true,
  13. ValueChanged<String>? scanResult,
  14. Widget? child,
  15. String? flashText,
  16. CameraResolution? resolution,
  17. Color? borderColor,
  18. Color? scannerColor,
})

Implementation

const ScannerView({
  Key? key,
  CameraLensFacing? lensFacing,
  Color? flashOnColor,
  Color? flashOffColor,
  this.topRatio = 0.3,
  this.leftRatio = 0.1,
  this.widthRatio = 0.8,
  this.heightRatio = 0.4,
  this.bestFit = true,
  this.hornStrokeWidth,
  this.scannerStrokeWidth,
  this.scannerBox = true,
  this.scanResult,
  this.child,
  this.flashText,
  this.resolution,
  this.borderColor,
  this.scannerColor,
})  : lensFacing = lensFacing ?? CameraLensFacing.back,
      flashOnColor = flashOnColor ?? Colors.white,
      flashOffColor = flashOffColor ?? Colors.black26,
      assert(leftRatio * 2 + widthRatio == 1),
      assert(topRatio * 2 + heightRatio == 1),
      super(key: key);