ReaderWidget constructor
const
ReaderWidget({
- Key? key,
- dynamic onScan()?,
- dynamic onScanFailure()?,
- dynamic onMultiScan()?,
- dynamic onMultiScanFailure()?,
- dynamic onControllerCreated(
- CameraController? controller,
- Exception? error
- dynamic onMultiScanModeChanged()?,
- bool isMultiScan = false,
- AlignmentGeometry multiScanModeAlignment = Alignment.bottomRight,
- EdgeInsetsGeometry multiScanModePadding = const EdgeInsets.all(10),
- int codeFormat = Format.any,
- bool tryHarder = false,
- bool tryInverted = false,
- bool tryRotate = true,
- bool showScannerOverlay = true,
- ScannerOverlay? scannerOverlay,
- AlignmentGeometry actionButtonsAlignment = const Alignment(0, -0.6),
- EdgeInsetsGeometry actionButtonsPadding = const EdgeInsets.all(10),
- bool showFlashlight = true,
- bool showToggleCamera = false,
- bool showGallery = false,
- bool allowPinchZoom = true,
- Duration scanDelay = const Duration(milliseconds: 1000),
- Duration scanDelaySuccess = const Duration(milliseconds: 1000),
- double cropPercent = 0.5,
- ResolutionPreset resolution = ResolutionPreset.high,
- CameraLensDirection lensDirection = CameraLensDirection.back,
- 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)),
});