AiBarcodeScanner constructor

const AiBarcodeScanner({
  1. Key? key,
  2. BoxFit fit = BoxFit.cover,
  3. MobileScannerController? controller,
  4. double scanWindowUpdateThreshold = 0.0,
  5. Widget overlayBuilder(
    1. BuildContext,
    2. BoxConstraints,
    3. MobileScannerController,
    4. bool?,
    )?,
  6. Widget errorBuilder(
    1. BuildContext,
    2. MobileScannerException
    )?,
  7. void onDetectError(
    1. Object,
    2. StackTrace
    )?,
  8. bool useAppLifecycleState = true,
  9. Widget placeholderBuilder(
    1. BuildContext
    )?,
  10. void onDispose()?,
  11. Rect? scanWindow,
  12. PreferredSizeWidget? appBarBuilder(
    1. BuildContext context,
    2. MobileScannerController controller
    )?,
  13. void onDetect(
    1. BarcodeCapture
    )?,
  14. bool validator(
    1. BarcodeCapture
    )?,
  15. void onImagePick(
    1. String?
    )?,
  16. GalleryButtonType galleryButtonType = GalleryButtonType.filled,
  17. Widget? bottomSheetBuilder(
    1. BuildContext context,
    2. MobileScannerController controller
    )?,
  18. Widget? bottomNavigationBarBuilder(
    1. BuildContext context,
    2. MobileScannerController controller
    )?,
  19. bool extendBodyBehindAppBar = true,
  20. AlignmentGeometry? galleryButtonAlignment,
  21. List<Widget>? actions,
  22. bool setPortraitOrientation = true,
  23. ScannerOverlayConfig overlayConfig = const ScannerOverlayConfig(),
  24. String galleryButtonText = 'Upload from gallery',
  25. IconData galleryIcon = CupertinoIcons.photo,
  26. IconData cameraSwitchIcon = CupertinoIcons.arrow_2_circlepath,
  27. IconData flashOnIcon = CupertinoIcons.bolt_fill,
  28. IconData flashOffIcon = CupertinoIcons.bolt,
  29. bool returnImage = false,
  30. Future<void> onCustomImagePicker(
    1. bool validator(
      1. BarcodeCapture
      )?,
    2. void onDetect(
      1. BarcodeCapture
      )?,
    3. MobileScannerController controller
    )?,
  31. Widget? child,
})

Implementation

const AiBarcodeScanner({
  super.key,
  this.fit = BoxFit.cover,
  this.controller,
  this.scanWindowUpdateThreshold = 0.0,
  this.overlayBuilder,
  this.errorBuilder,
  this.onDetectError,
  this.useAppLifecycleState = true,
  this.placeholderBuilder,
  this.onDispose,
  this.scanWindow,
  this.appBarBuilder,
  this.onDetect,
  this.validator,
  this.onImagePick,
  this.galleryButtonType = GalleryButtonType.filled,
  this.bottomSheetBuilder,
  this.bottomNavigationBarBuilder,
  this.extendBodyBehindAppBar = true,
  this.galleryButtonAlignment,
  this.actions,
  this.setPortraitOrientation = true,
  this.overlayConfig = const ScannerOverlayConfig(),
  this.galleryButtonText = 'Upload from gallery',
  this.galleryIcon = CupertinoIcons.photo,
  this.cameraSwitchIcon = CupertinoIcons.arrow_2_circlepath,
  this.flashOnIcon = CupertinoIcons.bolt_fill,
  this.flashOffIcon = CupertinoIcons.bolt,
  this.returnImage = false,
  this.onCustomImagePicker,
  this.child,
});