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.
CharacterSet
A character set for ReaderOptions.characterSet.
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({bool scanner = true}) → 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: the platform reported an error not covered by the other ScannerExceptions, or the barcode engine kept failing.
CameraInUseException
The camera is busy: another app (or another part of this app) is using it. Trying again may work once it is released.
CameraNotFoundException
The device has no camera with the requested facing.
CameraPermissionException
The user denied camera access (or it is restricted by the system).
CameraUnsupportedException
Cameras cannot be used here at all: a web page that is not served over https (or from localhost), a browser without camera access, a platform without a camera plugin. Trying again does not help.
EngineException
The barcode engine could not do a call: it failed to start, stopped (shut down, or crashed), ran out of memory or failed inside. After it failed to start or stopped, the next call starts it again; after an error inside a call it keeps running, and the same input may fail the same way.
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.