UScannerPage constructor
const
UScannerPage({
- String? title,
- PreferredSizeWidget? appBar,
- bool showAppBar = true,
- Color? backgroundColor,
- bool autoPopOnScan = true,
- ValueChanged<
String> ? onScan, - ValueChanged<
BarcodeCapture> ? onCapture, - ValueChanged<
List< ? onBarcodes,Barcode> > - void onScanError(
- Object error,
- StackTrace stackTrace
- MobileScannerController? controller,
- bool autoStart = true,
- Size? cameraResolution,
- CameraLensType lensType = CameraLensType.any,
- DetectionSpeed detectionSpeed = DetectionSpeed.normal,
- int detectionTimeoutMs = 250,
- CameraFacing facing = CameraFacing.back,
- List<
BarcodeFormat> formats = const <BarcodeFormat>[], - bool returnImage = false,
- bool torchEnabled = false,
- bool invertImage = false,
- bool autoZoom = false,
- double? initialZoom,
- BoxFit fit = BoxFit.cover,
- Widget errorBuilder()?,
- WidgetBuilder? placeholderBuilder,
- LayoutWidgetBuilder? overlayBuilder,
- Rect? scanWindow,
- bool restrictToScanWindow = false,
- double scanWindowUpdateThreshold = 0.0,
- bool useAppLifecycleState = true,
- bool tapToFocus = false,
- bool singleScan = true,
- bool hapticOnScan = true,
- bool showOverlay = true,
- Color? overlayColor,
- Size scanWindowSize = const Size(280, 280),
- Color? borderColor,
- double borderWidth = 3,
- double borderRadius = 16,
- double cornerLength = 32,
- bool showCorners = true,
- bool showFullBorder = false,
- bool showScanLine = true,
- Color? scanLineColor,
- double scanLineThickness = 2,
- Duration scanLineDuration = const Duration(seconds: 2),
- String? hintText,
- bool showHint = true,
- TextStyle? hintTextStyle,
- UScannerHintPosition hintPosition = UScannerHintPosition.bottom,
- double hintGap = 20,
- EdgeInsets hintPadding = const EdgeInsets.symmetric(horizontal: 14, vertical: 10),
- Color? hintBackgroundColor,
- double hintBorderRadius = 12,
- bool showControls = true,
- bool showTorchButton = true,
- bool showSwitchCameraButton = true,
- bool showGalleryButton = false,
- Alignment controlsAlignment = Alignment.bottomCenter,
- double controlsSpacing = 24,
- EdgeInsets controlsPadding = const EdgeInsets.only(bottom: 40),
- Color? controlIconColor,
- Color? controlActiveIconColor,
- Color? controlBackgroundColor,
- double controlButtonSize = 52,
- double controlIconSize = 26,
- IconData torchOnIcon = Icons.flash_on_rounded,
- IconData torchOffIcon = Icons.flash_off_rounded,
- IconData switchCameraIcon = Icons.cameraswitch_rounded,
- IconData galleryIcon = Icons.photo_library_rounded,
- 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,
});