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<List<UCode>>? onCodes,
  8. void onScanError(
    1. Object error,
    2. StackTrace stackTrace
    )?,
  9. UCameraController? controller,
  10. bool autoStart = true,
  11. UCameraFacing facing = UCameraFacing.back,
  12. UCameraResolution resolution = UCameraResolution.high,
  13. UScanSpeed speed = UScanSpeed.normal,
  14. List<UCodeFormat> formats = const <UCodeFormat>[],
  15. UScanEngine engine = UScanEngine.auto,
  16. bool torchEnabled = false,
  17. bool tryInvert = false,
  18. double? initialZoom,
  19. BoxFit fit = BoxFit.cover,
  20. Widget errorBuilder(
    1. BuildContext context,
    2. UCameraException error
    )?,
  21. WidgetBuilder? placeholderBuilder,
  22. LayoutWidgetBuilder? overlayBuilder,
  23. Rect? scanWindow,
  24. bool restrictToScanWindow = true,
  25. bool useAppLifecycleState = true,
  26. bool tapToFocus = true,
  27. bool pinchToZoom = true,
  28. bool singleScan = true,
  29. bool hapticOnScan = true,
  30. bool showOverlay = true,
  31. Color? overlayColor,
  32. Size scanWindowSize = const Size(280, 280),
  33. Color? borderColor,
  34. double borderWidth = 3,
  35. double borderRadius = 16,
  36. double cornerLength = 32,
  37. bool showCorners = true,
  38. bool showFullBorder = false,
  39. bool showScanLine = true,
  40. Color? scanLineColor,
  41. double scanLineThickness = 2,
  42. Duration scanLineDuration = const Duration(seconds: 2),
  43. bool showTrackingBoxes = false,
  44. String? hintText,
  45. bool showHint = true,
  46. TextStyle? hintTextStyle,
  47. UScannerHintPosition hintPosition = UScannerHintPosition.bottom,
  48. double hintGap = 20,
  49. EdgeInsets hintPadding = const EdgeInsets.symmetric(horizontal: 14, vertical: 10),
  50. Color? hintBackgroundColor,
  51. double hintBorderRadius = 12,
  52. bool showControls = true,
  53. bool showTorchButton = true,
  54. bool showSwitchCameraButton = true,
  55. bool showGalleryButton = false,
  56. bool showZoomSlider = false,
  57. Alignment controlsAlignment = Alignment.bottomCenter,
  58. double controlsSpacing = 24,
  59. EdgeInsets controlsPadding = const EdgeInsets.only(bottom: 40),
  60. Color? controlIconColor,
  61. Color? controlActiveIconColor,
  62. Color? controlBackgroundColor,
  63. double controlButtonSize = 52,
  64. double controlIconSize = 26,
  65. IconData torchOnIcon = Icons.flash_on_rounded,
  66. IconData torchOffIcon = Icons.flash_off_rounded,
  67. IconData switchCameraIcon = Icons.cameraswitch_rounded,
  68. IconData galleryIcon = Icons.photo_library_rounded,
  69. Key? key,
})

Implementation

const UScannerPage({
  this.title,
  this.appBar,
  this.showAppBar = true,
  this.backgroundColor,
  this.autoPopOnScan = true,
  this.onScan,
  this.onCodes,
  this.onScanError,
  this.controller,
  this.autoStart = true,
  this.facing = UCameraFacing.back,
  this.resolution = UCameraResolution.high,
  this.speed = UScanSpeed.normal,
  this.formats = const <UCodeFormat>[],
  this.engine = UScanEngine.auto,
  this.torchEnabled = false,
  this.tryInvert = false,
  this.initialZoom,
  this.fit = BoxFit.cover,
  this.errorBuilder,
  this.placeholderBuilder,
  this.overlayBuilder,
  this.scanWindow,
  this.restrictToScanWindow = true,
  this.useAppLifecycleState = true,
  this.tapToFocus = true,
  this.pinchToZoom = true,
  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.showTrackingBoxes = false,
  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.showZoomSlider = 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,
});