AiBarcodeScanner constructor

AiBarcodeScanner({
  1. Key? key,
  2. required void onScan(
    1. String
    ),
  3. String? validateText,
  4. bool? hasAppBar,
  5. Widget? customAppBarWidget,
  6. ValidateType? validateType,
  7. bool allowDuplicates = false,
  8. BoxFit fit = BoxFit.cover,
  9. MobileScannerController? controller,
  10. void onDetect(
    1. BarcodeCapture
    )?,
  11. Color borderColor = Colors.white,
  12. double borderWidth = 10,
  13. Color overlayColor = const Color.fromRGBO(0, 0, 0, 80),
  14. double borderRadius = 10,
  15. double borderLength = 40,
  16. double cutOutSize = 300,
  17. double? cutOutWidth,
  18. double? cutOutHeight,
  19. double cutOutBottomOffset = 0,
  20. String hintText = 'Scan QR Code',
  21. EdgeInsetsGeometry hintMargin = const EdgeInsets.symmetric(horizontal: 50, vertical: 10),
  22. Color? hintBackgroundColor = Colors.white,
  23. TextStyle hintTextStyle = const TextStyle(fontWeight: FontWeight.bold),
  24. EdgeInsetsGeometry hintPadding = const EdgeInsets.all(0),
  25. bool showOverlay = true,
  26. bool showError = true,
  27. Color errorColor = Colors.red,
  28. String errorText = 'Invalid BarCode',
  29. bool showSuccess = true,
  30. Color successColor = Colors.green,
  31. String successText = 'BarCode Found',
  32. bool canPop = true,
  33. Widget errorBuilder(
    1. BuildContext,
    2. MobileScannerException,
    3. Widget?
    )?,
  34. Widget placeholderBuilder(
    1. BuildContext,
    2. Widget?
    )?,
  35. void onScannerStarted(
    1. MobileScannerArguments?
    )?,
  36. Rect? scanWindow,
  37. bool? startDelay,
  38. 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);