ReaderWidget class
Widget to scan a code from the camera stream
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ReaderWidget
Constructors
- ReaderWidget({Key? key, dynamic onScan(Code)?, dynamic onScanFailure(Code)?, dynamic onMultiScan(Codes)?, dynamic onMultiScanFailure(Codes)?, dynamic onControllerCreated(CameraController? controller, Exception? error)?, dynamic onMultiScanModeChanged(bool)?, bool isMultiScan = false, AlignmentGeometry multiScanModeAlignment = Alignment.bottomRight, EdgeInsetsGeometry multiScanModePadding = const EdgeInsets.all(10), int codeFormat = Format.any, bool tryHarder = false, bool tryInverted = false, bool tryRotate = true, bool showScannerOverlay = true, ScannerOverlay? scannerOverlay, AlignmentGeometry actionButtonsAlignment = Alignment.bottomLeft, EdgeInsetsGeometry actionButtonsPadding = const EdgeInsets.all(10), bool showFlashlight = true, bool showToggleCamera = true, bool showGallery = true, bool allowPinchZoom = true, Duration scanDelay = const Duration(milliseconds: 1000), Duration scanDelaySuccess = const Duration(milliseconds: 1000), double cropPercent = 0.5, ResolutionPreset resolution = ResolutionPreset.high, CameraLensDirection lensDirection = CameraLensDirection.back, Widget loading = const DecoratedBox(decoration: BoxDecoration(color: Colors.black))})
-
const
Properties
- actionButtonsAlignment → AlignmentGeometry
-
Align for action buttons
final
- actionButtonsPadding → EdgeInsetsGeometry
-
Padding for action buttons
final
- allowPinchZoom → bool
-
Allow pinch zoom
final
- codeFormat → int
-
Code format to scan
final
- cropPercent → double
-
Crop percent of the screen, will be ignored if isMultiScan is true
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isMultiScan → bool
-
Allow multiple scans
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- lensDirection → CameraLensDirection
-
Camera lens direction
final
- loading → Widget
-
Loading widget while camera is initializing. Default is a black screen
final
- multiScanModeAlignment → AlignmentGeometry
-
Alignment for multi scan mode button
final
- multiScanModePadding → EdgeInsetsGeometry
-
Padding for multi scan mode button
final
- onControllerCreated → (dynamic Function(CameraController? controller, Exception? error)?)
-
Called when the camera controller is created
final
- onMultiScan → (dynamic Function(Codes)?)
-
Called when a code is detected
final
- onMultiScanFailure → (dynamic Function(Codes)?)
-
Called when a code is not detected
final
- onMultiScanModeChanged → (dynamic Function(bool)?)
-
Called when the multi scan mode is changed
When set to null, the multi scan mode button will not be displayed
final
- onScan → (dynamic Function(Code)?)
-
Called when a code is detected
final
- onScanFailure → (dynamic Function(Code)?)
-
Called when a code is not detected
final
- resolution → ResolutionPreset
-
Camera resolution
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scanDelay → Duration
-
Delay between scans when no code is detected
final
- scanDelaySuccess → Duration
-
Delay between scans when a code is detected, will be ignored if isMultiScan is true
final
- scannerOverlay → ScannerOverlay?
-
Custom scanner overlay
final
- showFlashlight → bool
-
Show flashlight button
final
- showGallery → bool
-
Show toggle camera
final
- showScannerOverlay → bool
-
Show cropping rect
final
- showToggleCamera → bool
-
Show toggle camera
final
- tryHarder → bool
-
Try harder to detect a code
final
- tryInverted → bool
-
Try to detect inverted code
final
- tryRotate → bool
-
Try to rotate the image
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< ReaderWidget> -
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
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
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}) → 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
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited