core library

The core of flutter_zxing: zxing-cpp for Flutter.

Reads barcodes from images and pixels (BarcodeReader) and creates them (BarcodeWriter → BarcodeSymbol, exported black on white as SVG, PNG or a grayscale image). Nothing here interprets the payload or draws UI: those are the layers on top, content.dart, rendering.dart and scanner.dart. flutter_zxing.dart exports all of them.

Classes

Barcode
A barcode found in an image or a camera frame.
BarcodeError
Why a barcode was found but could not be decoded.
BarcodeImage
A created barcode as an 8-bit grayscale raster (0 = black, 255 = white).
BarcodeInput
What BarcodeWriter accepts for a format (BarcodeFormat.input): a description for a form field, an example that encodes, and the kind of keyboard.
BarcodePosition
The four corners of a barcode, in pixels of the source image.
BarcodeReader
Reads barcodes from images: photos, files, screenshots, raw pixels.
BarcodeSequence
One symbol of a structured append sequence (a message split across several barcodes).
BarcodeSymbol
An encoded barcode: the module matrix plus what is needed to render it.
BarcodeWriter
Creates barcodes from text or binary data.
PixelBuffer
Raw pixels to read barcodes from: a video frame, a frame from another camera plugin, a rendered widget, a decoded image.
ReaderOptions
How thoroughly the engine searches an image.

Enums

BarcodeContentType
How the payload of a Barcode should be interpreted.
BarcodeErrorKind
The kind of a BarcodeError.
BarcodeFormat
A barcode symbology, or a specific variant of one.
Binarizer
How an image is turned into black and white before detection.
EanAddOn
What to do with EAN-2/EAN-5 add-on symbols (see ReaderOptions.eanAddOn).
ErrorCorrection
Error correction level: how much of the symbol can be damaged and still read. Higher levels make the symbol larger.
PixelLayout
Byte layout of the pixels in a PixelBuffer.

Constants

zxingCppVersion → const String
The zxing-cpp version inside the engine.

Functions

warmUpBarcodeEngine() → Future<void>
Starts the barcode engine ahead of time, e.g. in main(), so that the first scan or read does not wait for it.

Exceptions / Errors

BarcodeWriteException
The data cannot be encoded in the requested format (e.g. letters in an EAN-13, or too much data for the chosen symbol version).
CameraFailureException
The camera failed: it is used by another app, or the platform reported an error.
CameraNotFoundException
The device has no camera with the requested facing.
CameraPermissionException
The user denied camera access (or it is restricted by the system).
EngineException
The engine failed to start or stopped unexpectedly. The next call starts it again.
ImageDecodeException
The input is not an image the engine can decode (corrupt file, an unsupported format, or not an image at all).
ScannerException
A camera problem reported by the scanner in ScannerState.error.
ZxingException
Base class of every exception thrown by flutter_zxing 4.