BarcodeEan class Null safety

Base class to generate EAN Barcodes

International Article Number (also European Article Number or EAN), a standard describing a barcode symbology and numbering system

Inheritance

Constructors

BarcodeEan()
Create an EAN Barcode
const

Properties

charSet Iterable<int>
Returns the list of accepted codePoints for this Barcode
read-only, override
hashCode int
The hash code for this object. [...]
read-only, inherited
maxLength int
Returns maximum number of characters this Barcode can encode
read-only, inherited
minLength int
Returns minimum number of characters this Barcode can encode
read-only, inherited
name String
Returns the name of this Barcode
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

add(int data, int count) Iterable<bool>
Build a stream of bool that represents a white or black bar from a bit encoded int with count as the number of bars to draw
@protected, inherited
checkLength(String data, int length) String
Check the EAN Barcode length and verify the checksum. if the checksum is omitted, calculate and append it to the data.
checkSumModulo10(String data) String
Calculate the Checksum using a modulo 10
checkSumModulo11(String data) String
Calculate the Checksum using a modulo 11
convert(String data) Iterable<bool>
Actual barcode computation method, returns a stream of bool which represents the presence or absence of a bar
@protected, inherited
getHeight(int index, int count, double width, double height, double fontHeight, double textPadding, bool drawText) double
Get the bar height for a specific index
@protected, inherited
getText(String data) String
Get the generated texts, for testing purposes
@visibleForTesting, inherited
isValid(String data) bool
Check if the Barcode is valid
@nonVirtual, inherited
isValidBytes(Uint8List data) bool
Check if the Barcode is valid
@nonVirtual, inherited
make(String data, {required double width, required double height, bool drawText = false, double? fontHeight, double? textPadding}) Iterable<BarcodeElement>
Main method to produce the barcode graphic description. Returns a stream of drawing operations required to properly display the barcode as a UTF-8 string. [...]
@nonVirtual, inherited
makeBytes(Uint8List data, {required double width, required double height, bool drawText = false, double? fontHeight, double? textPadding}) Iterable<BarcodeElement>
Generate the barcode graphic description like make but takes a Uint8List data.
inherited
makeText(String data, double width, double height, double fontHeight, double textPadding, double lineWidth) Iterable<BarcodeElement>
Stream the text operations required to draw the barcode texts. This is automatically called by make
@protected, inherited
marginLeft(bool drawText, double width, double height, double fontHeight, double textPadding) double
Margin before the first bar
@protected, inherited
marginRight(bool drawText, double width, double height, double fontHeight, double textPadding) double
Margin after the last bar
@protected, inherited
marginTop(bool drawText, double width, double height, double fontHeight, double textPadding) double
Margin at the top of the barcode
@protected, inherited
normalize(String data) String
Returns the barcode string with the correct checksum
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toHex(String data) String
Computes a hexadecimal representation of the barcode, mostly for testing purposes
@visibleForTesting, inherited
toString() String
A string representation of this object. [...]
inherited
toSvg(String data, {double x = 0, double y = 0, double width = 200, double height = 80, bool drawText = true, String fontFamily = 'monospace', double? fontHeight, double? textPadding, int color = 0, bool fullSvg = true, double baseline = 0.75}) String
Create an SVG file with this Barcode from String data
@nonVirtual, inherited
toSvgBytes(Uint8List data, {double x = 0, double y = 0, double width = 200, double height = 80, bool drawText = true, String fontFamily = 'monospace', double? fontHeight, double? textPadding, int color = 0, bool fullSvg = true, double baseline = 0.75}) String
Create an SVG file with this Barcode from Uint8List data
inherited
verify(String data) → void
Check if the Barcode is valid. Throws BarcodeException with a proper message in case of error
@nonVirtual, inherited
verifyBytes(Uint8List data) → void
Check if the Barcode is valid. Throws BarcodeException with a proper message in case of error
@mustCallSuper, inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited