UScanner class

Inheritance
Available extensions

Constructors

UScanner({ValueChanged<String>? onScan, ValueChanged<List<UCode>>? onCodes, void onScanError(Object error, StackTrace stackTrace)?, UCameraController? controller, bool autoStart = true, UCameraFacing facing = UCameraFacing.back, UCameraResolution resolution = UCameraResolution.high, UCameraLens? lensType, UScanSpeed speed = UScanSpeed.normal, Duration dedupeWindow = const Duration(milliseconds: 1500), List<UCodeFormat> formats = const <UCodeFormat>[], UScanEngine engine = UScanEngine.auto, bool torchEnabled = false, bool tryInvert = false, bool autoZoom = false, double? initialZoom, BoxFit fit = BoxFit.cover, Widget errorBuilder(BuildContext context, UCameraException error)?, WidgetBuilder? placeholderBuilder, LayoutWidgetBuilder? overlayBuilder, Rect? scanWindow, bool restrictToScanWindow = true, bool useAppLifecycleState = true, bool tapToFocus = true, bool pinchToZoom = true, 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), bool showTrackingBoxes = false, 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, bool showZoomSlider = 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})
const

Properties

autoStart → bool
final
autoZoom → bool
final
borderColor → Color?
final
borderRadius → double
final
borderWidth → double
final
controlActiveIconColor → Color?
final
controlBackgroundColor → Color?
final
controlButtonSize → double
final
controlIconColor → Color?
final
controlIconSize → double
final
controller → UCameraController?
External controller. When given, the session options below are ignored.
final
controlsAlignment → Alignment
final
controlsPadding → EdgeInsets
final
controlsSpacing → double
final
cornerLength → double
final
dedupeWindow → Duration
final
engine → UScanEngine
final
errorBuilder → Widget Function(BuildContext context, UCameraException error)?
final
facing → UCameraFacing
final
fit → BoxFit
final
formats → List<UCodeFormat>
Empty means every supported symbology. Restricting this is the single biggest speed win available.
final
galleryIcon → IconData
final
hapticOnScan → bool
final
hashCode → int
The hash code for this object.
no setterinherited
hintBackgroundColor → Color?
final
hintBorderRadius → double
final
hintGap → double
final
hintPadding → EdgeInsets
final
hintPosition → UScannerHintPosition
final
hintText → String?
final
hintTextStyle → TextStyle?
final
initialZoom → double?
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
lensType → UCameraLens?
final
onCodes → ValueChanged<List<UCode>>?
Called with every symbol in each detection, with geometry and metadata.
final
onScan → ValueChanged<String>?
Called with the raw value of the first symbol in each detection.
final
onScanError → void Function(Object error, StackTrace stackTrace)?
final
overlayBuilder → LayoutWidgetBuilder?
final
overlayColor → Color?
final
pinchToZoom → bool
final
placeholderBuilder → WidgetBuilder?
final
resolution → UCameraResolution
final
restrictToScanWindow → bool
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scanLineColor → Color?
final
scanLineDuration → Duration
final
scanLineThickness → double
final
scanWindow → Rect?
Explicit detection window in widget coordinates. Overrides restrictToScanWindow plus scanWindowSize.
final
scanWindowSize → Size
final
showControls → bool
final
showCorners → bool
final
showFullBorder → bool
final
showGalleryButton → bool
final
showHint → bool
final
showOverlay → bool
final
showScanLine → bool
final
showSwitchCameraButton → bool
final
showTorchButton → bool
final
showTrackingBoxes → bool
Draws a live box around each detected symbol.
final
showZoomSlider → bool
final
singleScan → bool
Stop reporting after the first successful scan.
final
speed → UScanSpeed
final
switchCameraIcon → IconData
final
tapToFocus → bool
final
torchEnabled → bool
final
torchOffIcon → IconData
final
torchOnIcon → IconData
final
tryInvert → bool
Also try the inverted image, for light-on-dark symbols.
final
useAppLifecycleState → bool
final

Methods

alignAtBottomCenter({Key? key, double? heightFactor, double? widthFactor}) → Align

Available on Widget, provided by the WidgetsExtension extension

alignAtBottomLeft({Key? key, double? heightFactor, double? widthFactor}) → Align

Available on Widget, provided by the WidgetsExtension extension

alignAtBottomRight({Key? key, double? heightFactor, double? widthFactor}) → Align

Available on Widget, provided by the WidgetsExtension extension

alignAtCenter({Key? key, double? heightFactor, double? widthFactor}) → Align

Available on Widget, provided by the WidgetsExtension extension

alignAtCenterLeft({Key? key, double? heightFactor, double? widthFactor}) → Align

Available on Widget, provided by the WidgetsExtension extension

alignAtCenterRight({Key? key, double? heightFactor, double? widthFactor}) → Align

Available on Widget, provided by the WidgetsExtension extension

alignAtLERP(Alignment a, Alignment b, double t, {Key? key, double? heightFactor, double? widthFactor}) → Align

Available on Widget, provided by the WidgetsExtension extension

alignAtTopCenter({Key? key, double? heightFactor, double? widthFactor}) → Align

Available on Widget, provided by the WidgetsExtension extension

alignAtTopLeft({Key? key, double? heightFactor, double? widthFactor}) → Align

Available on Widget, provided by the WidgetsExtension extension

alignAtTopRight({Key? key, double? heightFactor, double? widthFactor}) → Align

Available on Widget, provided by the WidgetsExtension extension

alignXY(double x, double y, {Key? key, double? heightFactor, double? widthFactor}) → Align

Available on Widget, provided by the WidgetsExtension extension

card({Color? backgroundColor, double? elevation, EdgeInsetsGeometry? margin}) → Widget

Available on Widget, provided by the WidgetsExtension extension

chip({required Color backgroundColor, double? width, double? height, Alignment? alignment, double borderWidth = 1, double radius = 12, Color borderColor = Colors.transparent, EdgeInsets padding = const EdgeInsets.symmetric(horizontal: 8, vertical: 6), EdgeInsetsGeometry? margin, BoxConstraints? constraints}) → Widget

Available on Widget, provided by the WidgetsExtension extension

container({double? width, double? height, Alignment? alignment, Color? backgroundColor, double borderWidth = 1, double radius = 1, Color borderColor = Colors.transparent, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, BoxConstraints? constraints}) → Widget

Available on Widget, provided by the WidgetsExtension extension

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<UScanner>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
expanded({int flex = 1}) → Widget

Available on Widget, provided by the WidgetsExtension extension

fadeSlideIn({int milliseconds = 1000, double offset = 24}) → Widget

Available on Widget, provided by the WidgetsExtension extension

fit({Alignment alignment = Alignment.center}) → Widget

Available on Widget, provided by the WidgetsExtension extension

form(GlobalKey<FormState> key) → Widget

Available on Widget, provided by the WidgetsExtension extension

ltr() → Widget

Available on Widget, provided by the WidgetsExtension extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onDoubleTap(GestureTapCallback? onPressed) → Widget

Available on Widget, provided by the WidgetsExtension extension

onLongPress(GestureTapCallback? onPressed) → Widget

Available on Widget, provided by the WidgetsExtension extension

onPress(VoidCallback onTap, {double pressedScale = 0.9, Duration duration = const Duration(milliseconds: 120)}) → Widget

Available on Widget, provided by the WidgetsExtension extension

onTap(GestureTapCallback? onPressed) → Widget

Available on Widget, provided by the WidgetsExtension extension

onTapInk(GestureTapCallback? onPressed) → Widget

Available on Widget, provided by the WidgetsExtension extension

pAll(double padding) → Widget

Available on Widget, provided by the WidgetsExtension extension

pLTRB(double left, double top, double right, double bottom) → Widget

Available on Widget, provided by the WidgetsExtension extension

pOnly({double left = 0.0, double top = 0.0, double right = 0.0, double bottom = 0.0}) → Widget

Available on Widget, provided by the WidgetsExtension extension

position({double? left, double? top, double? right, double? bottom, double? width, double? height}) → Widget

Available on Widget, provided by the WidgetsExtension extension

pSymmetric({double horizontal = 0.0, double vertical = 0.0}) → Widget

Available on Widget, provided by the WidgetsExtension extension

rotate(double scale) → Widget

Available on Widget, provided by the WidgetsExtension extension

rtl() → Widget

Available on Widget, provided by the WidgetsExtension extension

safeArea() → Widget

Available on Widget, provided by the WidgetsExtension extension

scale(double scale) → Widget

Available on Widget, provided by the WidgetsExtension extension

scrollable({Axis scrollDirection = Axis.vertical}) → Widget

Available on Widget, provided by the WidgetsExtension extension

showMenus(List<PopupMenuEntry<int>> items) → Widget

Available on Widget, provided by the WidgetsExtension extension

toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited
translate(Offset offset) → Widget

Available on Widget, provided by the WidgetsExtension extension

Operators

operator ==(Object other) → bool
The equality operator.
inherited