BarcodeKitView class
A utility widget that handles most functionality needed to scan barcodes
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- BarcodeKitView
Constructors
-
BarcodeKitView({required void onBarcodeScanned(DetectedBarcode barcode), required BarcodeKitUiBuilder uiBuilder, required Set<
BarcodeFormat> formats, void onTextDetected(String detectedText)?, Color backdropColor = Colors.black, Widget barcodeOverlayBuilder(BuildContext context, DetectedBarcode barcode)? = defaultBarcodeOverlayBuilder, bool paused = false, bool mask = true, double maskHeight = 200, double maskWidth = 200, double pauseBlurAmount = 10, double pauseZoomAmount = 0.2, bool followRotation = true, List<Widget> ? children, BoxFit cameraFit = BoxFit.cover, bool enableOCR = false, CameraLensDirection direction = CameraLensDirection.back, List<CameraLensDirection> fallbackDirections = const [CameraLensDirection.front], Widget? widgetAboveMask, Widget? widgetBelowMask, double maskAdditionpauseOpacity = 0.1, Key? key}) -
Create a new BarcodeKitView
const
Properties
- backdropColor → Color
-
The color that is used to fill around the mask
final
- barcodeOverlayBuilder → Widget Function(BuildContext context, DetectedBarcode barcode)?
-
Widget that gets transformed to be placed on top of the barcode.
Needs to be 1x1 in size to work properly
final
- cameraFit → BoxFit
-
The fit of the camera view
final
-
children
→ List<
Widget> ? -
The children that are placed on top of the camera view
final
- direction → CameraLensDirection
-
Direction of the camera
final
- enableOCR → bool
-
Whether to run OCR
final
-
fallbackDirections
→ List<
CameraLensDirection> -
Fallback camera directions to try if the primary direction is not
available
final
- followRotation → bool
-
Whether the camera should follow the rotation of the device
final
-
formats
→ Set<
BarcodeFormat> -
The formats that should be scanned
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- mask → bool
-
Whether the mask should be shown
final
- maskAdditionpauseOpacity → double
-
Opacity of widgetAboveMask and widgetBelowMask when the camera is
paused
final
- maskHeight → double
-
The height of the mask
final
- maskWidth → double
-
The width of the mask
final
- onBarcodeScanned → void Function(DetectedBarcode barcode)
-
The callback that is called when a barcode is scanned
final
- onTextDetected → void Function(String detectedText)?
-
Callback for when text is detected
final
- pauseBlurAmount → double
-
The amount of blur that is applied to the camera view when the
camera is paused
final
- paused → bool
-
Whether the camera should be paused, will prevent calls
to onBarcodeScanned
final
- pauseZoomAmount → double
-
The amount of zoom that is applied to the camera view when the
camera is paused
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- uiBuilder → BarcodeKitUiBuilder
-
The ui builder that is used to build the UI for requesting permissions
etc.
final
- widgetAboveMask → Widget?
-
Widget to be placed above the mask
final
- widgetBelowMask → Widget?
-
Widget to be placed below the mask
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< BarcodeKitView> -
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, 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
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited