content library

Barcode payloads as typed values: barcode.content parses a URL, a Wi-Fi network, a contact, an event, GS1 data and so on.

A layer on top of core.dart, which it exports too.

Classes

Barcode
A barcode found in an image or a camera frame.
BarcodeContent
The payload of a Barcode, parsed into a typed value.
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.
BinaryContent
Binary data.
BoardingPassContent
An airline boarding pass (IATA Bar Coded Boarding Pass, Resolution 792): the passenger and one leg per flight.
BoardingPassLeg
One flight of a BoardingPassContent.
ContactContent
A contact card (vCard or MeCard).
ContentIssue
A problem that keeps BarcodeContent.toPayload from building a value, from BarcodeContent.validate.
CryptoContent
A cryptocurrency payment request: an address, optionally with an amount.
DriverLicenseContent
A North American driver's license or ID card (AAMVA DL/ID standard, the PDF417 on the back).
EmailContent
An e-mail draft (mailto:, MATMSG:, SMTP:).
EmvPaymentContent
An EMVCo merchant-presented QR code (EMV QRCPS): the format of PIX, PayNow, PromptPay, QRIS, VietQR, DuitNow and many other national schemes. 000201…6304XXXX.
EpcPaymentContent
A SEPA credit transfer (EPC QR code, "GiroCode", EPC069-12): BCD\n002\n1\nSCT\n…. Always in euros.
EsimContent
An eSIM activation code (LPA:1$smdp.example.com$MATCHING-ID, GSMA SGP.22): where the phone downloads the profile from.
EventContent
A calendar event (vEvent).
GeoContent
A location (geo:).
GostPaymentContent
A Russian bank transfer (ГОСТ Р 56042-2014): ST00012|Name=…|….
Gs1Content
GS1 data: Application Identifiers and their values.
OtpContent
A one-time password account for an authenticator app (otpauth://totp/Issuer:account?secret=…&issuer=Issuer, the Key URI format of Google Authenticator).
PaymentContent
A payment request: who to pay, into which account, how much and what for. One subclass per standard, each with its own fields; the getters here are what every standard has, so that one screen can show any of them:
PhoneContent
A phone number to call (tel:, facetime:, facetime-audio:).
PixelBuffer
Raw pixels to read barcodes from: a video frame, a frame from another camera plugin, a rendered widget, a decoded image.
ProductContent
A retail product number from an EAN-13, EAN-8, UPC-A or UPC-E barcode: the GTIN, and the ISBN or ISSN when the number is a book or a periodical (prefixes 978/979 and 977).
ReaderOptions
How thoroughly the engine searches an image.
SmartHomeContent
A smart home device's setup code: Matter (MT:…) or HomeKit (X-HM://…), from the label on the device or its box.
SmsContent
A text message draft (sms:, smsto:, mms:, mmsto:).
SpaydPaymentContent
A Czech payment (Short Payment Descriptor, SPAYD): SPD*1.0*ACC:CZ…*AM:480.50*CC:CZK*MSG:….
SwissAddress
An address on a Swiss QR-bill.
SwissQrBillContent
A Swiss QR-bill (Swiss Payment Standards, version 2.3): SPC\n0200\n1\n….
TextContent
Plain text, or anything not recognised as a more specific type.
UpiPaymentContent
An Indian UPI payment: upi://pay?pa=name@bank&pn=…&am=….
UrlContent
A web address.
VinContent
A vehicle identification number (ISO 3779): 17 characters, from the Code 39 or Data Matrix on a windshield, door pillar or title.
WifiContent
Wi-Fi network credentials (WIFI: format).
WifiDppContent
A Wi-Fi Easy Connect (DPP) bootstrapping code: DPP:K:…;; on a router or a smart device, which a phone scans to put the device on its network.

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.
CallType
How a PhoneContent calls.
ContactFormat
How ContactContent.toPayload writes a contact.
CryptoCurrency
The network of a CryptoContent.
EanAddOn
What to do with EAN-2/EAN-5 add-on symbols (see ReaderOptions.eanAddOn).
EmvScheme
The national payment scheme of an EmvPaymentContent, from the globally unique identifier of its merchant account.
ErrorCorrection
Error correction level: how much of the symbol can be damaged and still read. Higher levels make the symbol larger.
LinkService
Services with well-known links: messengers, social networks, music, app stores and maps.
LinkServiceInput
What LinkService.link takes for a service.
OtpAlgorithm
The hash function of an OtpContent.
OtpType
How an OtpContent counts.
PixelLayout
Byte layout of the pixels in a PixelBuffer.
SmartHomePlatform
The smart home standard of a SmartHomeContent.
SwissReferenceType
The kind of reference on a Swiss QR-bill.
VinRegion
Where a vehicle was made, from the first character of its VIN.
WifiSecurity
Security of a Wi-Fi network.

Extensions

BarcodeContentOf on Barcode
barcode.content: the payload parsed into a typed value. Lives in the content layer, so the core Barcode does not depend on parsing.
BarcodeWriterContent on BarcodeWriter
writer.encodeContent(content): encodes a BarcodeContent the way its kind needs. Lives in the content layer, so the core writer does not depend on it.

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.