UScannerPage constructor

const UScannerPage({
  1. String? title,
  2. PreferredSizeWidget? appBar,
  3. bool showAppBar = true,
  4. Color? backgroundColor,
  5. bool autoPopOnScan = true,
  6. ValueChanged<String>? onScan,
  7. ValueChanged<BarcodeCapture>? onCapture,
  8. ValueChanged<List<Barcode>>? onBarcodes,
  9. void onScanError(
    1. Object error,
    2. StackTrace stackTrace
    )?,
  10. MobileScannerController? controller,
  11. bool autoStart = true,
  12. Size? cameraResolution,
  13. CameraLensType lensType = CameraLensType.any,
  14. DetectionSpeed detectionSpeed = DetectionSpeed.normal,
  15. int detectionTimeoutMs = 250,
  16. CameraFacing facing = CameraFacing.back,
  17. List<BarcodeFormat> formats = const <BarcodeFormat>[],
  18. bool returnImage = false,
  19. bool torchEnabled = false,
  20. bool invertImage = false,
  21. bool autoZoom = false,
  22. double? initialZoom,
  23. BoxFit fit = BoxFit.cover,
  24. Widget errorBuilder(
    1. BuildContext,
    2. MobileScannerException
    )?,
  25. WidgetBuilder? placeholderBuilder,
  26. LayoutWidgetBuilder? overlayBuilder,
  27. Rect? scanWindow,
  28. bool restrictToScanWindow = false,
  29. double scanWindowUpdateThreshold = 0.0,
  30. bool useAppLifecycleState = true,
  31. bool tapToFocus = false,
  32. bool singleScan = true,
  33. bool hapticOnScan = true,
  34. bool showOverlay = true,
  35. Color? overlayColor,
  36. Size scanWindowSize = const Size(280, 280),
  37. Color? borderColor,
  38. double borderWidth = 3,
  39. double borderRadius = 16,
  40. double cornerLength = 32,
  41. bool showCorners = true,
  42. bool showFullBorder = false,
  43. bool showScanLine = true,
  44. Color? scanLineColor,
  45. double scanLineThickness = 2,
  46. Duration scanLineDuration = const Duration(seconds: 2),
  47. String? hintText,
  48. bool showHint = true,
  49. TextStyle? hintTextStyle,
  50. UScannerHintPosition hintPosition = UScannerHintPosition.bottom,
  51. double hintGap = 20,
  52. EdgeInsets hintPadding = const EdgeInsets.symmetric(horizontal: 14, vertical: 10),
  53. Color? hintBackgroundColor,
  54. double hintBorderRadius = 12,
  55. bool showControls = true,
  56. bool showTorchButton = true,
  57. bool showSwitchCameraButton = true,
  58. bool showGalleryButton = false,
  59. Alignment controlsAlignment = Alignment.bottomCenter,
  60. double controlsSpacing = 24,
  61. EdgeInsets controlsPadding = const EdgeInsets.only(bottom: 40),
  62. Color? controlIconColor,
  63. Color? controlActiveIconColor,
  64. Color? controlBackgroundColor,
  65. double controlButtonSize = 52,
  66. double controlIconSize = 26,
  67. IconData torchOnIcon = Icons.flash_on_rounded,
  68. IconData torchOffIcon = Icons.flash_off_rounded,
  69. IconData switchCameraIcon = Icons.cameraswitch_rounded,
  70. IconData galleryIcon = Icons.photo_library_rounded,
  71. Key? key,
})

Implementation

const UScannerPage({
  this.title,
  this.appBar,
  this.showAppBar = true,
  this.backgroundColor,
  this.autoPopOnScan = true,
  this.onScan,
  this.onCapture,
  this.onBarcodes,
  this.onScanError,
  this.controller,
  this.autoStart = true,
  this.cameraResolution,
  this.lensType = CameraLensType.any,
  this.detectionSpeed = DetectionSpeed.normal,
  this.detectionTimeoutMs = 250,
  this.facing = CameraFacing.back,
  this.formats = const <BarcodeFormat>[],
  this.returnImage = false,
  this.torchEnabled = false,
  this.invertImage = false,
  this.autoZoom = false,
  this.initialZoom,
  this.fit = BoxFit.cover,
  this.errorBuilder,
  this.placeholderBuilder,
  this.overlayBuilder,
  this.scanWindow,
  this.restrictToScanWindow = false,
  this.scanWindowUpdateThreshold = 0.0,
  this.useAppLifecycleState = true,
  this.tapToFocus = false,
  this.singleScan = true,
  this.hapticOnScan = true,
  this.showOverlay = true,
  this.overlayColor,
  this.scanWindowSize = const Size(280, 280),
  this.borderColor,
  this.borderWidth = 3,
  this.borderRadius = 16,
  this.cornerLength = 32,
  this.showCorners = true,
  this.showFullBorder = false,
  this.showScanLine = true,
  this.scanLineColor,
  this.scanLineThickness = 2,
  this.scanLineDuration = const Duration(seconds: 2),
  this.hintText,
  this.showHint = true,
  this.hintTextStyle,
  this.hintPosition = UScannerHintPosition.bottom,
  this.hintGap = 20,
  this.hintPadding = const EdgeInsets.symmetric(horizontal: 14, vertical: 10),
  this.hintBackgroundColor,
  this.hintBorderRadius = 12,
  this.showControls = true,
  this.showTorchButton = true,
  this.showSwitchCameraButton = true,
  this.showGalleryButton = false,
  this.controlsAlignment = Alignment.bottomCenter,
  this.controlsSpacing = 24,
  this.controlsPadding = const EdgeInsets.only(bottom: 40),
  this.controlIconColor,
  this.controlActiveIconColor,
  this.controlBackgroundColor,
  this.controlButtonSize = 52,
  this.controlIconSize = 26,
  this.torchOnIcon = Icons.flash_on_rounded,
  this.torchOffIcon = Icons.flash_off_rounded,
  this.switchCameraIcon = Icons.cameraswitch_rounded,
  this.galleryIcon = Icons.photo_library_rounded,
  super.key,
});