BarcodeItem class
A single barcode found in the input image. Barcodes with the same content but different locations in the image are considered separate barcodes.
Constructors
-
BarcodeItem.new({required String text, required Uint8List rawBytes, required List<
RangeEncoding> rawBytesEncodings, required StructuredAppendInfo? structuredAppendInfo, BarcodeFormat format = BarcodeFormat.NONE, required List<Point< quad, required List<int> >Point< quadNormalized, required List<double> >Point< extendedQuad, required List<int> >Point< extendedQuadNormalized, bool isUpsideDown = false, ImageRef? sourceImage, required String upcEanExtension, bool isGS1Message = false, bool isGS1CompositePart = false, int dataBarStackSize = 1, double sizeScore = 0.0, required GenericDocument? extractedDocument, int globalIndex = -1})double> > -
BarcodeItem.fromJson(Map<
String, dynamic> json) -
factory
Properties
- dataBarStackSize → int
-
The number of 1D stacks in the barcode. Applies only to DATABAR and DATABAR_EXPANDED barcodes.
final
-
extendedQuad
→ List<
Point< int> > -
As quad, but extended to appropriate height for oned barcodes.
final
-
extendedQuadNormalized
→ List<
Point< double> > -
As quadNormalized, but extended to appropriate height for oned barcodes.
final
- extractedDocument → GenericDocument?
-
The parsed known document format (if parsed successfully).
final
- format → BarcodeFormat
-
Barcode format.
final
- globalIndex → int
-
The index of the barcode to uniquely identify it.
In case of frame accumulation, the index remains the same across frames.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isGS1CompositePart → bool
-
True if this result is the 2D part of a GS1 Composite barcode.
Can only happen if GS1_COMPOSITE scanning is disabled and a part of the composite (1D) or (2D) is scanned separately.
When GS1_COMPOSITE scanning is enabled, parts of the composite barcode are never returned separately, even if their respective
format is enabled in the decoding options.
final
- isGS1Message → bool
-
True if the barcode contains a GS1 message. Requires GS1 handling to be enabled in the decoding option.
final
- isUpsideDown → bool
-
True if this is a 1D barcode that is printed upside-down, that is, the barcode was scanned right-to-left.
final
-
quad
→ List<
Point< int> > -
The four corners of the barcode in the input image, in clockwise order starting from the top left, in image coordinates.
final
-
quadNormalized
→ List<
Point< double> > -
The four corners of the barcode in the input image, in clockwise order starting from the top left, normalized to the range
[0, 1]
.final - rawBytes → Uint8List
-
Raw bytes of barcode contents.
Some barcode formats are able to encode binary data. If a barcode contains binary data, it's provided as a list of bytes in the rawBytes field.
Some barcode formats additionally allow pieces of the data within to have different encodings - UTF-8, ASCII, binary, etc.
The rawBytesEncodings field lists the encoding of each range in the rawBytes array.
For barcode formats that contain a GS1 message (e.g. GS1 Composite), we recommend to use a GS1Handling and extract the GS1 message from the text.
final
-
rawBytesEncodings
→ List<
RangeEncoding> -
Encoding information for the rawBytes field. Each element of this list covers some portion of the rawBytes array.
Taken together, the elements of the list cover the entirety of the rawBytes array without overlap and without holes.
The elements are ordered in increasing order of the start and end indices.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sizeScore → double
-
The size score is a floating point value between 0 and 1 that represents the relative size of the barcode in the input image.
Barcodes taking up a small portion of the input image will have a score close to 0, while barcodes that take a large portion will have a score close to 1.
final
- sourceImage → ImageRef?
-
A crop from the input image containing the barcode.
final
- structuredAppendInfo → StructuredAppendInfo?
-
If this barcode is part of a structured append sequence, this field contains information about the sequence.
final
- text → String
-
Text contained in the barcode. Binary data is returned in the rawBytes field only.
final
- upcEanExtension → String
-
If this is a UPC/EAN barcode that has an EAN-2 or EAN-5 extension, this field contains the extension value. Requires the UPC_EAN_EXTENSION format to be enabled in the decoding options.
final
Methods
-
encodeImages(
) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
release(
) → void -
toJson(
{ToJsonConfiguration? config}) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited