ReaderWidget constructor

const ReaderWidget({
  1. Key? key,
  2. dynamic onScan(
    1. Code
    )?,
  3. dynamic onScanFailure(
    1. Code
    )?,
  4. dynamic onMultiScan(
    1. Codes
    )?,
  5. dynamic onMultiScanFailure(
    1. Codes
    )?,
  6. dynamic onControllerCreated(
    1. CameraController? controller,
    2. Exception? error
    )?,
  7. dynamic onMultiScanModeChanged(
    1. bool
    )?,
  8. bool isMultiScan = false,
  9. AlignmentGeometry multiScanModeAlignment = Alignment.bottomRight,
  10. EdgeInsetsGeometry multiScanModePadding = const EdgeInsets.all(10),
  11. int codeFormat = Format.any,
  12. bool tryHarder = false,
  13. bool tryInverted = false,
  14. bool tryRotate = true,
  15. bool showScannerOverlay = true,
  16. ScannerOverlay? scannerOverlay,
  17. AlignmentGeometry actionButtonsAlignment = const Alignment(0, -0.6),
  18. EdgeInsetsGeometry actionButtonsPadding = const EdgeInsets.all(10),
  19. bool showFlashlight = true,
  20. bool showToggleCamera = false,
  21. bool showGallery = false,
  22. bool allowPinchZoom = true,
  23. Duration scanDelay = const Duration(milliseconds: 1000),
  24. Duration scanDelaySuccess = const Duration(milliseconds: 1000),
  25. double cropPercent = 0.5,
  26. ResolutionPreset resolution = ResolutionPreset.high,
  27. CameraLensDirection lensDirection = CameraLensDirection.back,
  28. Widget loading = const DecoratedBox(decoration: BoxDecoration(color: Colors.black)),
})

Implementation

const ReaderWidget({
  super.key,
  this.onScan,
  this.onScanFailure,
  this.onMultiScan,
  this.onMultiScanFailure,
  this.onControllerCreated,
  this.onMultiScanModeChanged,
  this.isMultiScan = false,
  this.multiScanModeAlignment = Alignment.bottomRight,
  this.multiScanModePadding = const EdgeInsets.all(10),
  this.codeFormat = Format.any,
  this.tryHarder = false,
  this.tryInverted = false,
  this.tryRotate = true,
  this.showScannerOverlay = true,
  this.scannerOverlay,
  this.actionButtonsAlignment = const Alignment(0, -0.6),
  this.actionButtonsPadding = const EdgeInsets.all(10),
  this.showFlashlight = true,
  this.showToggleCamera = false,
  this.showGallery = false,
  this.allowPinchZoom = true,
  this.scanDelay = const Duration(milliseconds: 1000),
  this.scanDelaySuccess = const Duration(milliseconds: 1000),
  this.cropPercent = 0.5, // 50% of the screen
  this.resolution = ResolutionPreset.high,
  this.lensDirection = CameraLensDirection.back,
  this.loading =
      const DecoratedBox(decoration: BoxDecoration(color: Colors.black)),
});