AiBarcodeScanner constructor
AiBarcodeScanner({
- Key? key,
- required void onScan(),
- String? validateText,
- bool? hasAppBar,
- Widget? customAppBarWidget,
- ValidateType? validateType,
- bool allowDuplicates = false,
- BoxFit fit = BoxFit.cover,
- MobileScannerController? controller,
- void onDetect()?,
- Color borderColor = Colors.white,
- double borderWidth = 10,
- Color overlayColor = const Color.fromRGBO(0, 0, 0, 80),
- double borderRadius = 10,
- double borderLength = 40,
- double cutOutSize = 300,
- double? cutOutWidth,
- double? cutOutHeight,
- double cutOutBottomOffset = 0,
- String hintText = 'Scan QR Code',
- EdgeInsetsGeometry hintMargin = const EdgeInsets.symmetric(horizontal: 50, vertical: 10),
- Color? hintBackgroundColor = Colors.white,
- TextStyle hintTextStyle = const TextStyle(fontWeight: FontWeight.bold),
- EdgeInsetsGeometry hintPadding = const EdgeInsets.all(0),
- bool showOverlay = true,
- bool showError = true,
- Color errorColor = Colors.red,
- String errorText = 'Invalid BarCode',
- bool showSuccess = true,
- Color successColor = Colors.green,
- String successText = 'BarCode Found',
- bool canPop = true,
- Widget errorBuilder()?,
- Widget placeholderBuilder()?,
- void onScannerStarted()?,
- Rect? scanWindow,
- bool? startDelay,
- Widget? hintWidget,
Implementation
AiBarcodeScanner({
Key? key,
required this.onScan,
this.validateText,
this.hasAppBar,
this.customAppBarWidget,
this.validateType,
this.allowDuplicates = false,
this.fit = BoxFit.cover,
this.controller,
this.onDetect,
this.borderColor = Colors.white,
this.borderWidth = 10,
this.overlayColor = const Color.fromRGBO(0, 0, 0, 80),
this.borderRadius = 10,
this.borderLength = 40,
this.cutOutSize = 300,
this.cutOutWidth,
this.cutOutHeight,
this.cutOutBottomOffset = 0,
this.hintText = 'Scan QR Code',
this.hintMargin = const EdgeInsets.symmetric(horizontal: 50, vertical: 10),
this.hintBackgroundColor = Colors.white,
this.hintTextStyle = const TextStyle(fontWeight: FontWeight.bold),
this.hintPadding = const EdgeInsets.all(0),
this.showOverlay = true,
this.showError = true,
this.errorColor = Colors.red,
this.errorText = 'Invalid BarCode',
this.showSuccess = true,
this.successColor = Colors.green,
this.successText = 'BarCode Found',
this.canPop = true,
this.errorBuilder,
this.placeholderBuilder,
this.onScannerStarted,
this.scanWindow,
this.startDelay,
this.hintWidget,
}) : assert(validateText == null || validateType != null),
assert(validateText != null || validateType == null),
super(key: key);